On Dec 27, 2004, at 6:28 AM, Alex Kiselevski wrote:


Thanks Erik, I use StandardAnalyze to index RPG/4. I use StandardAnalyzer and IndexSearcher with TermQuery without QueryParser. So, I thought that as a result of query Text:RPG I still have to get some hit, but it didn't happen.

   StandardAnalyzer:
     [rpg/4]

As you can see, StandardAnalyzer tokenized RPG/4 as "rpg/4". A TermQuery must be *exactly* that to match. You could, alternatively, bypass QueryParser and use the analyzer directly making a TermQuery (or PhraseQuery) out of the results. I do this in quite a few queries in the system I'm building for my primary work to allow queries against some library archives.


This is one of the most critical, but seemingly misunderstood, aspect to using Lucene effectively - how to manage the analysis process and match it to the searching side.

        Erik


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to