From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id BE6011FAE4 for ; Sat, 22 Aug 2015 11:41:24 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/6] search: consistently pass options and flags Date: Sat, 22 Aug 2015 11:41:22 +0000 Message-Id: <1440243684-2205-4-git-send-email-e@80x24.org> In-Reply-To: <1440243684-2205-1-git-send-email-e@80x24.org> References: <1440243684-2205-1-git-send-email-e@80x24.org> List-Id: 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 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 753f5f3..c61d4cf 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -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); } -- EW