public function addType($type)
{
if ($type instanceof Type) {
$type = $type->getName();
}
if (!is_string($type)) {
throw new InvalidException('Invalid type type');
}
$this->_types[] = $type;
return $this;
}
/** * @return \Elastica\ResultSet */ public function getSearchResult() { $index = $this->search->getIndex($this->getIndexName() . '_' . $this->language); $search = new Search($this->search->getClient()); $search->addIndex($index); $search->addType($index->getType($this->indexType)); $result = $search->search($this->query); return $result; }