[Xapian-discuss] Document weighting in 1.1

Olly Betts olly at survex.com
Fri Sep 11 13:39:51 BST 2009


On Fri, Sep 11, 2009 at 11:55:11AM +0200, double wrote:
> Just a quick note.
> It works only with slot number 0, but it doesn't work
> so far with any other slot. I only added these lines
> to my code:
> 
> xapian_document.add_value( 0, Xapian::sortable_serialise(weight) );
> 
> And right before Xapian::Enquire():
> 
> Xapian::ValueWeightPostingSource xapian_valueweight( 0 );
> xapian_query = Xapian::Query( Xapian::Query::OP_AND_MAYBE,
>                  xapian_query, Xapian::Query(&xapian_valueweight) );

This should work for any slot (provided you both set and use the same
slot number!)  If not, can you provide a self-contained example which
shows it failing?

Cheers,
    Olly



More information about the Xapian-discuss mailing list