* [PATCH 4/6] search: consistently pass options and flags
@ 2015-08-22 11:41 7% ` Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2015-08-22 11:41 UTC (permalink / raw)
To: meta
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
^ permalink raw reply related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-08-22 11:41 [PATCH 1/6] search: split search indexing to a separate file Eric Wong
2015-08-22 11:41 7% ` [PATCH 4/6] search: consistently pass options and flags Eric Wong
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).