开发者

Facing issue when search using Zend_Lucene

I am using zend_lucene for search functionality.I 've the following code,

 $doc->addField(Zend_Search_Lucene_Field::Text('categoryName', $result->name));  

Here name in "$result->name" is varchar type in Database. Also have some following values like dinesh,kumar123,3333. For testing purpose i have stored number in name field. when i search dinesh , Search comes with exact result but when i use number search, That is 3333 Search has no result. What i do开发者_如何学JAVAne wrong on the code Zend_Search_Lucene_Field::Text.

Is there any way for search number/char/alphanumeric (kumar123) ?

Thanks in Advance


Finally i found by declaring "Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive());" and use Zend_Search_Lucene_Field::Keyword instead of Zend_Search_Lucene_Field::Text

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜