Zend_Search_Lucene:UTF-8疯狂

时间:2011-10-09 09:54:48

标签: zend-framework zend-search-lucene zend-lucene

1 个答案:

答案 0 :(得分:0)

查询和存储数据是两回事。如果您的查询是以utf-8编码的,那么您的数据(文档)也应该是utf-8编码的,以便与查询匹配。

最后

$doc->addField(Zend_Search_Lucene_Field::keyword('division', utf8_decode($contact->division)), 'utf-8');

shd be

$doc->addField(Zend_Search_Lucene_Field::keyword('division',$contact->division, 'utf-8'));