Reputation: 8763
I have content with various numeric values, and a higher value indicates (theoretically) more valuable content, which I want to rank higher.
For instance:
These can be indexed by Lucene as a numeric value, but how can I tell Lucene to use this value in its ranking algorithm?
Upvotes: 0
Views: 570
Reputation: 41378
Depending how exactly you want to proceed, you can set boost while indexing as suggested by @L.B, or if you want to make it dynamic, i.e. at search time rather than indexing time, you can use ValueSourceQuery
and CustomScoreQuery
.
You can see example in the question I asked some time ago: Lucene custom scoring for numeric fields (the example was tested with Lucene 3.0).
Upvotes: 1