]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchidx: allow searching Message-IDs in free-form text
authorEric Wong <e@80x24.org>
Tue, 9 Aug 2016 23:59:10 +0000 (23:59 +0000)
committerEric Wong <e@80x24.org>
Wed, 10 Aug 2016 23:20:19 +0000 (23:20 +0000)
It is not unheard of for users to attempt finding messages by
entering Message-IDs into the "Search" box instead of using the
existing URL structure.  So make it possible for them.

Fwiw, I've definitely encountered users who enter entire URLs
into generic search engines.

lib/PublicInbox/SearchIdx.pm

index 0582526e8b1c5b0f0866b39911e1a94d9a3507dc..a18a214880b2f4e6b03197e6f04d1f8f2e13f9a8 100644 (file)
@@ -169,6 +169,7 @@ sub add_message {
                });
 
                link_message($self, $smsg, $old_tid);
+               $tg->index_text($mid, 1);
                $doc->set_data($smsg->to_doc_data($blob));
                if (defined $doc_id) {
                        $db->replace_document($doc_id, $doc);