getIndices() public method

Return array of indices.
public getIndices ( ) : array
return array List of index names
Exemplo n.º 1
0
 public function testAddIndices()
 {
     $client = $this->_getClient();
     $search = new Search($client);
     $indices = array();
     $indices[] = $client->getIndex('elastica_test1');
     $indices[] = $client->getIndex('elastica_test2');
     $search->addIndices($indices);
     $this->assertEquals(2, count($search->getIndices()));
 }
Exemplo n.º 2
0
 /**
  * @group unit
  */
 public function testAddNumericIndex()
 {
     $client = $this->_getClient();
     $search = new Search($client);
     $search->addIndex(1);
     $this->assertContains('1', $search->getIndices(), 'Make sure it has been added and converted to string');
 }
Exemplo n.º 3
0
 /**
  * @param  \Elastica\Search $search
  * @return array
  */
 protected function _getSearchDataHeader(BaseSearch $search)
 {
     $header = $search->getOptions();
     if ($search->hasIndices()) {
         $header['index'] = $search->getIndices();
     }
     if ($search->hasTypes()) {
         $header['types'] = $search->getTypes();
     }
     return $header;
 }
Exemplo n.º 4
0
 /**
  * @param \Elastica\Search $search
  *
  * @return array
  */
 protected function _getSearchDataHeader(BaseSearch $search)
 {
     $header = $search->getOptions();
     if ($search->hasIndices()) {
         $header['index'] = $search->getIndices();
     }
     if ($search->hasTypes()) {
         $header['types'] = $search->getTypes();
     }
     // Filter options accepted in the "header"
     return array_intersect_key($header, array_flip(self::$HEADER_OPTIONS));
 }