[Xapian-discuss] How to get term weight?

Olly Betts olly at survex.com
Tue Nov 18 20:12:10 GMT 2008


On Tue, Nov 18, 2008 at 03:02:31PM -0500, zhiguo li wrote:
> I have a simple question and I hope somebody could help me: given a Mset
> "matches" and a Query "query", how do I get the weight of the terms in the
> query? Suppose I use the BM25 weighting schme and I have the document
> statistics from the database "db".

You already asked this question only yesterday.  Please don't reask the
same question just because you don't get an instant response.  All
you'll do is irritate list subscribers and most likely decreases the
likelihood that you'll get a useful response.

> Or put it another way: I followed the code in Xapian and I know that when
> Xapian performed the search, it computed "get_sumpart" and "get_sumextra".
> How can I retrieve the query term weight for each document in the Mset?

You can't.  We don't keep the weight contributions around - only the
sum of the contributions over all matching terms for documents which
made it into the MSet.

Cheers,
    Olly



More information about the Xapian-discuss mailing list