/**
  * @param Request $request
  * @param Product $products
  * @param SearchServiceInterface $search
  * @param GammaSubscriptionManager $subscriptions
  * @return mixed
  */
 public function index(Request $request, Product $products, SearchServiceInterface $search, GammaSubscriptionManager $subscriptions)
 {
     $thumbnailRequirements = function ($query) {
         $query->dimension(150);
     };
     //only products from the subscription accounts
     $indexes = $this->indexesToUse($subscriptions);
     $query = ['index' => $indexes, 'type' => $products->getSearchableType(), 'body' => ['query' => ['filtered' => ['query' => ['match_all' => new \StdClass()]]]]];
     return $search->search('products', $query, ['brand', 'brand.translations', 'images', 'images.sizes' => $thumbnailRequirements, 'images.translations']);
 }