additional gmail-style query language additions
original message:
Simple patch attached. Adds the "during" operator to the date searches
so you can say during:today or during:november . I prefer it to in/on
today :)
Also adds an alias for the label search of "is" so that you can do
more gmail like searches is:starred, is:unread, is:spam, is:deleted.
The last two required changing the return value to a list/pair in
parse_user_string_query and I'm not sure what the best way to do this
in ruby is. For now its a simple list. Also is there a better way to
deal with a nil result other than returning [nil,nil]? The first
element is the parsed query string, the second allows the parser to
add options to the query like :load_spam, :load_deleted which are then
used in the code already to drop (or not) the spam/deleted labeled
messages.
I figured you'd never want to search killed threads... and it made the
patch nastier because of the :skip_killed flag.
I'd like to add a has:attachment operator but the ferret index doesnt
appear to store enough info for this. It would be really nice to be
able to search for attachments (of certain types as well with
filename:...) I took a look at extending the index to add a new field
"filename" that contains a list of filenames attached to a message,
but this would break everyones index so I'm just requesting it as a
wishlist item rather than submitting a patch. With it you could do
wildcard filename attachment searches and the has:attachment search
would just be converted to a search for the presence of any filename.