[Xapian-discuss] Relevance wdf

James Aylett james-xapian at tartarus.org
Fri Mar 18 13:50:46 GMT 2005

On Fri, Mar 18, 2005 at 02:26:27PM +0100, roki roki wrote:

> I am trying to use Xapian in combination with Perl but I have some
> difficulties with sorting results.  I am adding postings with wdf
> number which depends on position and format of term eg
> $doc->add_posting("marketing", 1, 50); When i search for "marketing"
> i expect that document with biggest wdf come as first but it does
> not work this way.

No, it doesn't. The ranking is based on the BM25 term weighting
function, which takes into account the document length as well as the
term wdf. 
> Is it possible that get desired result with Xapian?

If you add a dummy term you never search over with a wdf such that all
document lengths are the same, that might do it. However it will stop
the normal relevance mechanism from working, and will probably cause
you other problems further down the line.

What are you actually trying to achieve? There may be other approaches
worth considering.


  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org

More information about the Xapian-discuss mailing list