about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-21 10:35:36 +0000
committerEric Wong <e@80x24.org>2016-06-21 10:36:23 +0000
commit36f62781880dd38b94011f0d351fcf7b0aa2916c (patch)
tree4f99fd7591f412b7aefb61fdc238ceaee97863fe /lib
parent73d274e83b7d300f31e0cc1ceeacbf73c6c2a1e4 (diff)
downloadpublic-inbox-36f62781880dd38b94011f0d351fcf7b0aa2916c.tar.gz
Some mailing lists allow empty Subject headers and we shall support
searching and indexing them.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Search.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index bf50365a..3a908ac6 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -107,12 +107,15 @@ sub get_thread {
 
         return { total => 0, msgs => [] } unless $smsg;
         my $qtid = Search::Xapian::Query->new(xpfx('thread').$smsg->thread_id);
-        my $path = id_compress($smsg->path);
-        my $qsub = Search::Xapian::Query->new(xpfx('path').$path);
-        my $query = Search::Xapian::Query->new(OP_OR, $qtid, $qsub);
+        my $path = $smsg->path;
+        if (defined $path && $path ne '') {
+                my $path = id_compress($smsg->path);
+                my $qsub = Search::Xapian::Query->new(xpfx('path').$path);
+                $qtid = Search::Xapian::Query->new(OP_OR, $qtid, $qsub);
+        }
         $opts ||= {};
         $opts->{limit} ||= 1000;
-        _do_enquire($self, $query, $opts);
+        _do_enquire($self, $qtid, $opts);
 }
 
 sub _do_enquire {