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


PHP Client::delete方法代码示例

本文整理汇总了PHP中Elasticsearch\Client::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::delete方法的具体用法?PHP Client::delete怎么用?PHP Client::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Elasticsearch\Client的用法示例。


在下文中一共展示了Client::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 /**
  * @param string $identity
  */
 public function delete($identity)
 {
     try {
         $this->client->delete(['index' => $this->index, 'type' => $this->type, 'id' => $identity, 'refresh' => true]);
     } catch (Missing404Exception $e) {
         // don't care
     }
 }
开发者ID:EightArmCode,项目名称:librarian,代码行数:11,代码来源:ElasticSearchStorage.php

示例2: delete

 /**
  * @param string $identity
  * @return void
  */
 public function delete(string $identity)
 {
     try {
         $this->client->delete($this->createParams($identity, true));
     } catch (Missing404Exception $e) {
         // don't care if document can't be found
     }
 }
开发者ID:martyn82,项目名称:apha,代码行数:12,代码来源:ElasticSearchStateStorage.php

示例3: delete

 /**
  * {@inheritdoc}
  */
 public function delete($user, $imageIdentifier)
 {
     $params = ['index' => $this->getIndexName(), 'type' => 'metadata', 'id' => $imageIdentifier];
     try {
         return (bool) $this->client->delete($params);
     } catch (Exception $e) {
         trigger_error('Elasticsearch metadata deletion failed for image: ' . $imageIdentifier, E_USER_WARNING);
         return false;
     }
 }
开发者ID:sgulseth,项目名称:imbo-metadata-search,代码行数:13,代码来源:ElasticSearch.php

示例4: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     self::$kernel = static::createKernel();
     self::$kernel->boot();
     self::$elasticClient = self::$kernel->getContainer()->get('syrup.elasticsearch.client');
     self::$search = self::$kernel->getContainer()->get('syrup.elasticsearch.search');
     self::$index = self::$kernel->getContainer()->get('syrup.elasticsearch.current_component_index');
     self::$jobMapper = self::$kernel->getContainer()->get('syrup.elasticsearch.current_component_job_mapper');
     self::$sapiClient = new SapiClient(['token' => self::$kernel->getContainer()->getParameter('storage_api.test.token'), 'url' => self::$kernel->getContainer()->getParameter('storage_api.test.url'), 'userAgent' => SYRUP_APP_NAME]);
     // clear data
     $sapiData = self::$sapiClient->verifyToken();
     $projectId = $sapiData['owner']['id'];
     $jobs = self::$search->getJobs(['projectId' => $projectId, 'component' => SYRUP_APP_NAME]);
     foreach ($jobs as $job) {
         self::$elasticClient->delete(['index' => $job['_index'], 'type' => $job['_type'], 'id' => $job['id']]);
     }
 }
开发者ID:keboola,项目名称:syrup,代码行数:17,代码来源:SearchTest.php

示例5: delete

 /**
  * Deletes a given entity or a given list of entities
  * @param string|ElasticsearchEntity|ElasticsearchEntity[] $param either an id, an entity or a list of entities
  * @return void
  */
 public function delete($param)
 {
     if (is_string($param)) {
         $this->elasticsearchClient->delete(array('id' => $param, 'index' => $this->index, 'type' => $this->getType()));
     } else {
         if ($param instanceof ElasticsearchEntity) {
             $this->delete($param->getId());
         } else {
             if (is_array($param)) {
                 foreach ($param as $p) {
                     $this->delete($p);
                 }
             }
         }
     }
 }
开发者ID:aboutyou,项目名称:ayoc-persistence-elasticsearch,代码行数:21,代码来源:ElasticsearchCrudRepository.php

示例6: delete

 /**
  * @param Searchable $type
  */
 public function delete(Searchable $type)
 {
     if (uses_trait($type, MySoftDeletes::class)) {
         //only delete when fully being deleted.
         if ($type->beingFullyDeleted()) {
             $params = $this->data($type);
             $params = array_except($params, ['body']);
             $this->client->delete($params);
         }
         //maybe we should trigger an update here instead of doing nothing.
     } else {
         //Even regular soft deletes can be deleted.
         $params = $this->data($type);
         $params = array_except($params, ['body']);
         $this->client->delete($params);
     }
 }
开发者ID:jaffle-be,项目名称:framework,代码行数:20,代码来源:SearchService.php

示例7: onMarkdownDocumentDeleted

 public function onMarkdownDocumentDeleted(MarkdownDocumentDeletedEvent $event)
 {
     $params = array('id' => $event->getPath()->toAbsoluteUrlString(), 'index' => $this->index, 'type' => self::MARKDOWN_DOCUMENT_TYPE);
     return $this->client->delete($params);
 }
开发者ID:terretta,项目名称:gitki.php,代码行数:5,代码来源:ElasticsearchRepository.php

示例8:

 function it_removes_a_searchable_object_from_the_index(Client $elasticsearch, Searchable $searchableObject)
 {
     $elasticsearch->delete(['index' => $this->indexName, 'type' => $this->searchableType, 'id' => $this->searchableId])->shouldBeCalled();
     $this->removeFromIndex($searchableObject);
 }
开发者ID:nguyentamvinhlong,项目名称:searchindex,代码行数:5,代码来源:ElasticsearchSpec.php

示例9: removeRecipeFromIndex

 /**
  * @param Recipe $recipe
  */
 public function removeRecipeFromIndex(Recipe $recipe)
 {
     $params = ['index' => ElasticSearch::INDEX, 'type' => 'recipe', 'id' => $this->slugGenerator->generateFrom((string) $recipe->getName())];
     $this->client->delete($params);
     $this->client->indices()->refresh();
 }
开发者ID:karion,项目名称:mydrinks,代码行数:9,代码来源:ElasticSearchAdapter.php

示例10: deleteStatement

 /**
  * Execute a update statement on index;.
  *
  * @param $params
  *
  * @return array
  */
 public function deleteStatement(array $params)
 {
     return $this->elastic->delete($this->setStatementIndex($params));
 }
开发者ID:sleimanx2,项目名称:plastic,代码行数:11,代码来源:Connection.php

示例11: delete

 /**
  * @param DeleteParams $params
  * @return DeleteResponse
  */
 public function delete(DeleteParams $params)
 {
     return new DeleteResponse($this->nativeClient->delete($params->toArray()));
 }
开发者ID:ulff,项目名称:ElasticsearchPhpClientBundle,代码行数:8,代码来源:ElasticSearchPhpClient.php

示例12: delete

 /**
  * Delete an index.
  *
  * @param array $params
  *
  * @return array
  */
 public function delete(array $params)
 {
     return $this->client->delete($this->prepareParams($params));
 }
开发者ID:krisanalfa,项目名称:ductible,代码行数:11,代码来源:Ductible.php

示例13: documentDelete

 /**
  * Perform an insertion into the engine.
  *
  * @param  array $payload
  * @return array
  */
 public function documentDelete($payload)
 {
     return $this->client->delete($payload);
 }
开发者ID:saulolozano,项目名称:Stretchy,代码行数:10,代码来源:Connection.php

示例14: deleteDocumentFromIndex

 /**
  * @param Model $model
  */
 public function deleteDocumentFromIndex(Model $model)
 {
     $this->client->delete($model);
 }
开发者ID:kodicomponents,项目名称:searcher,代码行数:7,代码来源:ElasticSearch.php

示例15: removeFromIndex

 /**
  * @param string $type entity name
  * @param int $id entity id
  * @return array
  */
 public function removeFromIndex($type, $id)
 {
     return parent::delete(['index' => $this->index, 'type' => $type, 'id' => $id]);
 }
开发者ID:VasekPurchart,项目名称:khanovaskola-v3,代码行数:9,代码来源:ElasticSearch.php


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