[Xapian-discuss] Sorting by a custom expr
Carlos Pita
carlosjosepita at gmail.com
Fri Jan 20 11:06:47 GMT 2006
Umh, I can't see how to get a value from a document while
computing weight inside a subclass of Xapian::Weight. The
interface
Xapian::weight get_sumpart (Xapian::termcount, Xapian::doclength len)
Xapian::weight get_sumextra (Xapian::doclength len)
doesn't take the document as a parameter but just the
the document length. And the brel I need is a custom value
attached to the document. Am I missing something?
Best regards,
Carlos
James Aylett wrote:
>On Fri, Jan 20, 2006 at 07:00:27AM -0300, Carlos Pita wrote:
>
>
>
>>I need to keep a fixed relevance number for each document which is
>>precalculated from "business variables" external to the query. Call
>>it brel and then call qrel the relevance coming from the query,
>>which would be calculated by xapian. brel and qrel are combined in
>>an expression like (B * brel + Q * qrel), with B and Q constants, to
>>obtain the final relevance according to which the documents
>>(products) must be sorted.
>>
>>
>
>You should be able to do this with a custom weighting class. This
>isn't supported in most of the bindings yet, but it'll work from C++.
>
>Cheers,
>James
>
>
>
_______________________________________________
Xapian-discuss mailing list
Xapian-discuss at lists.xapian.org
http://lists.xapian.org/mailman/listinfo/xapian-discuss
More information about the Xapian-discuss
mailing list