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


PHP Type::delete方法代码示例

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


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

示例1: getType

 /**
  * Get the currentType
  *
  * @param      $type
  * @param bool $createNew
  *
  * @return \Elastica\Type
  */
 public function getType($type, $createNew = false)
 {
     $this->_type = $this->_index->getType($type);
     if ($createNew == true && $this->_type->exists() == true) {
         $this->_type->delete();
     }
     return $this->_type;
 }
开发者ID:vadimjustus,项目名称:m2-elasticsearch,代码行数:16,代码来源:Elastic.php

示例2: doFlush

 /**
  * @test
  */
 public function doFlush()
 {
     $this->type->delete()->shouldBeCalled();
     self::assertTrue($this->cache->flushAll());
     $refClass = new \ReflectionClass($this->cache);
     $typeProp = $refClass->getProperty('type');
     $typeProp->setAccessible(true);
     $typeVal = $typeProp->getValue($this->cache);
     self::assertNull($typeVal);
 }
开发者ID:basster,项目名称:doctrine-elastica-cache,代码行数:13,代码来源:CacheTest.php

示例3: deleteMapping

 /**
  * @param string $typeName
  * @return \Elastica\Type
  * @throws \Exception
  */
 protected function deleteMapping($typeName)
 {
     $type = new Elastica\Type($this->index, $typeName);
     if ($type->exists()) {
         try {
             $type->delete();
         } catch (\Exception $e) {
             throw new \Exception('Could not delete type ' . $type->getName() . '');
         }
     }
     $type = new Elastica\Type($this->index, $typeName);
     return $type;
 }
开发者ID:randomresult,项目名称:WMDB.Forger,代码行数:18,代码来源:SetupCommandController.php

示例4: testDeleteType

 /**
  * Test that Delete of index type throw deprecated exception.
  *
  * @group unit
  * @expectedException \Elastica\Exception\DeprecatedException
  */
 public function testDeleteType()
 {
     $type = new Type($this->getMockBuilder('Elastica\\Index')->disableOriginalConstructor()->getMock(), 'test');
     $type->delete();
 }
开发者ID:bungkoko,项目名称:Elastica,代码行数:11,代码来源:TypeTest.php

示例5: testDeleteType

 /**
  * Test Delete of index type.  After delete will check for type mapping.
  * @expectedException \Elastica\Exception\ResponseException
  * @expectedExceptionMessage TypeMissingException[[elastica_test] type[test] missing]
  */
 public function testDeleteType()
 {
     $index = $this->_createIndex();
     $type = new Type($index, 'test');
     $type->addDocument(new Document(1, array('name' => 'ruflin nicolas')));
     $type->addDocument(new Document(2, array('name' => 'ruflin')));
     $index->refresh();
     $type->delete();
     $type->getMapping();
 }
开发者ID:kskod,项目名称:Elastica,代码行数:15,代码来源:TypeTest.php

示例6: testDeleteType

 /**
  * Test Delete of index type.  After delete will check for type mapping.
  *
  * @group functional
  */
 public function testDeleteType()
 {
     $index = $this->_createIndex();
     $type = new Type($index, 'test');
     $type->addDocuments(array(new Document(1, array('name' => 'ruflin nicolas')), new Document(2, array('name' => 'ruflin'))));
     $index->refresh();
     // sleep a moment to be sure that all nodes in cluster has new type
     sleep(5);
     $type->delete();
     $index->optimize();
     $this->assertFalse($type->exists());
 }
开发者ID:MediaWiki-stable,项目名称:1.26.0,代码行数:17,代码来源:TypeTest.php


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