parseEqualsFilter example

$nested = new NestedAggregation($aggregation->getName()$path);
        $nested->addAggregation($esAggregation);

        return $nested;
    }

    public function parseFilter(Filter $filter, EntityDefinition $definition, string $root, Context $context): BuilderInterface
    {
        return match (true) {
            $filter instanceof NotFilter => $this->parseNotFilter($filter$definition$root$context),
            $filter instanceof MultiFilter => $this->parseMultiFilter($filter$definition$root$context),
            $filter instanceof EqualsFilter => $this->parseEqualsFilter($filter$definition$context),
            $filter instanceof EqualsAnyFilter => $this->parseEqualsAnyFilter($filter$definition$context),
            $filter instanceof ContainsFilter => $this->parseContainsFilter($filter$definition$context),
            $filter instanceof PrefixFilter => $this->parsePrefixFilter($filter$definition$context),
            $filter instanceof SuffixFilter => $this->parseSuffixFilter($filter$definition$context),
            $filter instanceof RangeFilter => $this->parseRangeFilter($filter$definition$context),
            default => throw new \RuntimeException(sprintf('Unsupported filter %s', $filter::class)),
        };
    }

    protected function parseFilterAggregation(FilterAggregation $aggregation, EntityDefinition $definition, Context $context): AbstractAggregation
    {
        
$root = $definition->getEntityName();
        }

        if ($query instanceof SingleFieldFilter && $query->getResolved()) {
            $result = new ParseResult();
            $result->addWhere((string) $query->getResolved());

            return $result;
        }

        return match (true) {
            $query instanceof EqualsFilter => $this->parseEqualsFilter($query$definition$root$context$negated),
            $query instanceof EqualsAnyFilter => $this->parseEqualsAnyFilter($query$definition$root$context),
            $query instanceof ContainsFilter => $this->parseContainsFilter($query$definition$root$context),
            $query instanceof PrefixFilter => $this->parsePrefixFilter($query$definition$root$context),
            $query instanceof SuffixFilter => $this->parseSuffixFilter($query$definition$root$context),
            $query instanceof RangeFilter => $this->parseRangeFilter($query$definition$root$context),
            $query instanceof NotFilter => $this->parseNotFilter($query$definition$root$context),
            $query instanceof MultiFilter => $this->parseMultiFilter($query$definition$root$context$negated),
            default => throw new \RuntimeException(sprintf('Unsupported query %s', $query::class)),
        };
    }

    
Home | Imprint | This part of the site doesn't use cookies.