/**
  * Creates a product search result for the passed criteria object.
  * The criteria object contains different core conditions and plugin conditions.
  * This conditions has to be handled over the different condition handlers.
  *
  * The search gateway has to implement an event which plugin can be listened to,
  * to add their own handler classes.
  *
  * @param SearchBundle\Criteria $criteria
  * @param ShopContextInterface $context
  * @return SearchBundle\ProductNumberSearchResult
  */
 public function search(SearchBundle\Criteria $criteria, ShopContextInterface $context)
 {
     $query = $this->queryBuilderFactory->createProductQuery($criteria, $context);
     $products = $this->getProducts($query);
     $total = $this->getTotalCount($query);
     $facets = $this->createFacets($criteria, $context);
     $result = new SearchBundle\ProductNumberSearchResult($products, intval($total), $facets);
     return $result;
 }