protected function valueMatchesFilter($value, IndexQueryFilter $filter): bool
    {
        switch ($filter->getOperator()) {
            case IndexQueryFilterOperator::EQUAL_TO:
                return $value == $filter->getValue();

            case IndexQueryFilterOperator::NOT_EQUAL_TO:
                return $value != $filter->getValue();

            case IndexQueryFilterOperator::GREATER_THAN:
                return $value > $filter->getValue();

            case IndexQueryFilterOperator::GREATER_THAN_OR_EQUAL_TO:
                return $value >= $filter->getValue();

            case IndexQueryFilterOperator::LESS_THAN:
                return $value < $filter->getValue();

            case IndexQueryFilterOperator::LESS_THAN_OR_EQUAL_TO:
                return $value <= $filter->getValue();
        }
    }