[Xapian-discuss] Would like to have a sort by a combination of date and relevance.

Olly Betts olly at survex.com
Thu Jul 5 03:17:57 BST 2007

On Mon, Jul 02, 2007 at 06:53:03AM -0400, Jim wrote:
> I've searched and saw a reference to a SORTBAND in the archives but 
> don't see anything in the docs for OMEGA referencing it.  It seems like 
> I saw a comment that it was being taken out.

Yes, it was removed some time ago.  It was a poorly thought out feature
inherited from Xapian's proprietary precursor (Muscat).

> Anyway, I have a client that would like to bias the sort by relevance by 
> the date somehow.  I don't see any way to do that in omega.  I don't 
> even know what's reasonable.  I could see taking the MSD from the 
> relevance and averaging that with the inverse of age of the document 
> with some kind of floor placed on the age so recent docs with lesser 
> relevance would be moved closer to the top.   The floor would be 
> necessary to prevent old docs from being pushed too far  down.
> Has anyone actually done anything like that?

I experimented ages ago with adding an exponentially decaying weight
bonus based on the age of the document.  So a brand new document gets
a weight bonus of X, one which is H days old gets X/2, one which is
2H days old gets X/4, etc, where you can specify X and H (H is the

This seemed to work reasonably well, but never got finished off.  The
prototype used to be in Xapian, but was removed for 1.0.0 as it wasn't
really usable as it stood.

Rusty Conover was working on an ExternalPostList which would provide
most of the infrastructure for implementing this properly.  For past
discussion, see:



More information about the Xapian-discuss mailing list