From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GHumB5QOJWGP4wAAgWs5BA (envelope-from ) for ; Tue, 24 Aug 2021 17:21:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id ENA6A5QOJWFgZQAAbx9fmQ (envelope-from ) for ; Tue, 24 Aug 2021 15:21:56 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C8F3F84D2 for ; Tue, 24 Aug 2021 17:21:55 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 4FD2D20576; Tue, 24 Aug 2021 11:20:56 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id E685420563 for ; Tue, 24 Aug 2021 11:20:47 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id E05E95FD5C; Tue, 24 Aug 2021 11:20:47 -0400 (EDT) Received: (nullmailer pid 2942843 invoked by uid 1000); Tue, 24 Aug 2021 15:17:51 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 08/36] lib: leave stemmer object accessible Date: Tue, 24 Aug 2021 08:17:17 -0700 Message-Id: <20210824151745.2941868-9-david@tethera.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210824151745.2941868-1-david@tethera.net> References: <20210824151745.2941868-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: TX32XZPL57LCSLWUHKEOW33IBE4KQXI4 X-Message-ID-Hash: TX32XZPL57LCSLWUHKEOW33IBE4KQXI4 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=1629818515; 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=dN1pDytNwUXhpN8MVektsCcAIkESDARvFQ0Ptb+G/EE=; b=g3f4AUEaVbS/NBkeEIqdrJ11FiC6SIHskOUKKaZhG66Vvsf0W8X6t1yCPGAUZ0L4MwxIM4 RUBUXAb+TZRZ3NVffG0zFyvfBRqV+sD8RUSdDnftio8cxhzXf36S7uLieu883HKx+JSqaW aR9hAiRGzWO1j/dhtl92o2dhEYO83Tjg52dQefYpIUyfC3IVlMGfSCPYAuEWcyFVdraCcM gtInSY0MUoyGnE70LGYRu9Vb8j1SgqqMWhruynEPWBAaTI37N3zRDtNYnXUPYkUIPE8Usn xKHasmwlUjwLJSRnQ282U+1J7f+GEN+B/g/BxRZxDyJXER4DRAGBnFb86+bnhg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629818515; a=rsa-sha256; cv=none; b=LIOsfiCROqWYHlCNK4XF3wv+DzFX0gjepyxX389V8Q+6ltPK4/cduruX2uahFKxb63BjyU jlbLJ89cSjjmF73ID1s4A5TWcd/B9Or0KnD1hpPYM8CAgDRmN2CsCorndKoBTlOS4NsQjq nggHSmsis/W1L8XspHhAZtP2LC4sGyHbFDeAgb0h7cPqFOQLkGcVBY+oe4h6blB6doanLr ciQ1zmCqnA53tPbE+p3JRhp8SpiVwWjpW63sd5cYPdokfmV/XFhGR72CQTd9af09sGqr1t j9ooV5avc+Cu0iNRq608YA2oij7qiaRKJtO5/6LmL4gqY4ou+VbWoOobmWB5Gw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.93 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: C8F3F84D2 X-Spam-Score: -0.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: QTUMcqlAzKhL 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 280ffee3..8a835e98 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -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); -- 2.32.0