sortFacets example

if (isset($data['hits']['max_score'])) {
            $result->addAttribute('elastic_search', new Attribute(['max_score' => $data['hits']['max_score']]));
        }

        foreach ($this->handlerRegistry->getHandlers() as $handler) {
            if (!($handler instanceof ResultHydratorInterface)) {
                continue;
            }
            $handler->hydrate($data$result$criteria$context);
        }

        $facets = $this->sortFacets($criteria$result);

        return new ProductNumberSearchResult(
            $products,
            $data['hits']['total'],
            $facets,
            $result->getAttributes()
        );
    }

    private function buildSearch(Criteria $criteria, ShopContextInterface $context): EsSearch
    {
        
Home | Imprint | This part of the site doesn't use cookies.