[Xapian-discuss] time bias/sorting
jossblowing at yahoo.co.uk
Wed Jul 12 11:43:39 BST 2006
Thank you very much Olly, that's well useful.
It does leave me a touch unsure of something though..
terms, postings, values.
A term is like a posting but without positional information. You search on terms and postings.
What therefore is a value - are these searched on in the traditional sense ('keyword foo bar'), or are they used just to narrow a search down - like a boolean operator might.
thank you v.much,joss
Olly Betts <olly at survex.com> wrote: On Tue, Jul 11, 2006 at 10:20:11AM +0100, Joss Shaw wrote:
> Am I right in thinking that Xapian has some nascant interface for
> sorting or biasing results by a Unix timestamp value stored in a
> document ?
For biasing results, yes. The interface for sorting on a value is
very usable - I wouldn't describe that as nascent.
Rusty Conover is (or was) working on an "ExternalPostList" which is
actually very close to what is needed to implement MatchBiasFunctor:
I don't know what the current status of that is.
> I've been through the documentation but I can't seem to
> confirm this. I see in a previous email to this list that you can add
> three terms with the prefixes "D", "M" and "Y" - but I'm not sure if
> these actually help sort/bias results. Is there a fourth prefix which
> allows me to store a timestamp ?
You want to store the timestamp in a document value, not as a term.
Use something like:
> I've also discovered $enq->set_bias(); but I'm not entirely clear on
> its options. In some sample code I see set_bias(0, 86400); I guess
> 86400 is 24 hours in seconds, but what exactly does it do ?
It's the half-life. The extra weight decays exponentially with age, so
an article 1 day old will get half the extra weight that a brand new
article will; an article 2 days old will get 1/4 of the weight, etc.
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine
More information about the Xapian-discuss