about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-07-20 06:16:12 +0000
committerEric Wong <e@80x24.org>2018-07-20 07:02:45 +0000
commit5252ed7b787ddf5dd3f5b6cfda78fa515b21376d (patch)
treebb02b1e236b3504b8d1eca12b5c5b0954627081c
parentea54cfe8dad656021517b32c76f0893979fb001b (diff)
downloadpublic-inbox-5252ed7b787ddf5dd3f5b6cfda78fa515b21376d.tar.gz
I've hit some case where probabilistic searches don't work when
using dfpre:/dfpost:/dfblob: search prefixes because stemming in
the query parser interferes.

In any case, our indexing code indexes longer/unabbreviated blob
names down to its 7 character abbreviation, so there should be
no need to do wildcard searches on git blob names.
-rw-r--r--lib/PublicInbox/Search.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 69eca9fe..090d998b 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -50,6 +50,9 @@ use constant {
 
 my %bool_pfx_external = (
         mid => 'Q', # Message-ID (full/exact), this is mostly uniQue
+        dfpre => 'XDFPRE',
+        dfpost => 'XDFPOST',
+        dfblob => 'XDFPRE XDFPOST',
 );
 
 my $non_quoted_body = 'XNQ XDFN XDFA XDFB XDFHH XDFCTX XDFPRE XDFPOST';
@@ -74,9 +77,6 @@ my %prob_prefix = (
         dfb => 'XDFB',
         dfhh => 'XDFHH',
         dfctx => 'XDFCTX',
-        dfpre => 'XDFPRE',
-        dfpost => 'XDFPOST',
-        dfblob => 'XDFPRE XDFPOST',
 
         # default:
         '' => 'XM S A XQUOT XFN ' . $non_quoted_body,
@@ -266,7 +266,7 @@ sub qp {
                 Search::Xapian::NumberValueRangeProcessor->new(DT, 'dt:'));
 
         while (my ($name, $prefix) = each %bool_pfx_external) {
-                $qp->add_boolean_prefix($name, $prefix);
+                $qp->add_boolean_prefix($name, $_) foreach split(/ /, $prefix);
         }
 
         # we do not actually create AltId objects,