From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:43482) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9x5C-00070S-P7 for guix-patches@gnu.org; Thu, 05 Mar 2020 15:27:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9x5B-0004GI-Qg for guix-patches@gnu.org; Thu, 05 Mar 2020 15:27:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37791) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j9x5B-0004Fy-Nk for guix-patches@gnu.org; Thu, 05 Mar 2020 15:27:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j9x5B-00067W-K8 for guix-patches@gnu.org; Thu, 05 Mar 2020 15:27:01 -0500 Subject: [bug#39258] [PATCH 3/4] gnu: Generate xapian package search index. Resent-Message-ID: From: Arun Isaac In-Reply-To: <87k1475e94.fsf@ambrevar.xyz> References: <20200227204150.30985-1-arunisaac@systemreboot.net> <20200227204150.30985-4-arunisaac@systemreboot.net> <87k1475e94.fsf@ambrevar.xyz> Date: Fri, 06 Mar 2020 01:56:22 +0530 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Pierre Neidhardt Cc: ludo@gnu.org, 39258@debbugs.gnu.org, zimon.toutoune@gmail.com --=-=-= Content-Type: text/plain >> + (fold-packages (lambda (package _) >> + (let* ((idterm (string-append "Q" (package-name package))) >> + (doc (make-document #:data (package-name package) >> + #:terms `((,idterm . 0)))) >> + (term-generator (make-term-generator #:stem (make-stem "en") >> + #:document doc))) >> + (index-text! term-generator (package-description 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? I somehow overlooked this particular email and am reading it just now. Yes, the non-functional bindings are a bit ugly. But, I'm not able to think of a clean way to make functional bindings without supporting all features offered by xapian. Any suggestions you have in this regard would be useful. Look through xapian/termgenerator.h for more details. In particular, look at functions increase_termpos, index_text_without_positions. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAl5hYG8ACgkQLiXui2GA K7PkRwf+NvdP6lMsIbZH4CZRl0J/rfHZv4wQD6P4VA+JejO0wuiT9L7lYezPz06U VdRGo6pt/GGt/XIA0qKA3+HumBtaWJ5YLCRFbgJKa/iqHaMUEfl1LU/rWo4peUDk DRrSP4tGFhYJtxGiHuPU/ia7KyWaCzoERhFRfQgKUM69/WSkpxKjQpo6tzciBBuv LVvRTcy0CcPyUww210W2qwL50fzQ27dgbFaX4WXLHmzpQGPDMXbmRQCXPsbCsTFX iLPJzdPHiu1BCl15nevLCcfVCdmHKelyIU23LmhD8LtrtuLnIaYlb4UE4fMPlE9U 5wubfuszWe90QibFjZmjuKHZRoLTeA== =WJVN -----END PGP SIGNATURE----- --=-=-=--