本文整理汇总了PHP中Elasticsearch\Client::exists方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::exists方法的具体用法?PHP Client::exists怎么用?PHP Client::exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Elasticsearch\Client
的用法示例。
在下文中一共展示了Client::exists方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCustomQueryParams
public function testCustomQueryParams()
{
$params = array();
$params['hosts'] = array($_SERVER['ES_TEST_HOST']);
$client = new Elasticsearch\Client($params);
$getParams = array('index' => 'test', 'type' => 'test', 'id' => 1, 'parent' => 'abc', 'custom' => array('customToken' => 'abc', 'otherToken' => 123));
$exists = $client->exists($getParams);
}
示例2: exists
/**
* @inheritdoc
*/
public function exists(array $params = [])
{
return $this->client->exists($params);
}
示例3: seeItemExistsInElasticsearch
/**
* check if an item exists in a given index
*
* @param string $index index name
* @param string $type item type
* @param string $id item id
*
* @return array
*/
public function seeItemExistsInElasticsearch($index, $type, $id)
{
return $this->elasticSearch->exists(['index' => $index, 'type' => $type, 'id' => $id]);
}
示例4: exists
/**
* Returns whether an entity with the given id exists.
* @param string $id
* @return boolean true if an entity with the given id exists, false otherwise
*/
public function exists($id)
{
return $this->elasticsearchClient->exists(array('id' => $id, 'index' => $this->index, 'type' => $this->getType()));
}
示例5: existsStatement
/**
* Execute a exists statement on index.
*
* @param array $params
*
* @return array|bool
*/
public function existsStatement(array $params)
{
return $this->elastic->exists($this->setStatementIndex($params));
}
示例6: testExists
public function testExists()
{
$this->markTestSkipped('Unsupported yet');
$this->assertTrue($this->client->exists(['index' => 'my_index', 'type' => 'my_type', 'id' => 'my_id']));
}
示例7: testZeroRetries
/**
* @expectedException \Elasticsearch\Common\Exceptions\Curl\CouldNotConnectToHost
*/
public function testZeroRetries()
{
$params = array('retries' => 0, 'hosts' => array('localhost:8000'));
$client = new Elasticsearch\Client($params);
$client->exists(array("index" => 'test', 'type' => 'test', 'id' => 'test'));
}
示例8: testHTTPS
public function testHTTPS()
{
// Hosts param must be an array.
$params = array('hosts' => array('https://localhost'));
$client = new Elasticsearch\Client($params);
try {
$client->exists(array('index' => 't', 'type' => 't', 'id' => 1));
} catch (\Exception $e) {
}
$last = $client->transport->getLastConnection()->getLastRequestInfo();
$this->assertEquals('https://localhost:9200/t/t/1?', $last['request']['uri']);
}