/**
  * Creates a search request on the internal search gateway to
  * get the product result for the passed criteria object.
  *
  * @param Criteria $criteria
  * @param Struct\ProductContextInterface $context
  * @return ProductSearchResult
  */
 public function search(Criteria $criteria, Struct\ProductContextInterface $context)
 {
     $productSearchResult = $this->productSearch->search($criteria, $context);
     $facets = $productSearchResult->getFacets();
     $totalCount = $productSearchResult->getTotalCount() + $this->sortingComponent->getTotalCount();
     return new ProductNumberSearchResult($productSearchResult->getProducts(), $totalCount, $facets);
 }
Пример #2
0
 public function search(Criteria $criteria, Struct\ProductContextInterface $context)
 {
     $result = $this->coreService->search($criteria, $context);
     if ($criteria->hasCondition('search')) {
         $blog = $this->searchBlog($criteria, $context);
         $result->addAttribute('swag_elastic_search', new Struct\Attribute(['blog' => $blog]));
     }
     return $result;
 }