lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nina Khosravi <>
Subject Handling OR, NOT, AND operators in search query
Date Mon, 14 Aug 2006 09:27:07 GMT

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?

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. 


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