lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Correct query
Date Mon, 27 Dec 2004 17:31:29 GMT

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: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message