]> git.cworth.org Git - notmuch/commitdiff
lib: leave stemmer object accessible
authorDavid Bremner <david@tethera.net>
Tue, 24 Aug 2021 15:17:17 +0000 (08:17 -0700)
committerDavid Bremner <david@tethera.net>
Sun, 5 Sep 2021 00:07:19 +0000 (17:07 -0700)
This enables using the same stemmer in both query parsers.

lib/database-private.h
lib/open.cc

index f206efaf30bf072b60791b7bdc5c10af18452f26..85d552999fdedc7ed903a3064544f87e51014ab8 100644 (file)
@@ -232,6 +232,7 @@ struct _notmuch_database {
      */
     unsigned long view;
     Xapian::QueryParser *query_parser;
+    Xapian::Stem *stemmer;
     Xapian::TermGenerator *term_gen;
     Xapian::RangeProcessor *value_range_processor;
     Xapian::RangeProcessor *date_range_processor;
index 280ffee343f91e893a2743683290ea4b41c034ac..8a835e986d5dd78661eba0a53e793b288550b083 100644 (file)
@@ -432,7 +432,8 @@ _finish_open (notmuch_database_t *notmuch,
                                                                              "lastmod:");
        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->stemmer = new Xapian::Stem ("english");
+       notmuch->query_parser->set_stemmer (*notmuch->stemmer);
        notmuch->query_parser->set_stemming_strategy (Xapian::QueryParser::STEM_SOME);
        notmuch->query_parser->add_rangeprocessor (notmuch->value_range_processor);
        notmuch->query_parser->add_rangeprocessor (notmuch->date_range_processor);