_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);
});
}
+sub lookup_article {
+ my ($self, $num) = @_;
+ my $term = 'XNUM'.$num;
+ my $smsg;
+ eval {
+ retry_reopen($self, sub {
+ my $db = $self->{skel} || $self->{xdb};
+ my $head = $db->postlist_begin($term);
+ return if $head == $db->postlist_end($term);
+ my $doc_id = $head->get_docid;
+ return unless defined $doc_id;
+ # raises on error:
+ my $doc = $db->get_document($doc_id);
+ $smsg = PublicInbox::SearchMsg->wrap($doc);
+ $smsg->load_expand;
+ $smsg->{doc_id} = $doc_id;
+ });
+ };
+ $smsg;
+}
+
sub each_smsg_by_mid {
my ($self, $mid, $cb) = @_;
my $xdb = $self->{xdb};