lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kelvin Tan <>
Subject Re: Multiple field searches using AND and OR's
Date Wed, 13 Nov 2002 14:41:44 GMT

I believe MultiFieldQueryParser will do the job for you...


On Wed, 13 Nov 2002 08:58:36 -0500, Rob Outar said:
>Hello all,
>    I am wondering how I would do multiple field searches of the 
>    field1 = value and field2 = value2 or field2 = value3
>I am thinking that each one of the above would be a term query but
>how would I string them together with AND's and OR's?
>Any help would be appreciated.
>PS I found this in the FAQ, but I was wondering if there was any
>other way to do it:
>My documents have multiple fields, do I have to replicate a query
>for each of them ?
>Not necessarily. A simple solution is to index the documents using a
>general field that contains a concatenation of the content of all
>the searchable fields ('author', 'title', 'body' etc). This way, a
>simple query will search in entire document content.
>The disadvantage of this method is that you cannot boost certain
>fields relative to others. Note also the matches in longer documents
>results in lower ranking.
>To unsubscribe, e-mail:   <mailto:lucene-user-
>> For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message