[Xapian-discuss] MSet order

Olly Betts olly at survex.com
Thu Mar 10 13:24:24 GMT 2011


On Tue, Mar 08, 2011 at 03:29:37PM +0100, Pierre-Alain Moellic wrote:
> For the euclidean distance, I used the BM25Weight Class as an example and
> simply use the relation between L2 and "cosine" measure.
> (Q = query, D = document), ||Q-D||² = ||Q||² + ||D||² - 2 Q.D
> 
> A non-linear transformation of the weights is probably a problem since we
> mainly define a weighting scheme with the get_sumpart() method.
> With Xapian, I understood that the final weight of a document W is W = w1 +
> w2 + ... wN, each wi is provided by get_sumpart().

Oh yes, I overlooked this, sorry.  That'll teach me to reply to email
just before going to bed!

So you'll need to subtract them from the maxpart value I think.

> So the transformation w --> 1 / ( 1 + w ) should be applied to the final
> weight W but not to the wi. Is it possible to change the final weight in a
> MSet ?

Not inside Xapian.  You could adjust the returned weight outside of
Xapian to give the original distance measure by subtracting the weight
from the sum of the max_part values.

Cheers,
    Olly



More information about the Xapian-discuss mailing list