lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nina Khosravi <khosr...@us.ibm.com>
Subject Re: Handling OR, NOT, AND operators in search query
Date Mon, 14 Aug 2006 13:19:15 GMT
Thanks!  I did not notice that the code was lower-casing the query string!

Regards,
Nina 








> I am refactoring our search code that was written prior to 1.4.3.  I am 
> using Lucene 2.0 now.  The search string entered by users was actually 
> parsed by our custom code to generate the query.  This code was getting 
> fairly big and messy and I'm changing the code to use Lucene's query 
> parsers to build the query.  I am actually using the 
> MultiFieldQueryParser.  The problem I am having is the OR, NOT, and AND 
> operators are not being interpreted as operators but just as terms.  I 
am 
> using the WhitespaceAnalyzer and defaulting the operator to 
> QueryParser.AND_OPERATOR.  Any ideas how to get these strings to be 
> interpreted as operators?

These operators should work correctly.

One restriction is that they must be all caps, ie "x OR y" will work but 
"x or y" will treat or as a literal term.  Is this what you're hitting?

> Thanks in advance for any help you can give me on this.  I want to also 
> say that not only is Lucene a great powerful search engine but the user 
> mailing list must be one of the best!!   It so nice to see how quickly 
we 
> get responses on our questions.   I've also learned a lot from what 
others 
> write about. 

You're welcome!

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message