Basho\Tests\SearchOperationsTest::testSearch PHP Method

testSearch() public method

public testSearch ( )
    public function testSearch()
    {
        foreach (static::$search_content as $key => $object) {
            $command = (new Command\Builder\StoreObject(static::$riak))->buildObject($object, ['Content-Type' => 'application/json'])->buildLocation($key, 'sabres', self::SEARCH_BUCKET_TYPE)->build();
            $command->execute();
        }
        sleep(5);
        $command = (new Command\Builder\Search\FetchObjects(static::$riak))->withQuery('name_s:*Gi*')->withIndexName(static::INDEX)->build();
        $response = $command->execute();
        $this->assertEquals('200', $response->getCode(), $response->getMessage());
        $this->assertEquals(2, $response->getNumFound());
        $docs = $response->getDocs();
        foreach ($docs as $d) {
            $this->assertTrue('B. Gionta' == $d->name_s || 'Z. Girgensons' == $d->name_s);
        }
    }