From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kI1jH7f3rWPHIAAAbAwnHQ (envelope-from ) for ; Thu, 29 Dec 2022 21:25:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QCs+H7f3rWOebgEAauVa8A (envelope-from ) for ; Thu, 29 Dec 2022 21:25:27 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 337152208 for ; Thu, 29 Dec 2022 21:25:27 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAzSb-00073n-Gd; Thu, 29 Dec 2022 15:25:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAzSY-00072k-OQ for guix-patches@gnu.org; Thu, 29 Dec 2022 15:25:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pAzSY-0005Xa-2A for guix-patches@gnu.org; Thu, 29 Dec 2022 15:25:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pAzSX-0007RW-Px for guix-patches@gnu.org; Thu, 29 Dec 2022 15:25:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60410] [PATCH 1/7] xapian: Index several terms as boolean and without positions. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 29 Dec 2022 20:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60410 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60410@debbugs.gnu.org, Ricardo Wurmus Cc: Arun Isaac Received: via spool by 60410-submit@debbugs.gnu.org id=B60410.167234545128480 (code B ref 60410); Thu, 29 Dec 2022 20:25:01 +0000 Received: (at 60410) by debbugs.gnu.org; 29 Dec 2022 20:24:11 +0000 Received: from localhost ([127.0.0.1]:32992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAzRj-0007PD-07 for submit@debbugs.gnu.org; Thu, 29 Dec 2022 15:24:11 -0500 Received: from mugam.systemreboot.net ([139.59.75.54]:60006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAzRg-0007Ow-Mi for 60410@debbugs.gnu.org; Thu, 29 Dec 2022 15:24:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4GDGv4cJX+1jwLS5McnWkpeTHuqoEbm7+URNJUAiogo=; b=euRJmt7pUrHEPyzY1yvNBqnmbo OsPbc0jKSh6oduDO35ZpeYkpAcqMlHvvFLihg88+AISiQuHd09hzCToiKDHEgRbTXDCKC0TKGj4Lw 7T4vKCELxH+JVzcKKr5VXOC+HOFw1+W8ahpnFQrjJzvT+ZiLssn3uBCwmZ56tILGVVk9FKWrd3hdp GMCGmY2EeU1QDGxmfo2HbL8whqZ972DrRJzH7l/tXNm+E/Gg5TQ27gZmObAA7rPhIwAZec0ttorf6 2zvCGmmC1N53KZg7E9Di1xR7Mj36GwsAK7PzQI5TxnKTh65LmTGApzjM8s/hLz9Zc3namy+BDRlLj cLO6Ud2A==; Received: from [192.168.2.1] (port=38338 helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1pAzRd-000oIe-0X; Fri, 30 Dec 2022 01:54:05 +0530 From: Arun Isaac Date: Thu, 29 Dec 2022 20:23:54 +0000 Message-Id: <20221229202400.28565-1-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221229201809.27997-1-arunisaac@systemreboot.net> References: <20221229201809.27997-1-arunisaac@systemreboot.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672345527; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4GDGv4cJX+1jwLS5McnWkpeTHuqoEbm7+URNJUAiogo=; b=du7ibkI/4+CgBv080deN4wjMCAdyCOvl0xz9+kOjuoETHK9VgWAf+6DRG90LwnEXTNaclk dKkwXr0322s4kHpSavVB9k0HZDGMLOIWpa8Bom7ZmAEBhqMoif7MaX1tcrGTSyI0CmWIEz YPhgCsbWZVgKoVDX5SSOnw0RUE2+Tekz+SCIlSxD0ZeHbAGlW4gXbAlKlTIrJXkpTZh+BC RTjN07sUUwkl+hPi8l9VzIqfDgAXTYYEL5cMS0pEOFIbDX6ZI6w8XACNeyh7HsekbdMKo8 eJkcW8rO7xBLH3AGz5z+qAghcmioY2F3WdAau9jKkqXQ6U8tzNM1VOpmKmBgyQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=systemreboot.net header.s=default header.b=euRJmt7p; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=systemreboot.net (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672345527; a=rsa-sha256; cv=none; b=M58r0iJ2IXOoVilSsxm8oEsD2hOeR7ryrxR8d8sAhnKsHnaL9ZeZFGJk5UrqchCgweSLDL jeuHOQC+DI+aIF3KQVEv0WWbDL0zEHx20qo4g9N7UQG1aaZUiC+KgTysp5VF+4wDHN/B8L BPwlWdAUswwFjtaHjJn6l7rjoXr31+5cVhvDxg/eznYTXduq8JecyX8Wyi9OSNjXmYwZsu pkpw0oYy8DuVGGx6Z08khhL2E2DmrQNypF3t9Hj1dobGKaZtpYHYIt75+Om+eKOUmX5QHT 5YMI3kOI6lZjBMOUd4Oy3CGtJT3qGrtVRBjvNY7vZsvV+C8e3oQzGC1P111Aaw== X-Spam: Yes X-Migadu-Queue-Id: 337152208 X-Migadu-Spam: Yes X-Spam-Score: 8.47 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=systemreboot.net header.s=default header.b=euRJmt7p; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=systemreboot.net (policy=none) X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: 8.47 X-TUID: rliU06WrT0GM * mumi/xapian.scm (index-files): Index bug number, submitter, authors, owner, severity, tags, status, file and msgids as boolean terms. Index bug number, severity, tags, status, file and msgids without position information. --- mumi/xapian.scm | 65 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 14 deletions(-) diff --git a/mumi/xapian.scm b/mumi/xapian.scm index 68169e8..06a54cd 100644 --- a/mumi/xapian.scm +++ b/mumi/xapian.scm @@ -1,6 +1,6 @@ ;;; mumi -- Mediocre, uh, mail interface ;;; Copyright © 2020, 2022 Ricardo Wurmus -;;; Copyright © 2020 Arun Isaac +;;; Copyright © 2020, 2022 Arun Isaac ;;; ;;; This program is free software: you can redistribute it and/or ;;; modify it under the terms of the GNU Affero General Public License @@ -119,20 +119,57 @@ messages and index their contents in the Xapian database at DBPATH." (term-generator (make-term-generator #:stem (make-stem "en") #:document doc))) ;; Index fields with a suitable prefix. This allows for - ;; searching separate fields as in subject:foo, - ;; from:bar, etc. - (index-text! term-generator bugid #:prefix "B") - (index-text! term-generator submitter #:prefix "A") - (index-text! term-generator authors #:prefix "XA") + ;; searching separate fields as in subject:foo, from:bar, + ;; etc. We do not keep track of the within document + ;; frequencies of terms that will be used for boolean + ;; filtering. We do not generate position information for + ;; fields that will not need phrase searching or NEAR + ;; searches. + (index-text! term-generator + bugid + #:prefix "B" + #:wdf-increment 0 + #:positions? #f) + (index-text! term-generator + submitter + #:prefix "A" + #:wdf-increment 0) + (index-text! term-generator + authors + #:prefix "XA" + #:wdf-increment 0) (index-text! term-generator subjects #:prefix "S") - (index-text! term-generator (or (bug-owner bug) "") #:prefix "XO") - (index-text! term-generator (or (bug-severity bug) "normal") #:prefix "XS") - (index-text! term-generator (or (bug-tags bug) "") #:prefix "XT") - (index-text! term-generator (cond - ((bug-done bug) "done") - (else "open")) #:prefix "XSTATUS") - (index-text! term-generator file #:prefix "F") - (index-text! term-generator msgids #:prefix "XU") + (index-text! term-generator + (or (bug-owner bug) "") + #:prefix "XO" + #:wdf-increment 0) + (index-text! term-generator + (or (bug-severity bug) "normal") + #:prefix "XS" + #:wdf-increment 0 + #:positions? #f) + (index-text! term-generator + (or (bug-tags bug) "") + #:prefix "XT" + #:wdf-increment 0 + #:positions? #f) + (index-text! term-generator + (cond + ((bug-done bug) "done") + (else "open")) + #:prefix "XSTATUS" + #:wdf-increment 0 + #:positions? #f) + (index-text! term-generator + file + #:prefix "F" + #:wdf-increment 0 + #:positions? #f) + (index-text! term-generator + msgids + #:prefix "XU" + #:wdf-increment 0 + #:positions? #f) ;; Index subject and body without prefixes for general ;; search. -- 2.38.1