getNestedPath example

return new FieldSort($accessor$sorting->getDirection());
    }

    public function parseAggregation(Aggregation $aggregation, EntityDefinition $definition, Context $context): ?AbstractAggregation
    {
        $fieldName = $this->buildAccessor($definition$aggregation->getField()$context);

        $fields = $aggregation->getFields();

        $path = null;
        if (\count($fields) > 0) {
            $path = $this->getNestedPath($definition$fields[0]);
        }

        $esAggregation = $this->createAggregation($aggregation$fieldName$definition$context);

        if (!$path || $aggregation instanceof FilterAggregation) {
            return $esAggregation;
        }

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

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