lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Carlson <>
Subject Modifications to the QueryParser
Date Wed, 12 Jun 2002 20:33:40 GMT
This was originally posted to the developer list, but should have been
posted here.

On 6/12/02 11:32 AM, "none none" <> wrote:

> hi,
> i asked already help on the QueryParser.jj about:
> 1.Case insensitive operator, someone said "do that in your code and pass the
> right sintax to the QueryParser",  Any other method to let the QueryParser.jj
> do so?

I think that you would have to create your own CaseInsensitiveQuery class
which would walk through the possible terms and match them in a case
insensitive way.

You'll also have to not use the Standard Analyzer since it makes everything
lowercase by default.

Then you'll have to create a new operator in the QueryParser.jj and have it
create a CaseInsensitiveQuery as appropriate.

I don't think that this would be too hard, since there are examples of doing
all these things in Lucene already.

If you do it, please contribute it back if you can.

> 2.I know is a topic but i can't find it, what should i change to set the
> default operator to 'AND' instead of 'OR' ?

> 3.What should i change to make the 'w/' the operator for proximity search
> instead of '~' ?

I am attaching my slightly modified older QueryParser that uses the NEAR
operator. This is limited in that since it uses the slop mechanism, and this
mechanism is based on phrases, it only works for single word term (not a
query NEAR another complex query).
You can use it as an example.

I hope this helps


> Thank you very much.
> bye

View raw message