Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / 7a / 84b043ed102de24fc144404b213b2d3e2fea0e
1 Return-Path: <amdragon@mit.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id F00D6421197\r
6         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 11:47:40 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id grh8KH253H4k for <notmuch@notmuchmail.org>;\r
16         Tue, 17 Jan 2012 11:47:40 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
18         [18.7.68.34])\r
19         by olra.theworths.org (Postfix) with ESMTP id 5B65A421192\r
20         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 11:47:40 -0800 (PST)\r
21 X-AuditID: 12074422-b7fd66d0000008f9-d8-4f15d05b5f1e\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id E9.55.02297.B50D51F4; Tue, 17 Jan 2012 14:47:39 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q0HJlXHX018149; \r
27         Tue, 17 Jan 2012 14:47:33 -0500\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0HJlRPg029944\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Tue, 17 Jan 2012 14:47:32 -0500 (EST)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@MIT.EDU>)\r
36         id 1RnEzz-00082h-Kv; Tue, 17 Jan 2012 14:47:15 -0500\r
37 Date: Tue, 17 Jan 2012 14:47:15 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Jani Nikula <jani@nikula.org>\r
40 Subject: Re: Partial words on notmuch search?\r
41 Message-ID: <20120117194715.GO16740@mit.edu>\r
42 References: <20120115220600.GO7037@think.nuvreauspam>\r
43         <877h0sa207.fsf@fester.com>\r
44         <20120116202103.GA14329@think.nuvreauspam>\r
45         <20120117023431.GF16740@mit.edu> <87aa5mkyw5.fsf@nikula.org>\r
46 MIME-Version: 1.0\r
47 Content-Type: text/plain; charset=us-ascii\r
48 Content-Disposition: inline\r
49 In-Reply-To: <87aa5mkyw5.fsf@nikula.org>\r
50 User-Agent: Mutt/1.5.21 (2010-09-15)\r
51 X-Brightmail-Tracker:\r
52  H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42IR4hRV1o2+IOpv8HG+kMWqCdIWTdOdLa7f\r
53         nMnswOyxc9Zddo9b91+zezxbdYs5gDmKyyYlNSezLLVI3y6BK+N8xx/2gq/cFc+eLWJrYDzP\r
54         2cXIySEhYCLR/H09K4QtJnHh3nq2LkYuDiGBfYwSxx+dYYdwNjBKrD53kBHCOckkcfbSYiYI\r
55         ZwmjxI3fU9lA+lkEVCXad99nBLHZBDQktu1fDmaLCChKbD65H8xmFnCTWLy5F2yfsICuxKkd\r
56         B9hBbF4BHYlna14xQww9yCix7+ADVoiEoMTJmU9YIJq1JG78ewm0mQPIlpZY/o8DJMwJtKtn\r
57         4gMmEFtUQEViysltbBMYhWYh6Z6FpHsWQvcCRuZVjLIpuVW6uYmZOcWpybrFyYl5ealFuqZ6\r
58         uZkleqkppZsYQaHO7qK0g/HnQaVDjAIcjEo8vAWbRP2FWBPLiitzDzFKcjApifI+PA8U4kvK\r
59         T6nMSCzOiC8qzUktPsQowcGsJMKbmwaU401JrKxKLcqHSUlzsCiJ86prvfMTEkhPLEnNTk0t\r
60         SC2CycpwcChJ8C4FGSpYlJqeWpGWmVOCkGbi4AQZzgM0fCFIDW9xQWJucWY6RP4Uo6KUOG8T\r
61         SEIAJJFRmgfXC0tFrxjFgV4R5l0OUsUDTGNw3a+ABjMBDc5pFQIZXJKIkJJqYJzXFGlYcCl5\r
62         y/efwaIn9FY7VC72XfDOXiCWeYrLNs/Jtd/XTAhiCdXtK7apf/Fao9uhKO4N7xqBFccPuOfz\r
63         331ziD1X7kvybLtzbJVvrvhad854t/nR5rb4mMAf1Uz5n10ZzLpmz/i/mqP1bM+Lv6qrXONf\r
64         /jVldVvRlGKp6sXvWfVLccuVN0osxRmJhlrMRcWJAFIqgc0gAwAA\r
65 Cc: notmuch@notmuchmail.org, Andrei Popescu <andreimpopescu@gmail.com>\r
66 X-BeenThere: notmuch@notmuchmail.org\r
67 X-Mailman-Version: 2.1.13\r
68 Precedence: list\r
69 List-Id: "Use and development of the notmuch mail system."\r
70         <notmuch.notmuchmail.org>\r
71 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
72         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
73 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
74 List-Post: <mailto:notmuch@notmuchmail.org>\r
75 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
76 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
77         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
78 X-List-Received-Date: Tue, 17 Jan 2012 19:47:41 -0000\r
79 \r
80 Quoth Jani Nikula on Jan 17 at  7:43 pm:\r
81 > On Mon, 16 Jan 2012 21:34:31 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
82 > > Quoth Andrei Popescu on Jan 16 at 10:21 pm:\r
83 > > > This is also interesting:\r
84 > > > $ notmuch count 'debian'\r
85 > > > 65888\r
86 > > > $ notmuch count 'dEbian'\r
87 > > > 65888\r
88 > > > $ notmuch count 'Debian'\r
89 > > > 65887\r
90 > > \r
91 > > The first two will match stemmed versions of "debian" such as\r
92 > > "debian's" and "debianed".  However, starting a term with a capital\r
93 > > letter suppresses stemming (because it suggests that it's a name,\r
94 > > which you wouldn't want to modify), so your last query matches only\r
95 > > the term "debian".  This is probably documented somewhere, though I\r
96 > > don't know where.\r
97\r
98 > Interesting. Is this done when adding the terms to the database, or when\r
99 > searching? I presume the latter. How much control does notmuch have over\r
100 > this?\r
101 \r
102 This is getting a bit out of my depth, but I believe indexing is done\r
103 with both stemmed and unstemmed versions of all terms (if stemming is\r
104 enabled) so that search can use either.\r
105 \r
106 For indexing, Notmuch can set the stemmer (or no stemmer).  Xapian\r
107 provides stemmers for a variety of languages:\r
108   http://xapian.org/docs/apidoc/html/classXapian_1_1Stem.html#6c46cedf2047b159a7e4c9d4468242b1\r
109 \r
110 For query parsing, Notmuch can set both the stemmer and a "stemming\r
111 strategy" that controls when it stems or doesn't stem terms:\r
112   http://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html#c7dc3b55b6083bd3ff98fc8b2726c8fd\r