Elastica\Query\Nested::setPath PHP Method

setPath() public method

Adds field to mlt query.
public setPath ( string $path )
$path string Nested object path
    public function setPath($path)
    {
        return $this->setParam('path', $path);
    }

Usage Example

Beispiel #1
0
 /**
  * @group unit
  */
 public function testSetQuery()
 {
     $nested = new Nested();
     $path = 'test1';
     $queryString = new QueryString('test');
     $this->assertInstanceOf('Elastica\\Query\\Nested', $nested->setQuery($queryString));
     $this->assertInstanceOf('Elastica\\Query\\Nested', $nested->setPath($path));
     $expected = array('nested' => array('query' => $queryString->toArray(), 'path' => $path));
     $this->assertEquals($expected, $nested->toArray());
 }
All Usage Examples Of Elastica\Query\Nested::setPath