Opened 5 years ago
Last modified 5 years ago
#794 new enhancement
delimiter/raw-string support for FieldProcessors
Reported by: | bremner | Owned by: | Olly Betts |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | QueryParser | Version: | |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Operating System: | All |
Description
notmuch uses FieldProcessors to support a optional regex syntax.
subject:/^foo.*/
and
subject:"foo bar"
are both valid but the latter is a regular phrase search.
This works by taking the string passed to field processor and parsing it recursively with the given default prefix.
thread:{} is a similar syntax provided via field processors.
Currently the "" are removed before passing the string into the field processor, which means the field process has to guess (e.g. by looking for spaces) if phrase parsing is intended. This guessing can be wrong, e.g. in the case of wildcards.
It would be nice if there was a way to know if the string passed in was originally quoted.
I guess the other related issue is that it feels a bit hacky to trigger phrase parsing by adding double quotes to the front and back of the string, but I'm not sure if that's worth worrying about.
Currently users have to quote both field:/foo bar/ and field:{foo bar} queries to avoid the foo and bar being split apart. It would be nice if we could define new or extra delimiter pairs. Currently notmuch does not support escaping of these fake delimiters, so foo:/blah/blurg/ is one regex with a / in the middle.