diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-03 20:18:34 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-03 20:18:34 +0000 |
commit | b212aee7e13c460b73a3632458ae96c39d9eac97 (patch) | |
tree | 13d89c2fd714cfeac4f5989233bf37d78ca7e5ba /lib/PublicInbox | |
parent | fa3283debd81490ac1d5e0895fc2d8968e1f110b (diff) | |
download | public-inbox-b212aee7e13c460b73a3632458ae96c39d9eac97.tar.gz |
I guess nobody uses this command (slrnpull does not), and the breakage was not noticed until I started writing new tests for multi-MID handling. Fixes: 3fc411c772a21d8f ("search: drop pointless range processors for Unix timestamp")
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/NNTP.pm | 2 | ||||
-rw-r--r-- | lib/PublicInbox/Search.pm | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 895e5023..fb65ddc0 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -336,7 +336,7 @@ sub cmd_newnews ($$$$;$$) { long_response($self, 0, long_response_limit, sub { my ($i) = @_; my $srch = $srch[0]; - my $res = $srch->query($ts, $opts); + my $res = $srch->query_ts($ts, $opts); my $msgs = $res->{msgs}; if (my $nr = scalar @$msgs) { more($self, '<' . diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 802984b0..4dc27472 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -330,6 +330,20 @@ sub query_xover { _do_enquire($self, $query, $opts); } +sub query_ts { + my ($self, $ts, $opts) = @_; + my $qp = $self->{qp_ts} ||= eval { + my $q = Search::Xapian::QueryParser->new; + $q->set_database($self->{skel} || $self->{xdb}); + $q->add_valuerangeprocessor( + Search::Xapian::NumberValueRangeProcessor->new(TS)); + $q + }; + my $query = $qp->parse_query($ts, QP_FLAGS); + $opts->{enquire} = enquire_skel($self); + _do_enquire($self, $query, $opts); +} + sub lookup_skeleton { my ($self, $mid) = @_; my $skel = $self->{skel} or return lookup_message($self, $mid); |