[Xapian-discuss] word pair indexing and querying

Olly Betts olly at survex.com
Thu Sep 21 19:10:18 BST 2006


On Thu, Sep 21, 2006 at 06:28:18PM +0100, James Aylett wrote:
> We could have a new constructor to Xapian::Query():
> 
> ----------------------------------------------------------------------
> using Xapian;
> // with q1, q2
> Query q = new Query(Query::OP_WEIGHTED_OR, q1, q2, 2.0);
> // q1 terms are twice as important as q2
> ----------------------------------------------------------------------
> 
> or something similar. Or, I suppose, an optional parameter to the end
> of every query constructor that weights the first leg over the second
> (or a float iterator for the iterator constructor?).

Perhaps the simplest, cleanest, and most orthogonal API is to just have
an unary operator which scales the weight of the Query it's applied to?
There's no particular reason why this should be restricted to OR after
all.  Internally we can combine that into the operator above if that
actually helps for implementation.

I'm not sure such a facility is actually going to help here, but in
general it might be handy to have sometimes.

Cheers,
    Olly



More information about the Xapian-discuss mailing list