From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 390A56DE0207 for ; Wed, 10 Oct 2018 03:43:16 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.005 X-Spam-Level: X-Spam-Status: No, score=0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jznkyt5nogFK for ; Wed, 10 Oct 2018 03:43:14 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 76ECE6DE0192 for ; Wed, 10 Oct 2018 03:43:14 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1gABxQ-0006HD-Ku; Wed, 10 Oct 2018 06:43:12 -0400 Received: (nullmailer pid 20361 invoked by uid 1000); Wed, 10 Oct 2018 10:43:11 -0000 From: David Bremner To: William Casarin , notmuch@notmuchmail.org Subject: Re: [PATCH RFC] index: add body: search query term In-Reply-To: <20181010055326.19030-1-jb55@jb55.com> References: <20181010055326.19030-1-jb55@jb55.com> Date: Wed, 10 Oct 2018 07:43:11 -0300 Message-ID: <87in2arsjk.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2018 10:43:16 -0000 William Casarin writes: > > lib/database.cc | 3 +++ > lib/index.cc | 2 +- > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/lib/database.cc b/lib/database.cc > index 9cf8062c..0b085b21 100644 > --- a/lib/database.cc > +++ b/lib/database.cc > @@ -297,6 +297,9 @@ prefix_t prefix_table[] = { > { "subject", "XSUBJECT", NOTMUCH_FIELD_EXTERNAL | > NOTMUCH_FIELD_PROBABILISTIC | > NOTMUCH_FIELD_PROCESSOR}, > + { "body", "XBODY", NOTMUCH_FIELD_EXTERNAL | > + NOTMUCH_FIELD_PROBABILISTIC | > + NOTMUCH_FIELD_PROCESSOR}, > }; > > static void > diff --git a/lib/index.cc b/lib/index.cc > index 3f694387..299b8770 100644 > --- a/lib/index.cc > +++ b/lib/index.cc > @@ -506,7 +506,7 @@ _index_mime_part (notmuch_message_t *message, > body = (char *) g_byte_array_free (byte_array, false); > > if (body) { > - _notmuch_message_gen_terms (message, NULL, body); > + _notmuch_message_gen_terms (message, "body", body); > > free (body); > } > -- I think you'll find you broke non-prefixed queries. Does the test suite still pass? If so, we need more tests. Anyway, if you add a second set of terms I'd be intersted how much this bloats the index. Ideally with the performance corpus so we can all reproduce the experiment. d