zvikico
zvikico

Reputation: 9825

Lucene boost: I need to make it work better

I'm using Lucene to index components with names and types. Some components are more important, thus, get a bigger boost. However, I cannot get my boost to work properly. I sill get some components appear later (get worse score), even though they have a higher boost.

Note that the indexing is done on one field only and I've set the boost to that field alone. I'm using Lucene in Java.

I don't think it has anything to do with the field length. I've seen components with the same name (but different type) get the wrong score.

Upvotes: 2

Views: 5853

Answers (5)

Shashikant
Shashikant

Reputation:

Use Searcher.explain to find out how the scores for each document are derived. One of the key criteria in score is length of the field. A match in shorter field gets higher score.

Upvotes: 2

Yuval F
Yuval F

Reputation: 20621

I suggest you use luke to see exactly what is stored in your index. Are you using document boosting? See the scoring documentation to check possible explanations.

Upvotes: 1

KenE
KenE

Reputation: 1805

Make sure field.omitNorms is set to false on the field you want to boost.

Upvotes: 0

Jay Kominek
Jay Kominek

Reputation: 8783

As I recall, boosting is intended to make one field more important than another. If you have only one field, boosting won't change the order of the results at all.

added: no, looks like you can indeed boost specific documents. oops!

Upvotes: 0

Avi
Avi

Reputation: 20142

Boost is just one factor in the Lucene score for a hit. But it should work. Can you give a more complete example of the behavior you are seeing, and what you would expect?

Upvotes: 0

Related Questions