[PATCH] WIP: regexp matching in 'subject' and 'from'

Tomi Ollila tomi.ollila at iki.fi
Sat Jun 11 10:09:28 PDT 2016


On Sat, Jun 11 2016, Gaute Hope <eg at gaute.vetsj.com> wrote:

> David Bremner writes on juni 10, 2016 13:09:
>> Gaute Hope <eg at gaute.vetsj.com> writes:
>> 
>>>
>>> Cool!
>>>
>>> Would it break a lot of things if you just replace the original prefix?
>> 
>> It would change the matching behaviour. I guess there are people that
>> like the current "sloppy" matching of from: and subject:.  In my
>> not-very-scientific tests, it is a factor of 5 to 10 times slower to do
>> regexp search, which makes sense because it is effectively post
>> processing the results from Xapian. At least on my system it seems fast
>> enough to be usable interactively, but that is a pretty shocking
>> performance regression. And I know there are people with more mail on
>> slower systems.
>
> Maybe we could check if the search string contains a regexp and decide
> whether to pre-process it on the background of that? I think that would
> make the interface more user-friendly. You'd just always use search
> whether you decide that you need to put in some regexp or not.

You probably wanted to suggest that the command line handling in notmuch
goes through the search terms and potentially modify it before giving
to xapian to chew for... I think this is deliberately avoided (*) -- this
would get out of hands so easily (if we could decide syntax)...

(*) there is some optmization done before feeding the query to xapian --
but that does not affect interface (i.e. it could be dropped and none of
the users' expectations would be broken...)

What one can do, is write ones own wrapper around notmuch. I have one
that was written long before notmuch got date: searches (it mangles
e.g 5h.. to 1234567890.. (**) and logs search and show queries
(**) should change that to use date:... instead (i.e. date: queries w/o
date: prefix). I "suggested" subject:/one's own subject re search w// slashes/
which one could pretty easily write to the wrapper...

Tomi

>
>> 
>>> Could it be made to work on the message body?
>> 
>> See Austin's previous reply for the details, but basically no; these
>> "values" index in terms of whole strings, while the body is indexed by
>> terms (roughly, words). In principle we could add a value slot for the
>> body, but I think that would at least double the size of the database
>> (maybe more).
>> 
>
> I would rather have double the db and be able wildcard beginning of
> terms. If it is not too much maintaining overhead it might be made
> optional?
>
>
> Regards, Gaute
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list