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


PHP Zend_Search_Lucene_Search_Query_Wildcard::getMinPrefixLength方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     require_once 'Zend/Search/Lucene/Search/Query/Wildcard.php';
     $this->_wildcardMinPrefix = Zend_Search_Lucene_Search_Query_Wildcard::getMinPrefixLength();
     Zend_Search_Lucene_Search_Query_Wildcard::setMinPrefixLength(0);
     require_once 'Zend/Search/Lucene/Search/Query/Fuzzy.php';
     $this->_defaultPrefixLength = Zend_Search_Lucene_Search_Query_Fuzzy::getDefaultPrefixLength();
     Zend_Search_Lucene_Search_Query_Fuzzy::setDefaultPrefixLength(0);
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:9,代码来源:SearchHighlightTest.php

示例2: testWildcardQuery

 public function testWildcardQuery()
 {
     $index = Zend_Search_Lucene::open(dirname(__FILE__) . '/_index23Sample/_files');
     $wildcardMinPrefix = Zend_Search_Lucene_Search_Query_Wildcard::getMinPrefixLength();
     Zend_Search_Lucene_Search_Query_Wildcard::setMinPrefixLength(0);
     $hits = $index->find('*cont*');
     $this->assertEquals(count($hits), 9);
     $expectedResultset = array(array(8, 0.328087, 'IndexSource/contributing.html'), array(2, 0.318592, 'IndexSource/contributing.patches.html'), array(7, 0.260137, 'IndexSource/contributing.bugs.html'), array(0, 0.203372, 'IndexSource/contributing.documentation.html'), array(1, 0.202366, 'IndexSource/contributing.wishlist.html'), array(4, 0.052931, 'IndexSource/copyright.html'), array(3, 0.01707, 'IndexSource/about-pear.html'), array(5, 0.01015, 'IndexSource/authors.html'), array(9, 0.003504, 'IndexSource/core.html'));
     foreach ($hits as $resId => $hit) {
         $this->assertEquals($hit->id, $expectedResultset[$resId][0]);
         $this->assertTrue(abs($hit->score - $expectedResultset[$resId][1]) < 1.0E-6);
         $this->assertEquals($hit->path, $expectedResultset[$resId][2]);
     }
     Zend_Search_Lucene_Search_Query_Wildcard::setMinPrefixLength($wildcardMinPrefix);
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:15,代码来源:Search23Test.php


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