當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。