lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven A Rowe <sar...@syr.edu>
Subject RE: How to make each term of query appear in at least one field of multiple field query
Date Mon, 19 Oct 2009 16:46:27 GMT
Hi Rich,

On 10/17/2009 at 4:24 PM, Rich Livingstone wrote:
> I am a bit stumped by how to ensure that, where there are multiple
> terms in my query, that each term must appear at least once across
> all specified fields of my document.

You can create a MUST clause for each term, with a boosted SHOULD term query for each field,
e.g.:

+(field1:term1^field1boost field2:term1^field2boost ...)
+(field1:term2^field1boost field2:term2^field2boost ...)
...

Steve


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


Mime
View raw message