diff options
author | Eric Wong <e@80x24.org> | 2016-08-16 08:49:26 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-08-16 21:30:57 +0000 |
commit | 1031291ec876cf3791077aa7d564a8bf8561ee1f (patch) | |
tree | a8c18a9c687e800002dd3ec798af8966face62db /lib/PublicInbox/Search.pm | |
parent | 3fc411c772a21d8faeec3fde32b101bc86190ddb (diff) | |
download | public-inbox-1031291ec876cf3791077aa7d564a8bf8561ee1f.tar.gz |
This is similar to mairix in that it uses a "d:" prefix; but only takes YYYYMMDD, for now. Using custom date/time parsers via Perl will be much more work: nntp://news.gmane.org/20151005222157.GE5880@survex.com Anyhow, this ought to be more human-friendly than searching by Unix timestamps, but it requires reindexing to take advantage of.
Diffstat (limited to 'lib/PublicInbox/Search.pm')
-rw-r--r-- | lib/PublicInbox/Search.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 61f03383..7561ef44 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -12,6 +12,7 @@ use constant TS => 0; # timestamp use constant NUM => 1; # NNTP article number use constant BYTES => 2; # :bytes as defined in RFC 3977 use constant LINES => 3; # :lines as defined in RFC 3977 +use constant YYYYMMDD => 4; # for searching in the WWW UI use Search::Xapian qw/:standard/; use PublicInbox::SearchMsg; @@ -179,6 +180,8 @@ sub qp { $qp->set_database($self->{xdb}); $qp->set_stemmer($self->stemmer); $qp->set_stemming_strategy(STEM_SOME); + $qp->add_valuerangeprocessor( + Search::Xapian::StringValueRangeProcessor->new(YYYYMMDD, 'd:')); while (my ($name, $prefix) = each %bool_pfx_external) { $qp->add_boolean_prefix($name, $prefix); |