lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rich Livingstone <>
Subject How to make each term of query appear in at least one field of multiple field query
Date Sat, 17 Oct 2009 20:24:21 GMT

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. I am using MultiFieldQueryParser and
BooleanClause.Occur.SHOULD in the query; I tried putting all fields into a
single giant field and prefixing each term with + but that loses the ability
to boost individual fields in the search (unless there is a way to add a
boost per term indexed at index time?) so it doesn't seem a good solution as
I need the boosting too.

Anyone any idea how to do this ? BooleanClause.Occur.MUST would force all
terms to be in all fields, I would have thought - and the ability to do
weighting is important to me.

I'm using Lucene 2.2.0.

Thanks for any help !
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

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

View raw message