lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clemens Wyss DEV <>
Subject Looking up multiple words in multiple fields, each word matching in at least one field
Date Thu, 22 Oct 2015 12:16:16 GMT
Say our index has (documents with) three fields "f1", "f2" and "f3" and I want to find all
documents matching "foo" and "bar" in any combination of the three fields.
1)The more words that match, the higher its ranking. So it is not really a strict AND-query...
2)The more words that match in a single field, it should be ranked higher.
3)Also, as fields have boost factors, these boosts should ideally be reflected in the ranking

What is the most appropriate/elegant lucene-query for this?

Possibly a "copyfield" or "catch all field"? I.e. copying/indexing f1, f2 and f3 into an additional
field, say "fc", and then looking up in fc only -> "fc:foo AND fc:bar" ? At least (3) is
not fullfilled.

Thx in advance for advices
PS: I ask because my documents don't have 3, but >20 fields ;), and instead of "foo bar"
a user might want to lookup "foo blah whoo bar" ...

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

View raw message