lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Outar" <rou...@ideorlando.org>
Subject Multiple field searches using AND and OR's
Date Wed, 13 Nov 2002 13:58:36 GMT
Hello all,

	I am wondering how I would do multiple field searches of the form:

	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.

Thanks,

Rob

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-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message