I have 2 lucene queries:
1)
Term term = new Term(Properties.LUCENE_APPARTMENT_ADDRESS,address);
Query termQuery = new TermQuery(term);
TopDocs topDo
When you use QueryParser
, it uses analyzer which does the same sequence of actions as when during the indexing (tokenization, lowercasing, stopwords, etc.).
When you use raw TermQuery
, you need to do all these steps yourself.
I guess your analyzer does something special about Properties.LUCENE_APPARTMENT_ADDRESS
and you are not when passing the address to TermQuery
hence the search results discrepancy.