Re: [PATCH 2/5] Add quotes around id:"message-id" queries.

Subject: Re: [PATCH 2/5] Add quotes around id:"message-id" queries.

Date: Fri, 02 Jul 2010 17:04:46 +0400

To: Olly Betts, notmuch@notmuchmail.org

Cc:

From: Dmitry Kurochkin


On Fri, 2 Jul 2010 04:41:43 +0000 (UTC), Olly Betts <olly@survex.com> wrote:
> On 2010-07-01, Dmitry Kurochkin wrote:
> > -  (concat "id:" (notmuch-show-get-prop :id props)))
> > +  (concat "id:\"" (notmuch-show-get-prop :id props) "\""))
> 
> This is probably a good idea (the ".." example is arguably a Xapian bug so
> that should be fixed soon, but you find all sorts of junk in message-ids.
> 

If I comment out add_valuerangeprocessor call in
notmuch_database_open(), ids with .. are matched fine with no quotes.

So it seems that xapian uses the ValueRangeProcessor for all terms
while it should be used for one value parsing only. Is this correct?

Is there a xapian bug for this?

> However, the quoting feature this relies on was added in Xapian 1.0.18 (and
> 1.1.4), and with older versions this will break for *all* message-ids (even
> those which currently work).
> 

Indeed.

> Also, if you're going to quote the message-id, you should escaping any "
> characters in the message-id (by doubling them).
> 

Right.

I have found a xapian bug #128 "Allow queryparser to treat some prefixes
as literal text". Seems to be just what we need here. Perhaps instead of
quoting in emacs client, we can wait for the value range parsing fix
(can be fixed in minor release?) and use #128 when it is available. IMHO
should be good enought in most cases. What do you think?

Regards,
  Dmitry

> Cheers,
>     Olly
> 
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

Thread: