[Xapian-discuss] Result Priorities

James Aylett james-xapian at tartarus.org
Mon Sep 6 12:49:55 BST 2004


On Mon, Sep 06, 2004 at 12:25:06PM +0100, Olly Betts wrote:

> > It strikes me that having relevance as the implicit second sort key
> > here would almost always be more useful than document id.
> 
> I agree it's useful to be able to choose, but I'm not sure I agree that
> relevance is almost always more useful.

I think an option is best. (But I also think that the vast majority of
use of sort values will be to get date sorting, in which case
relevance is a good second step. This isn't necessarily what the
majority of people /should/ be using, I just think in practice that's
what will happen :-)

> > At the very least it should probably be an option - does anyone
> > disagree with me, or can it go on the list?
> 
> It's on my list, but I certainly don't mind if someone else implements
> it before I get round to it!

It doesn't seem to be in Bugzilla ... although I can't be sure because
of its horrible interface. (Should I still be paying attention to
Bugzilla?)

> The change in the matcher is pretty trivial I believe - writing a good
> test case to check it works and to make sure it keeps working will take
> most of the time I suspect...

As a start, we want something based on a simple corpus:

did terms
1   (man woman)
2   (woman)
3   (man woman fish)
4   (fish)

Search on 'woman' and you'll get something like (2:99%, 1:86%,
3:75%). So now make three documents for every one, with value 1 being
chosen appropriately:

did value(1) terms
1   1        man woman
2   1        woman
3   1        man woman fish
4   2        man woman fish
5   2        man woman
6   2        woman
7   3        woman
8   3        man woman fish
9   3        man woman

'woman'[sort=1,did]: 1,2,3,4,5,6,7,8,9
'woman'[sort=1,rel]: 2,1,3,6,5,4,7,9,8

No idea what unsorted will return there, but that should be covered by
other tests. We may need boundary cases as well, but I don't know how
it works internally.

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org



More information about the Xapian-discuss mailing list