setOptionsAndQuery() public méthode

public setOptionsAndQuery ( array | integer $options = null, string | array | Query $query = '' )
$options array | integer
$query string | array | Query
 /**
  * Create search object
  *
  * @param  string|array|\Elastica\Query $query   Array with all query data inside or a Elastica\Query object
  * @param  int|array                   $options OPTIONAL Limit or associative array of options (option=>value)
  * @return \Elastica\Search
  */
 public function createSearch($query = '', $options = null)
 {
     $search = new Search($this->getIndex()->getClient());
     $search->addIndex($this->getIndex());
     $search->addType($this);
     $search->setOptionsAndQuery($options, $query);
     return $search;
 }
Exemple #2
0
 /**
  * @param string|array|\Elastica\Query $query
  * @param int|array                    $options
  * @param BuilderInterface             $builder
  *
  * @return Search
  */
 public function createSearch($query = '', $options = null, BuilderInterface $builder = null)
 {
     $search = new Search($this->getClient(), $builder);
     $search->addIndex($this);
     $search->setOptionsAndQuery($options, $query);
     return $search;
 }