[PATCH 8/8] Support before: and after: date search with sane date syntax.

2011-01-16 Thread Austin Clements
Gmail-compatible date search operators, where the date must be specified as /mm/dd. This is just a start; it would be great to support fancier date syntax and, in particular, relative date specifications. --- lib/database.cc | 50 ++ 1 files c

[PATCH 7/8] Implement value range queries.

2011-01-16 Thread Austin Clements
Unlike in Xapian, there's no specific syntax that generates value ranges. Instead, it's up query transforms to generate them. --- lib/notmuch-private.h |8 lib/qparser.cc| 20 +--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/notmuch-p

[PATCH 6/8] Support maildir folder search.

2011-01-16 Thread Austin Clements
This implements a folder: query prefix by constructing a wildcard query that matches all files within the specified folder, folder/new, or folder/cur. This works with hierarchical folder names, and accepts both absolute and relative paths. --- lib/database.cc | 56 ++

[PATCH 5/8] Support "tag:*" as well as "NOT tag:*" queries.

2011-01-16 Thread Austin Clements
This extends the syntactic-to-database prefix query transform to optionally expand wildcards for boolean prefixes. Support of "NOT tag:*" queries to find all untagged messages falls out as a convenient side-effect. --- TODO |2 -- lib/database.cc |4 ++-- lib/notmuc

[PATCH 4/8] Replace Xapian query parser with custom query parser.

2011-01-16 Thread Austin Clements
Note that the type:mail filter is implemented as a transform pass, so it no longer has to be done everywhere queries are parsed. Furthermore, this filter now depends on the prefixing logic in the query parser instead of implementing this itself. Likewise, we don't need to special-case the queries

[PATCH 3/8] Parse wildcard queries.

2011-01-16 Thread Austin Clements
This implements support in the lexer and generator for wildcard terms, expanding them into synonym queries the way Xapian does. Since this expansion is performed by the generator, it's easy to take advantage of in query transforms. With this, * works anywhere in the query, so we'll no longer need

[PATCH 2/8] Parse NEAR and ADJ operators.

2011-01-16 Thread Austin Clements
NEAR and ADJ are treated as n-ary operators where all operands must be terms, which fits with Xapian's own restrictions on near/adj queries. This implementation is slightly more lenient than Xapian's in that it allows phrases (both quoted and implicit) as operands and folds the phrase terms in as o

[PATCH 1/8] Implement a custom query parser with a mostly Xapian-compatible grammar.

2011-01-16 Thread Austin Clements
This parser takes an extra step through an intermediate representation that is convenient to manipulate via pluggable transformation passes. These are used to implement regular Xapian-style query prefixes, but are flexible enough to accomplish far more. --- lib/Makefile.local |1 + lib/dat

[RFC PATCH v2 0/8] Custom query parser, date search, folder search, and more

2011-01-16 Thread Austin Clements
This is version 2 of the custom query parser. It now supports date searches with sane syntax, folder searches (without any additions or changes to the database, unlike cworth's recent commit), and "tag:*" and "-tag:*" queries for finding tagged and untagged messages. I used these features to guid

[PATCH 2/8] Parse NEAR and ADJ operators.

2011-01-16 Thread Austin Clements
NEAR and ADJ are treated as n-ary operators where all operands must be terms, which fits with Xapian's own restrictions on near/adj queries. This implementation is slightly more lenient than Xapian's in that it allows phrases (both quoted and implicit) as operands and folds the phrase terms in as o

[PATCH 8/8] Support before: and after: date search with sane date syntax.

2011-01-16 Thread Austin Clements
Gmail-compatible date search operators, where the date must be specified as /mm/dd. This is just a start; it would be great to support fancier date syntax and, in particular, relative date specifications. --- lib/database.cc | 50 ++ 1 files c

[PATCH 7/8] Implement value range queries.

2011-01-16 Thread Austin Clements
Unlike in Xapian, there's no specific syntax that generates value ranges. Instead, it's up query transforms to generate them. --- lib/notmuch-private.h |8 lib/qparser.cc| 20 +--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/notmuch-p

[PATCH 6/8] Support maildir folder search.

2011-01-16 Thread Austin Clements
This implements a folder: query prefix by constructing a wildcard query that matches all files within the specified folder, folder/new, or folder/cur. This works with hierarchical folder names, and accepts both absolute and relative paths. --- lib/database.cc | 56 ++

[PATCH 5/8] Support "tag:*" as well as "NOT tag:*" queries.

2011-01-16 Thread Austin Clements
This extends the syntactic-to-database prefix query transform to optionally expand wildcards for boolean prefixes. Support of "NOT tag:*" queries to find all untagged messages falls out as a convenient side-effect. --- TODO |2 -- lib/database.cc |4 ++-- lib/notmuc

[PATCH 4/8] Replace Xapian query parser with custom query parser.

2011-01-16 Thread Austin Clements
Note that the type:mail filter is implemented as a transform pass, so it no longer has to be done everywhere queries are parsed. Furthermore, this filter now depends on the prefixing logic in the query parser instead of implementing this itself. Likewise, we don't need to special-case the queries

[PATCH 3/8] Parse wildcard queries.

2011-01-16 Thread Austin Clements
This implements support in the lexer and generator for wildcard terms, expanding them into synonym queries the way Xapian does. Since this expansion is performed by the generator, it's easy to take advantage of in query transforms. With this, * works anywhere in the query, so we'll no longer need

[PATCH 1/8] Implement a custom query parser with a mostly Xapian-compatible grammar.

2011-01-16 Thread Austin Clements
This parser takes an extra step through an intermediate representation that is convenient to manipulate via pluggable transformation passes. These are used to implement regular Xapian-style query prefixes, but are flexible enough to accomplish far more. --- lib/Makefile.local |1 + lib/dat

[RFC PATCH v2 0/8] Custom query parser, date search, folder search, and more

2011-01-16 Thread Austin Clements
This is version 2 of the custom query parser. It now supports date searches with sane syntax, folder searches (without any additions or changes to the database, unlike cworth's recent commit), and "tag:*" and "-tag:*" queries for finding tagged and untagged messages. I used these features to guid