X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdatabase.cc;h=96300008765e445f146ec2b3ce93b03df792b1cf;hp=c8c5e26106ad9d1086eb92ee0998d30a312dca99;hb=b9bf3f44eacd42ce53885c79f9dad8d82c76f13d;hpb=54aeab1962d77455a65d0d4338beaabbb936310f diff --git a/lib/database.cc b/lib/database.cc index c8c5e261..96300008 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -20,6 +20,7 @@ #include "database-private.h" #include "parse-time-vrp.h" +#include "query-fp.h" #include "string-util.h" #include @@ -1000,6 +1001,14 @@ notmuch_database_open_verbose (const char *path, notmuch->term_gen->set_stemmer (Xapian::Stem ("english")); notmuch->value_range_processor = new Xapian::NumberValueRangeProcessor (NOTMUCH_VALUE_TIMESTAMP); notmuch->date_range_processor = new ParseTimeValueRangeProcessor (NOTMUCH_VALUE_TIMESTAMP); +#if HAVE_XAPIAN_FIELD_PROCESSOR + /* This currently relies on the query parser to pass anything + * with a .. to the range processor */ + notmuch->date_field_processor = new DateFieldProcessor(); + notmuch->query_parser->add_boolean_prefix("date", notmuch->date_field_processor); + notmuch->query_field_processor = new QueryFieldProcessor (*notmuch->query_parser, notmuch); + notmuch->query_parser->add_boolean_prefix("query", notmuch->query_field_processor); +#endif notmuch->last_mod_range_processor = new Xapian::NumberValueRangeProcessor (NOTMUCH_VALUE_LAST_MOD, "lastmod:"); notmuch->query_parser->set_default_op (Xapian::Query::OP_AND);