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


PHP Zend_Search_Lucene_Search_QueryParser::getDefaultEncoding方法代码示例

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


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

示例1: sfLuceneLowerCaseFilter

    $t->fail('::getConfig() returns the $config variable in the search.yml file');
}
$cswap->restore();
$t->diag('testing ->getCategoriesHarness()');
$cats = $lucene->getCategoriesHarness();
$t->isa_ok($cats, 'sfLuceneCategories', '->getCategories() returns an instance of sfLuceneCategories');
$t->ok($lucene->getCategoriesHarness() === $cats, '->getCategories() is a singleton');
$t->diag('testing ->getIndexerFactory()');
$indexer = $lucene->getIndexerFactory();
$t->isa_ok($indexer, 'sfLuceneIndexerFactory', '->getIndexer() returns an instance of sfLuceneIndexerFactory');
$t->diag('testing ->getContext()');
$t->isa_ok($lucene->getContext(), 'sfContext', '->getContext() returns an instance of sfContext');
$t->is($lucene->getContext(), sfContext::getInstance(), '->getContext() returns the same context');
$t->diag('testing ->configure()');
$lucene->configure();
$t->is(Zend_Search_Lucene_Search_QueryParser::getDefaultEncoding(), 'UTF-8', '->configure() configures the query parsers encoding');
foreach (array('Text', 'TextNum', 'Utf8', 'Utf8Num') as $type) {
    $lucene->setParameter('analyzer', $type);
    $lucene->configure();
    $class = 'Zend_Search_Lucene_Analysis_Analyzer_Common_' . $type;
    $expected = new $class();
    $expected->addFilter(new sfLuceneLowerCaseFilter(true));
    $expected->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_StopWords(array('and', 'the')));
    $expected->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_ShortWords(2));
    $actual = Zend_Search_Lucene_Analysis_Analyzer::getDefault();
    $t->ok($actual == $expected, '->configure() configures the analyzer for ' . $type);
}
$lucene->setParameter('analyzer', 'foobar');
try {
    $lucene->configure();
    $t->fail('->configure() analyzer must be of text, textnum, utf8, or utf8num');
开发者ID:palcoprincipal,项目名称:sfLucenePlugin,代码行数:31,代码来源:sfLuceneTest.php


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