[Xapian-devel] How to add an custom weight to the relevancy value and sort it.

Parth Gupta pargup8 at gmail.com
Sat Mar 2 05:55:21 GMT 2013


Hi Vishnu,

You need to use quest.cc like program and perform your operations on the
mset.

See lines 165-172 of
http://trac.xapian.org/browser/branches/gsoc2011-parth/xapian-core/examples/quest.cc

And you can add your weights to the i.get_weight()->store in a map with
docid and sort it. To sort it you can use something like lines 235-244 of
http://trac.xapian.org/browser/branches/gsoc2011-parth/xapian-letor/examples/questletor.ccwhich
basically calculates new weights for the documents, add it in a
sorted map and reprint it.

Parth.


On Sat, Mar 2, 2013 at 1:11 PM, Vishnu Kumar <vishnu at searchlabs.org> wrote:

> Hello guys,
>
> I have an weight value which is calculated by some factor and i need to
> add the weight with the relevancy value of a result and sort it with that
> value is that possible in xapian.
>
> Thanks,
> VishnuKumar
>
> _______________________________________________
> Xapian-devel mailing list
> Xapian-devel at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20130302/7bc7a649/attachment.htm>


More information about the Xapian-devel mailing list