当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::exists方法代码示例

本文整理汇总了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);
 }
开发者ID:pancke,项目名称:yyaf,代码行数:8,代码来源:ClientTest.php

示例2: exists

 /**
  * @inheritdoc
  */
 public function exists(array $params = [])
 {
     return $this->client->exists($params);
 }
开发者ID:nordsoftware,项目名称:lumen-elasticsearch,代码行数:7,代码来源:ElasticsearchService.php

示例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]);
 }
开发者ID:jotweh,项目名称:codeception-elasticsearch,代码行数:13,代码来源:ElasticSearch.php

示例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()));
 }
开发者ID:aboutyou,项目名称:ayoc-persistence-elasticsearch,代码行数:9,代码来源:ElasticsearchCrudRepository.php

示例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));
 }
开发者ID:sleimanx2,项目名称:plastic,代码行数:11,代码来源:Connection.php

示例6: testExists

 public function testExists()
 {
     $this->markTestSkipped('Unsupported yet');
     $this->assertTrue($this->client->exists(['index' => 'my_index', 'type' => 'my_type', 'id' => 'my_id']));
 }
开发者ID:iwai,项目名称:elasticsearch-guzzle5connection,代码行数:5,代码来源:ESClientIntegrationTest.php

示例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'));
 }
开发者ID:ishoj,项目名称:ishoj.dk,代码行数:9,代码来源:ClientTest.php

示例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']);
 }
开发者ID:diglin,项目名称:smile-magento-elasticsearch,代码行数:12,代码来源:ClientTest.php


注:本文中的Elasticsearch\Client::exists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。