]> Sergey Matveev's repositories - public-inbox.git/commitdiff
search: consistently pass options and flags
authorEric Wong <e@80x24.org>
Sat, 22 Aug 2015 11:41:22 +0000 (11:41 +0000)
committerEric Wong <e@80x24.org>
Sat, 22 Aug 2015 11:42:36 +0000 (11:42 +0000)
Most of our special query functions require exact matches, so none
of the flags we normally use are necessary for query parsing.

lib/PublicInbox/Search.pm

index 753f5f3fa2752a3121d1a251e00686398929b2a3..c61d4cf649559d5c46bf081041e9a459fb54f5ec 100644 (file)
@@ -82,7 +82,7 @@ sub query {
 sub get_subject_path {
        my ($self, $path, $opts) = @_;
        my $query = $self->qp->parse_query("path:".mid_compressed($path), 0);
-       $self->do_enquire($query);
+       $self->do_enquire($query, $opts);
 }
 
 # given a message ID, get followups to a message
@@ -94,8 +94,7 @@ sub get_followups {
        my $irt = $qp->parse_query("inreplyto:$mid", 0);
        my $ref = $qp->parse_query("references:$mid", 0);
        my $query = Search::Xapian::Query->new(OP_OR, $irt, $ref);
-
-       $self->do_enquire($query);
+       $self->do_enquire($query, $opts);
 }
 
 sub get_thread {
@@ -104,8 +103,8 @@ sub get_thread {
 
        return { total => 0, msgs => [] } unless $smsg;
        my $qp = $self->qp;
-       my $qtid = $qp->parse_query('thread:'.$smsg->thread_id);
-       my $qsub = $qp->parse_query('path:'.mid_compressed($smsg->path));
+       my $qtid = $qp->parse_query('thread:'.$smsg->thread_id, 0);
+       my $qsub = $qp->parse_query('path:'.mid_compressed($smsg->path), 0);
        my $query = Search::Xapian::Query->new(OP_OR, $qtid, $qsub);
        $self->do_enquire($query, $opts);
 }