[Xapian-discuss] Strange Weighting issue

Richard Boulton richard at tartarus.org
Tue Sep 8 15:49:00 BST 2009


2009/9/8 John Wards <jwards at whiteoctober.co.uk>

> $doc->add_term("XWEIGHT".$this->getWeighting());
>

I was more meaning:
$doc->add_term("XWEIGHT", $this->getWeighting());
ie, adding the single term with the weight multipliers you were using
earlier, and then combining that single term with the query.

I need all types to return, but with those with a higher rank to be
> given a boost. The idea is to boost product pages over news pages for
> example, as even if the news page is textually more relevant the type
> of content is actually what the user is really searching for.
>

If you want to _always_ return one type of document before another type,
you'd be best using Enquire::set_sort_by_value_then_relevance() to sort
strictly by the type of document first, and then using relevance order
within documents of the same type.  Using weight is only appropriate if you
want the combination of ranking order to be somewhat fuzzy.

-- 
Richard


More information about the Xapian-discuss mailing list