From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 28 03:04:49 2020 Received: (at 39258) by debbugs.gnu.org; 28 Feb 2020 08:04:49 +0000 Received: from localhost ([127.0.0.1]:60596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j7add-0005Vd-Fx for submit@debbugs.gnu.org; Fri, 28 Feb 2020 03:04:49 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:41951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j7adb-0005VO-LG for 39258@debbugs.gnu.org; Fri, 28 Feb 2020 03:04:48 -0500 X-Originating-IP: 92.169.129.147 Received: from bababa (lfbn-idf2-1-1315-147.w92-169.abo.wanadoo.fr [92.169.129.147]) (Authenticated sender: mail@ambrevar.xyz) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 92A9A20007; Fri, 28 Feb 2020 08:04:40 +0000 (UTC) From: Pierre Neidhardt To: Arun Isaac Subject: Re: [bug#39258] [PATCH 3/4] gnu: Generate xapian package search index. References: <20200227204150.30985-1-arunisaac@systemreboot.net> <20200227204150.30985-4-arunisaac@systemreboot.net> Date: Fri, 28 Feb 2020 09:04:39 +0100 In-Reply-To: <20200227204150.30985-4-arunisaac@systemreboot.net> (Arun Isaac's message of "Fri, 28 Feb 2020 02:11:49 +0530") Message-ID: <87k1475e94.fsf@ambrevar.xyz> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Arun Isaac writes: > +(define (generate-package-search-index directory) > + "Generate under DIRECTORY a xapian index of all the available packages." > + (define db-path > + (string-append directory %package-search-index [...] Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: systemreboot.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.200 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.70.183.200 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: 39258 Cc: ludo@gnu.org, 39258@debbugs.gnu.org, zimon.toutoune@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Arun Isaac writes: > +(define (generate-package-search-index directory) > + "Generate under DIRECTORY a xapian index of all the available packages." > + (define db-path > + (string-append directory %package-search-index [...] Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: systemreboot.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.200 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.70.183.200 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Arun Isaac writes: > +(define (generate-package-search-index directory) > + "Generate under DIRECTORY a xapian index of all the available packages= ." > + (define db-path > + (string-append directory %package-search-index)) > + > + (mkdir-p (dirname db-path)) > + (call-with-writable-database db-path > + (lambda (db) > + (fold-packages (lambda (package _) > + (let* ((idterm (string-append "Q" (package-name p= ackage))) > + (doc (make-document #:data (package-name p= ackage) > + #:terms `((,idterm . 0= )))) > + (term-generator (make-term-generator #:ste= m (make-stem "en") > + #:doc= ument doc))) > + (index-text! term-generator (package-descriptio= n package)) > + (replace-document! db idterm doc))) I guess these non-functional functions (index-text!, replace-document!) represent how Xapian works at the C++ level. Would it be possible to make more functional bindings nonetheless? =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl5YyZcACgkQm9z0l6S7 zH9EkAf/eCddrqNRJXNrLpUYJ2kOAuqshemvMAF4v0WSF3enTf7Y59qDF56FS9V7 SsvxrUL9CF1LzJAquLLSNUnTEDLcmLb1p6O/ksSq0ZMQ9Yr4MGBeLJU36m1+WGv3 n+03tUCFvSLDupAlyBxNxCX4QBmzGd79shu3X5NZLVp06G842chKFB6GXlQyFRhh iJLDq1kynhsW6eZIPONvHqQxTzEfb8Wh5wbNbzPvvN8fIWKPoBpP5yxXHLDGC2vM VcodopQOoXebt1XAh4WIz4Tr3KaF3/B5m9OunrdLmLj3ETZQwTbifkObhnPG7tOp NI1rOx5CP47ckZtbdK9HnfvSkvO0Tw== =UV3T -----END PGP SIGNATURE----- --=-=-=--