You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by none none <ko...@lycos.com> on 2002/06/12 20:32:56 UTC

Help Please. (urgent)

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?

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 '~' ?

Thank you very much.
bye



_______________________________________________________
WIN a first class trip to Hawaii.  Live like the King of Rock and Roll
on the big Island. Enter Now!
http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Modifications to the QueryParser

Posted by Peter Carlson <ca...@bookandhammer.com>.
This was originally posted to the developer list, but should have been
posted here.



On 6/12/02 11:32 AM, "none none" <ko...@lycos.com> 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

--Peter


> 
> Thank you very much.
> bye