user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 4/6] search: consistently pass options and flags
Date: Sat, 22 Aug 2015 11:41:22 +0000	[thread overview]
Message-ID: <1440243684-2205-4-git-send-email-e@80x24.org> (raw)
In-Reply-To: <1440243684-2205-1-git-send-email-e@80x24.org>

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


  parent reply	other threads:[~2015-08-22 11:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-22 11:41 [PATCH 1/6] search: split search indexing to a separate file Eric Wong
2015-08-22 11:41 ` [PATCH 2/6] view: misc cleanups and simplifications Eric Wong
2015-08-22 11:41 ` [PATCH 3/6] view: reference total followups Eric Wong
2015-08-22 11:41 ` Eric Wong [this message]
2015-08-22 11:41 ` [PATCH 5/6] mbox: support uncompressed mbox Eric Wong
2015-08-22 11:41 ` [PATCH 6/6] view: wire up mbox.gz links Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440243684-2205-4-git-send-email-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).