From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 05 15:26:51 2020 Received: (at 39258) by debbugs.gnu.org; 5 Mar 2020 20:26:51 +0000 Received: from localhost ([127.0.0.1]:43764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9x50-000678-PI for submit@debbugs.gnu.org; Thu, 05 Mar 2020 15:26:50 -0500 Received: from mugam.systemreboot.net ([139.59.75.54]:44490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9x4y-00066x-3c for 39258@debbugs.gnu.org; Thu, 05 Mar 2020 15:26:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding: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=1iuD6K3+/mbiu4rwopVYkvihyTg9FrMylaJlzoXvCA0=; b=PxtYjdEk27Xh56NPRjD/OTH9u IWQR/0vZb+bdCqyV3zx2lBHLQDM/jprixIAdm5AOvs1a+rwuO296BOZr8WGAIthLPSnOL4ltx+zh+ GxXN7zWxiCDoGrRqK4kpbK4nUS7OBeAVSMdc7RKsXAEWxAxw3YOi0KelBQDJkqHvy7aRk=; Received: from [192.168.2.1] (helo=steel) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1j9x4m-002RRd-2P; Fri, 06 Mar 2020 01:56:36 +0530 From: Arun Isaac To: Pierre Neidhardt Subject: Re: [bug#39258] [PATCH 3/4] gnu: Generate xapian package search index. 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" X-Spam-Score: 0.0 (/) 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.0 (-) --=-=-= 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----- --=-=-=--