Mailing List Archive

query parser and specific type of query
Hi,

I would like to know how to do the following using Lucene:
I index some file containing a string "king of spades" using stop analyzer.
The analyzer filters out "of" in the above string since it is not useful for searching
and indexes king and spades.
Its fine till this point.

Now i would like to search for the same string "king of spades".
My questions are,
1. If i want to generate a PhraseQuery from the QueryParser using StopAnalyzer, what should be done?
2. If i want to generate a FuzzyQuery from the QueryParser using StopAnalyzer, what should be done?

thanks for any help,

regards,
==Rahul==
-------------------------------------------
rahul.sawhney@philips.com
Ph: 5579000 Extn: 1029
-------------------------------------------



--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re:query parser and specific type of query [ In reply to ]
Hi Rahul,

I think you need to use the PhraseQuery. It is used by QueryParser when the
search string is given in quotes say "company shareholders"

The FuzzyQuery has a functinality similar to soundex() function in oracle,
ie searching for similar sounding words as that of the search keyword. It
will be used by the QueryParser when the search keyword is followed by ~
say place~ will result in documents containing words
like 'pace', 'place', 'plague' etc.

Hope this works for u.

Sampreet


Hi,

I would like to know how to do the following using Lucene:
I index some file containing a string "king of spades" using stop analyzer.
The analyzer filters out "of" in the above string since it is not useful
for searching
and indexes king and spades.
Its fine till this point.

Now i would like to search for the same string "king of spades".
My questions are,
1. If i want to generate a PhraseQuery from the QueryParser using
StopAnalyzer, what
should be done?
2. If i want to generate a FuzzyQuery from the QueryParser using
StopAnalyzer, what
should be done?

thanks for any help,

regards,
==Rahul==


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>