As suggested, I just tested the field boost, and it is indeed effective, so the Lucene FAQ seems wrong.
For testing I used an existing testproject with 1.3M+ publications (sry, don't have time to create a reusable unit test).
Each publication instance has a
title and
description field. The description is an ordinary non-boosted field, title has a field boost of 1000f:
Code:
@Fields({@Field(name = "title", boost = @Boost(1000.0f), analyzer = @Analyzer(definition = "withoutStopWordFilter")), @Field(index = Index.UN_TOKENIZED, name = "suggest")})
protected String _title = "";
@Fields({@Field(analyzer = @Analyzer(definition = "default"), name = "description")})
protected String _description = "";
I created 2 docs with unique terms in it:
DocA[
title="barbar",
description="foofoo and foofoo, but also barbar"]
DocB[
title="foofoo and foofoo, but also barbar",
description="barbar"]
Searching for publications for query:
'
title:foofoo description:foofoo'
results in this ranked list:
- DocB[title="foofoo and foofoo, but also barbar", description="barbar"]
Code:
2511.4648 = (MATCH) sum of:
2511.4648 = (MATCH) weight(title:foofoo in 0), product of:
0.32124138 = queryWeight(title:foofoo), product of:
14.396252 = idf(docFreq=1, maxDocs=1315068)
0.022314237 = queryNorm
7817.999 = (MATCH) fieldWeight(title:foofoo in 0), product of:
1.4142135 = tf(termFreq(title:foofoo)=2)
14.396252 = idf(docFreq=1, maxDocs=1315068)
384.0 = fieldNorm(field=title, doc=0)
- DocA[title="barbar", description="foofoo and foofoo, but also barbar"]
Code:
3.2701366 = (MATCH) sum of:
3.2701366 = (MATCH) weight(description:foofoo in 1), product of:
0.32124138 = queryWeight(description:foofoo), product of:
14.396252 = idf(docFreq=1, maxDocs=1315068)
0.022314237 = queryNorm
10.179687 = (MATCH) fieldWeight(description:foofoo in 1), product of:
1.4142135 = tf(termFreq(description:foofoo)=2)
14.396252 = idf(docFreq=1, maxDocs=1315068)
0.5 = fieldNorm(field=description, doc=1)
I first tested with a field boost of 10f, which wasn't enough to push DocB to the top. With the higher boost of 1000f it's clear that boosting a field for all docs ísn't useless. I'll pook Lucene to update their FAQ.