View Single Post
  #2 (permalink)  
Old 05-26-2008, 04:09 PM
LIiceT LIiceT is offline
Junior Member
 
Join Date: May 2008
Posts: 1
Default Numbers are not indexed in standard text fields

I had the same problem. The reason for me was that the standard analyzer doesn't index numbers. So there were two possible solutions in my case:
  1. have a look at Field Types. Keyword is not tokenized but searchable. I use this for my id fields:
    Code:
    $doc->addField(Zend_Search_Lucene_Field::Keyword('id', $id, 'utf-8'));
  2. alternatively, set the default analyzer to a type that does also index numbers. I use this line before indexing and searching:
    Code:
    Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive());

Hope I could help you!
Reply With Quote