Dawid Weiss wrote:
I have a very technical question. I need to alter document score (or in
fact: document boosts) for an existing index, but for each query. In
other words, I'd like these to have pseudo-queries of the form:
1. civil war PREFER:shorter
2. civil war PREFER:longer
for these two queries, 1. would score shorter documents higher then
option 2, which would in turn score longer documents higher. Note that
these preferences can be expressed at query time, so static document
boosts are of little help.
You could subclass FilterIndexReader and override the norms() method to
cook the values in the returned array, caching the cooked copy. Then
use different IndexReaders for different queries, each cooking the norms
differently. Cooking could be fast: compute a 256 byte table and use it
to map each byte to its cooked value. Does this make sense?
Doug
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]