[Xapian-discuss] date handling

Olly Betts olly at survex.com
Mon Oct 16 16:05:12 BST 2006


On Mon, Oct 16, 2006 at 04:14:03AM -0400, mlewis at xelent.net wrote:
> I need to be able to do a full text search AND limit my choices by
> date. For example, all documents containing "programming php between
> 2006-05-01 and 2006-10-01" or "foreach before 2006-02-01". Is there a
> mechinism within Xapian that I can use for this to do a fast,
> efficient search?

You can either put the date in a document value use a MatchDecider
to only match documents with the desired date criteria, or you do
what Omega does and add terms for the year, month, and date, and
build a suitable boolean expression to cover the date range you
want.  Probably easiest to just look at the Omega code and docs
to see how that works.

Omega's approach predates the MatchDecider concept.  Currently it
still has at least one advantage - the bounds on the match statistics
are usually much better.  It may currently be faster too, but I've not
benchmarked the two approaches to see.  There are plans in the pipeline
to try to address both of these issues - then I think Omega will
probably switch to using a MatchDecider.

Cheers,
    Olly



More information about the Xapian-discuss mailing list