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


PHP Type::getIndex方法代码示例

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


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

示例1: setType

 /**
  * @param string|\Elastica\Type $type
  *
  * @return $this
  */
 public function setType($type)
 {
     if ($type instanceof Type) {
         $this->setIndex($type->getIndex()->getName());
         $type = $type->getName();
     }
     $this->_type = (string) $type;
     return $this;
 }
开发者ID:levijackson,项目名称:Elastica,代码行数:14,代码来源:Bulk.php

示例2: _addDocs

 /**
  * @param Type $type
  * @param int  $docs
  *
  * @return array
  */
 private function _addDocs(Type $type, $docs)
 {
     $insert = array();
     for ($i = 1; $i <= $docs; $i++) {
         $insert[] = new Document($i, array('_id' => $i, 'key' => 'value'));
     }
     $type->addDocuments($insert);
     $type->getIndex()->refresh();
     return $insert;
 }
开发者ID:MediaWiki-stable,项目名称:1.26.0,代码行数:16,代码来源:CrossIndexTest.php

示例3: deleteWarmers

 private function deleteWarmers($warmers)
 {
     foreach (array_keys($warmers) as $name) {
         $this->outputIndented("\tDeleting {$name}...");
         $name = urlencode($name);
         $path = "_warmer/{$name}";
         $this->pageType->getIndex()->request($path, 'DELETE');
         $this->output("done\n");
     }
     return Status::newGood();
 }
开发者ID:zoglun,项目名称:mediawiki-extensions-CirrusSearch,代码行数:11,代码来源:CacheWarmersValidator.php

示例4: setUp

 protected function setUp()
 {
     $typeName = Cache::TYPE_NAME;
     $this->type = $this->prophesize('\\Elastica\\Type');
     $this->type->request(Argument::any(), Argument::cetera())->willReturn(true);
     $this->type->getName()->willReturn($typeName);
     $this->index = $this->prophesize('\\Elastica\\Index');
     $this->index->getType($typeName)->willReturn($this->type->reveal());
     $this->index->exists()->willReturn(true);
     $nsDoc = new Document('DoctrineNamespaceCacheKey[]', [Cache::VALUE_FIELD => serialize($this->namespaceId)]);
     $this->type->getIndex()->willReturn($this->index->reveal());
     $this->type->getDocument("DoctrineNamespaceCacheKey[]")->willReturn($nsDoc);
     $this->client = $this->prophesize('\\Elastica\\Client');
     $this->client->getIndex($this->indexName)->willReturn($this->index->reveal());
     $this->cache = new Cache($this->client->reveal(), ['index' => $this->indexName]);
 }
开发者ID:basster,项目名称:doctrine-elastica-cache,代码行数:16,代码来源:CacheTest.php

示例5: setType

 /**
  * @param string|\Elastica\Type $type
  * @return \Elastica\Bulk\Action
  */
 public function setType($type)
 {
     if ($type instanceof Type) {
         $this->setIndex($type->getIndex()->getName());
         $type = $type->getName();
     }
     $this->_metadata['_type'] = $type;
     return $this;
 }
开发者ID:viz,项目名称:wordpress-fantastic-elasticsearch,代码行数:13,代码来源:Action.php

示例6: refresh

 /**
  *
  */
 public function refresh()
 {
     $this->type->getIndex()->refresh(true);
 }
开发者ID:revinate,项目名称:search-bundle,代码行数:7,代码来源:DocumentHelper.php

示例7: indexingDatum

 /**
  * Construit les données afin que celles-ci soient indexées (avec les fields corrects)
  * Méthode non testée et non utilisée pour le moment (Préférable de la tester avant..)
  *
  * @param CMbObject     $datum the datum you want to construct
  * @param Elastica\Type $type  the type where you want to index the data
  *
  * @return array
  */
 function indexingDatum($datum, $type)
 {
     $datum_to_index = $this->constructDatum($datum);
     $document = $type->createDocument($datum['object_id'], $datum_to_index);
     switch ($datum['type']) {
         case 'create':
             $type->addDocument($document);
             break;
         case 'store':
             $type->updateDocument($document);
             break;
         case 'delete':
             $type->deleteDocument($document);
             break;
         case 'merge':
             //nothing to do
             /*supprimer un des deux et faire un update de l'autre.*/
             break;
         default:
             return false;
     }
     $type->getIndex()->refresh();
     $this->deleteDatumTemporaryTable($datum['search_indexing_id']);
     return true;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:34,代码来源:CSearch.class.php


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