lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: A very technical question.
Date Wed, 28 Sep 2005 17:22:34 GMT
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?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message