From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65935 Path: news.gmane.org!not-for-mail From: Vegard Vesterheim Newsgroups: gmane.emacs.gnus.general Subject: Re: NNIR, IMAP SEARCH, and the infinite pain of search terms. Date: Tue, 11 Dec 2007 11:39:53 +0100 Organization: UNINETT. Message-ID: <1s8x41347a.fsf@voll2.uninett.no> References: <87r6hu3hml.fsf@enki.rimspace.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1197369675 11612 80.91.229.12 (11 Dec 2007 10:41:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Dec 2007 10:41:15 +0000 (UTC) Cc: ding@gnus.org, Kai =?utf-8?Q?Gro=C3=9Fjohann?= , Simon Josefsson To: Daniel Pittman Original-X-From: ding-owner+M14429@lists.math.uh.edu Tue Dec 11 11:41:22 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1J22Y9-0000bs-Kp for ding-account@gmane.org; Tue, 11 Dec 2007 11:41:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1J22Wz-0001jn-0Y; Tue, 11 Dec 2007 04:40:05 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1J22Ww-0001jW-Vg for ding@lists.math.uh.edu; Tue, 11 Dec 2007 04:40:02 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1J22Wq-0000Qe-Rw for ding@lists.math.uh.edu; Tue, 11 Dec 2007 04:40:02 -0600 Original-Received: from tyholt.uninett.no ([158.38.62.9] ident=postfix) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1J22Wo-0005hQ-00 for ; Tue, 11 Dec 2007 11:39:54 +0100 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by tyholt.uninett.no (Postfix) with ESMTP id B2A912BB1D5; Tue, 11 Dec 2007 11:39:53 +0100 (CET) Original-Received: from tyholt.uninett.no ([127.0.0.1]) by localhost (tyholt.uninett.no [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 26742-01-71; Tue, 11 Dec 2007 11:39:53 +0100 (CET) Original-Received: from voll2.uninett.no (unknown [IPv6:2001:700:1:0:20c:76ff:feb9:8170]) by tyholt.uninett.no (Postfix) with ESMTP id 51EC62BB102; Tue, 11 Dec 2007 11:39:53 +0100 (CET) X-Face: Vl8-zx%G~!/rC5W!BM+T]w:k.[$Zqh. Q'Af|}oZ6JAhaysP"/43eD<|.BoMETII (Daniel Pittman's message of "Mon\, 10 Dec 2007 22\:37\:38 +1100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at uninett.no X-Spam-Score: -1.8 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65935 Archived-At: On Mon, 10 Dec 2007 22:37:38 +1100 Daniel Pittman wrote: > G'day. > > Gnus contains, in contrib/, the nnir.el interface to search engines. > This is a nice tool and, pleasantly, supports IMAP SEARCH to give me > efficient searching of my IMAP mail ... or so I thought. > > The biggest problem I had was that it would never seem to find the mail > I expected, so I didn't use it much. > > After inspecting the code the reason became clear: the search was a > single "exact substring" match performed, not the logical sort of search > that I have come to expect with Google and other search engines. > > > So... the IMAP SEARCH command doesn't do any clever parsing or > anything; the front end software has to do that. > > Attached is my first "draft" of a more complex search front-end for NNIR > and IMAP SEARCH -- it parses the query, translates that into a suitable > IMAP SEARCH command and returns the results. > > > This is *much* less surprising to me: it returns what I expect, most of > the time, and takes the sort of input I would expect as well. > > > At the moment it only handles basic searching, as documented in the > `nnir-imap-make-query' function in the patch. > > I plan to extend this to support the full range of operators that IMAP > SEARCH supports, but wanted to seek feedback on the initial > implementation first. I have been bothered by the same limitation in nnir. Glad to see someone tackling this issue. My elisp skills are limited, so my take on this was simply to replace this: (imap-search (concat "TEXT \"" qstring "\"") buf)) with this: (imap-search (concat "CHARSET iso-8859-1 " qstring) buf)) Now I can write IMAP SEARCH commands directly myself. This is very useful, I can for example do searches like: (OR FROM foo FROM bar) BEFORE Jul-18-2007 I find this very useful, although it means I have to spell out the IMAP SEARCH command myself. Looking forward to trying your solution. - Vegard -