From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UKqmJ0T3A2HEgwEAgWs5BA (envelope-from ) for ; Fri, 30 Jul 2021 14:57:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KMhLI0T3A2FNawAAB5/wlQ (envelope-from ) for ; Fri, 30 Jul 2021 12:57:40 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2CE5C10E54 for ; Fri, 30 Jul 2021 14:57:40 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 52A7629222; Fri, 30 Jul 2021 08:56:50 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id E6B30291F4 for ; Fri, 30 Jul 2021 08:56:24 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id DDAFE5FD17; Fri, 30 Jul 2021 08:56:24 -0400 (EDT) Received: (nullmailer pid 2166879 invoked by uid 1000); Fri, 30 Jul 2021 12:56:10 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 07/27] lib: leave stemmer object accessible Date: Fri, 30 Jul 2021 09:55:47 -0300 Message-Id: <20210730125607.2165433-8-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210730125607.2165433-1-david@tethera.net> References: <20210730125607.2165433-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: DL27ZR2WAIZ2U2NMFX4EHKUT55NUHP5Q X-Message-ID-Hash: DL27ZR2WAIZ2U2NMFX4EHKUT55NUHP5Q X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627649860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=WjNL57U14D7Wi5cAuecbN25TVdaUoKugC3ZR+MAei90=; b=aepHTUtwsqQRvw5H68qMbJ2YLWtvk/RNQRgR9ZAeOg/ioakW5zQcgQ/nOAal/qCoU6NdX4 8Lk/kwxOADQCjPzr7lsI8YeM6scO+lBF+RI9XFKtyWdIpu+onggVpwQyLHV1Xm+xXOwsWC rirKr5xRvffRDmjUJCfwkXoxEIXDyj2Vg6s/VN9LPuoI4bLNmWmtWjiQxECCZd8os9r7FT ZHfRLrrd1RM2JLbjl1ACQvAJ6THHoUQGlMS0h9s/LsMgJotJ7fRuKZ1Bi+j8avXUMyj7N0 5ofF2vq1a9GCoRGZZhHU5QzaUCkB0JgPgPirGi4ZFlZIMsEcWR+/iTVW0H8JIg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627649860; a=rsa-sha256; cv=none; b=Qj23mzJeyXtHZd4Btq2mEfW25yKSAlpKhMww+3Xp7l0v+8WY+Ma68XCXJL9efZg/LT2oX7 VMWCPDH0RAwKiiiXXjpmyAg41DFQXNZJ81vep+cJj9m8SdPlZ554tjosM7oj9503SEkjZ/ t2RLSYvNot3xInA4EjE7QELv0YG7GxllerUbqTrqdGOyV/QPeNqspHRIo7y7rAJH03gkNX ABMiSMg/EVF5gI/lSv9Y/u95Yi38iydNS3dLUAvs3Z2mq2kd1C9gnMcvqCJuiLeWGQ44sY DLPsn6Obqntkgs0D2hTCY+JkfX95C6BoXbD3vKL/y0FQZHZU+lsQNU3/enlI1w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 0.49 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 2CE5C10E54 X-Spam-Score: 0.49 X-Migadu-Scanner: scn0.migadu.com X-TUID: hlL5yDe0NeSc This enables using the same stemmer in both query parsers. --- lib/database-private.h | 1 + lib/open.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/database-private.h b/lib/database-private.h index f206efaf..85d55299 100644 --- a/lib/database-private.h +++ b/lib/database-private.h @@ -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; diff --git a/lib/open.cc b/lib/open.cc index 7b95c5b1..21ab3984 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -428,7 +428,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); -- 2.30.2