FAQ
If you wish to boost the title field for every query then it would be
easiest to boost the title clause of your query, with Query.setBoost().
Field.setBoost() should only be used when you want to give a field
different boosts in different documents, but since you want to boost all
titles by the same amount, you'll find it easier to boost at query time.
That way you can experiment with the boost amount without re-building
the index. The values of Field.setBoost() are built into the index and
are harder to change. Thus I recommend using Query.setBoost() instead.
Construct a query for each field to be searched (by hand, or with the
QueryParser), boost each of these field queries separately, then build a
BooleanQuery that combines these into a single Query that you then
execute. I hope that makes sense.

Doug

Maurice Coyle wrote:
hi,
i was wondering what's the best approach to take when boosting the value of
a particular field.

i'm searching over a document's title, url and contents fields and i want to
try giving certain fields a boost at times to see if it improves my results.
so for instance if i want to give the title field more weight i can use
Field.setBoost() to do this.

my question is, say for example i want to give the title field twice as much
weight as the url and contents fields. do i set the boost value of title to
be 2.0 or should i set the boost value of the url and contents fields to be
0.25 and the boost value of the title field to be 0.5 (thereby having all
boost values adding up to 1 so all the socres are normalised with respect to
the title field's boost).

i just find the messages in the archives a little confusing regarding this,
i can't see which approach is best, or if either is best.

any help appreciated.
maurice


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

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

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 14 of 15 | next ›
Discussion Overview
groupjava-user @
categorieslucene
postedDec 15, '03 at 5:18p
activeDec 16, '03 at 6:15p
posts15
users7
websitelucene.apache.org

People

Translate

site design / logo © 2021 Grokbase