[Xapian-discuss] How to make term weight ignored?

Olly Betts olly at survex.com
Thu Jan 17 02:34:14 GMT 2008


On Wed, Jan 16, 2008 at 05:50:12PM +0900, Sungsoo Kim wrote:
> I have learned there are two ways to apply weight to the terms from the 
> following FAQ.
> 
> http://wiki.xapian.org/FAQ#head-3c17843de2310bf942166d976b212acfce9ddc89
> 
> My xapian database was built with term weight set, which is the 2nd method 
> in the above document. Usually this is fine and I use BM25Weight scheme. But 
> sometimes I want to ignore the term weight in the database and use different 
> weight using OP_SCALE_WEIGHT.

I don't see how this could work - the only statistic we have is the
weighted total, and we have no way of knowing how much of that came from
terms in the body and how much from terms in the title (well, beyond
that the contribution from the title must be a multiple of FACTOR).

I think you'll need to index each field separately if you want to be
able to vary the relative importance.

> But I couldn't find a way to do this. If I use BoolWeight scheme, would term 
> weight in the database be ignored and OP_SCALE_WEIGHT still be effective?

No, BoolWeight means that all results have a weight of 0, so
OP_SCALE_WEIGHT then has no effect.

Cheers,
    Olly



More information about the Xapian-discuss mailing list