public function setOption($key, $value)
{
$this->_validateOption($key);
$this->_options[$key] = $value;
return $this;
}
protected function buildQuery(array $classes) { $searchQuery = new Search($this->client); $searchQuery->setOption(Search::OPTION_VERSION, true); foreach ($classes as $class) { if ($class->index) { $indexObject = $this->getIndex($class->index); $searchQuery->addIndex($indexObject); if ($class->type) { $searchQuery->addType($indexObject->getType($class->type)); } } } return $searchQuery; }