[Xapian-discuss] Result Priorities

Olly Betts olly at survex.com
Wed Aug 25 01:42:46 BST 2004


On Tue, Aug 24, 2004 at 05:14:27PM -0400, Mike Boone wrote:
> * If there are only two priorities, complete two searches, one for each
> level, and combine the results.

Even if you had ten levels this would be workable.  Especially if you
have the classic paged style of results as once you've filled the
current page you can stop, so often you'd not need to run all the
searches.

You can also keep each priority level in a separate database, which is
often useful for this sort of thing - if the priority levels are "stubs"
of some kind, or paid listings, or local vs remote content, you likely
want to manage it separately.

This approach also keeps the document weights meaningful.

> * Give the priority term a weighting (perhaps with 'within query
> frequency'?) that will cause the higher priority results to always be on
> top.

You could have a term with wdf of the priority level I guess, but it
would be hard to pick a weight for that term such that the priority
level didn't overlap, and you'd change the document weights which would
be annoying if you wanted to use them for showing some sort of rating.

> * Another method (some way to sort on a stored value, maybe)?

Currently documents which compare equal when sorting are ordered by
document id (you can choose increasing or decreasing).  It wouldn't
be too hard to allow relevance order to be used when the sort compares
equal.

Cheers,
    Olly



More information about the Xapian-discuss mailing list