]> git.notmuchmail.org Git - notmuch/blobdiff - lib/database.cc
search : Extend "intial burst" optimization to return all results by chunks
[notmuch] / lib / database.cc
index 2c90019cbee8922bfe9c88541a8aae809c2d6a0f..3fe12dd50ee65af6d709edc511229a5e9f047e8f 100644 (file)
@@ -501,11 +501,13 @@ notmuch_database_open (const char *path,
        notmuch->query_parser = new Xapian::QueryParser;
        notmuch->term_gen = new Xapian::TermGenerator;
        notmuch->term_gen->set_stemmer (Xapian::Stem ("english"));
+       notmuch->value_range_processor = new Xapian::NumberValueRangeProcessor (NOTMUCH_VALUE_TIMESTAMP);
 
        notmuch->query_parser->set_default_op (Xapian::Query::OP_AND);
        notmuch->query_parser->set_database (*notmuch->xapian_db);
        notmuch->query_parser->set_stemmer (Xapian::Stem ("english"));
        notmuch->query_parser->set_stemming_strategy (Xapian::QueryParser::STEM_SOME);
+       notmuch->query_parser->add_valuerangeprocessor (notmuch->value_range_processor);
 
        for (i = 0; i < ARRAY_SIZE (BOOLEAN_PREFIX_EXTERNAL); i++) {
            prefix_t *prefix = &BOOLEAN_PREFIX_EXTERNAL[i];
@@ -548,6 +550,7 @@ notmuch_database_close (notmuch_database_t *notmuch)
     delete notmuch->term_gen;
     delete notmuch->query_parser;
     delete notmuch->xapian_db;
+    delete notmuch->value_range_processor;
     talloc_free (notmuch);
 }