[Xapian-devel] Custom weight factors - pushing the relevancy ranking how we want it

Olly Betts olly at survex.com
Fri Dec 17 18:32:56 GMT 2004


On Fri, Dec 17, 2004 at 02:56:07PM +0100, Michiel Roding wrote:
> So, in time we'll be able to define custom fields to contain an integer 
> with a definable weight?

You'd put something in a value for each document (or only some of them
if you want).  Then you'd subclass Xapian::MatchBiasFunctor (or
something like that), and provide a method which returns a weight
by reading this value.  The value could just be the weight, but you
could also do calculations or lookups.  Nothing too expensive ideally.
You also provide a method which returns the maximum weight which can
be returned.

> Some forums might think date is very important, other may think the 
> viewcount is a better representation. If they can modify the 
> index.script, that'd be really nice

Or just store 2 values and allow selection of different
MatchBiasFunctors, and tune the weights within them according the forum.

> >And if you built a second Xapian database where each topic is indexed
> >only by terms which people have voted for, then you could use topterms
> >to allow users to narrow in on particular meanings.
>
> Could you ellaborate on this?

Yes, but later - I need to go and paint a wall!

Cheers,
    Olly




More information about the Xapian-devel mailing list