lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xin Herbert Wu" <xi...@pathf.com>
Subject How to combine multiple fielded queries in Lucene
Date Thu, 27 Oct 2005 15:24:34 GMT
I am developing a search application via Lucene and ran into a problem can
be described as:

  Assume we have document schema with these fields:

  Title, Author, Summary, Publication_date(Date), Content

  The user query is like this:

  Find all documents where either Title field has word "baseball" or Summary
field has word "white sox" and the Pubblication_date is between Jan. 1995
and Dec. 2004. 

  In other words, I want the query somewhat like this:

  (Title = "baseball" OR Summary = "white sox") AND Publication_date =
"199501 TO 200412"

 

  Based on Lucene API, it seems that a basic query is applied on a single
document field only, but how can I hook up multiple field queries together
with Boolean logic AND or OR as demoed in above example?

 

Your help is greatly appreciated!

 

-Xin

 

 


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