code: public function addFacetedQuery($query, $index, array $keys)
      {
          $this->AddQuery($query, $index);
  
          //Clear Offset
          $currentOffset = $this->_offset;
          $mode = $this->_sort;
          $sortby = $this->_sortby;
          $limit = $this->_limit;
  
          $this->_offset = 0;
          $this->_sort = 0;
          $this->_sortby = '';
          $this->SetLimits(0, 999);
  
          foreach ($keys as $key) {
              $this->setGroupByAttr($key);
              $this->AddQuery($query, $index);
          }
  
          //Reset
          $this->_offset = $currentOffset;
          $this->_sort = $mode;
          $this->_sortby = $sortby;
          $this->SetLimits($currentOffset, $limit);
      }
docs: Adiciona multiplas queries a partir de uma query
  matriz e chaves usadas na busca facetada.
  
  Multi-queries are just a mechanism that lets you send several search
  queries to searchd in one batch. That, in turn, lets searchd internally
  optimize common parts between the queries. And that’s where the savings
  come from.
  
  @see http://sphinxsearch.com/blog/2010/04/05/facets-multi-queries-and-searching-3x-faster/
  
  @param string $query
  @param string $index
  @param array  $keys