views:

29

answers:

1

I'm having problem with Zend_Search_Lucene. I have few documents with field "tags" in index. Documents "tags" have following values:

  • tag1 tag2 tag3
  • tag1 tag4

I would like to find document only with tag1 AND tag4 so I use query "+tags:tag1 +tags:tag2". I can't figure out why I get 0 hits from index.

A: 

I resolved this problem. Default Zend_Search_Lucene analyzer skips digits. There is a special analyzer for this and it should be set as default before indexing and searching.

Zend_Search_Lucene_Analysis_Analyzer::setDefault(
    new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive()
);
MW