/** * 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; }
/** * @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; }