Elastica\Search::setOption PHP Method

setOption() public method

public setOption ( string $key, mixed $value )
$key string
$value mixed
    public function setOption($key, $value)
    {
        $this->_validateOption($key);
        $this->_options[$key] = $value;
        return $this;
    }

Usage Example

コード例 #1
0
ファイル: Client.php プロジェクト: akleiber/search
 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;
 }
All Usage Examples Of Elastica\Search::setOption