Doctrine\OrientDB\Query\Query::lookup PHP Method

lookup() public method

public lookup ( $indexName )
    public function lookup($indexName)
    {
        $commandClass = $this->getCommandClass('index.lookup');
        $this->command = new $commandClass($indexName);
        return $this->command;
    }

Usage Example

 public function testExecutingAIndexLookup()
 {
     $query = new Query();
     $query->lookup('index_name_2');
     $this->assertHttpStatus(200, $this->doQuery($query));
     $query->where('fakekey = ?', 2);
     $jsonResult = json_decode($this->doQuery($query)->getInnerResponse()->getBody(), true);
     $this->assertHttpStatus(200, $this->doQuery($query));
     $this->assertCount(0, $jsonResult['result']);
     $query = new Query();
     $query->from(array('index:index_name_2'))->between('key', '10.0', '10.1');
     $this->assertHttpStatus(200, $this->doQuery($query));
 }