Gnus development mailing list
 help / color / mirror / Atom feed
From: Vegard Vesterheim <vegard.vesterheim@uninett.no>
To: Daniel Pittman <daniel@rimspace.net>
Cc: ding@gnus.org,
	"Kai Großjohann" <grossjohann@ls6.cs.uni-dortmund.de>,
	"Simon Josefsson" <jas@pdc.kth.se>
Subject: Re: NNIR, IMAP SEARCH, and the infinite pain of search terms.
Date: Tue, 11 Dec 2007 11:39:53 +0100	[thread overview]
Message-ID: <1s8x41347a.fsf@voll2.uninett.no> (raw)
In-Reply-To: <87r6hu3hml.fsf@enki.rimspace.net> (Daniel Pittman's message of "Mon\, 10 Dec 2007 22\:37\:38 +1100")

On Mon, 10 Dec 2007 22:37:38 +1100 Daniel Pittman <daniel@rimspace.net> 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 -




  reply	other threads:[~2007-12-11 10:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-10 11:37 Daniel Pittman
2007-12-11 10:39 ` Vegard Vesterheim [this message]
2008-04-13 14:05 ` Reiner Steib
2008-04-14 11:54   ` Daniel Pittman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1s8x41347a.fsf@voll2.uninett.no \
    --to=vegard.vesterheim@uninett.no \
    --cc=daniel@rimspace.net \
    --cc=ding@gnus.org \
    --cc=grossjohann@ls6.cs.uni-dortmund.de \
    --cc=jas@pdc.kth.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).