From 693d4c492c760794df7186058f95e12f91cfc2be Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 9 Jul 2022 15:45:59 +0530 Subject: bin: Move indexing document type into document-term-generator. * bin/tissue (index): Move indexing document type into document-term-generator generic function. * tissue/document.scm (document-term-generator): Index document type. --- bin/tissue | 8 +++----- tissue/document.scm | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/tissue b/bin/tissue index f457806..fcb704f 100755 --- a/bin/tissue +++ b/bin/tissue @@ -307,11 +307,9 @@ To get usage information for one of these sub-commands, run (call-with-writable-database db-path (lambda (db) (for-each (lambda (document) - (let ((term-generator (document-term-generator document))) - (index-text! term-generator (document-type document) #:prefix "XT") - (replace-document! db - (document-id-term document) - (TermGenerator-get-document term-generator)))) + (replace-document! db + (document-id-term document) + (TermGenerator-get-document (document-term-generator document)))) (tissue-configuration-indexed-documents (load-config))) (WritableDatabase-set-metadata db "commit" (oid->string (reference-name->oid diff --git a/tissue/document.scm b/tissue/document.scm index e40c80e..ed69254 100644 --- a/tissue/document.scm +++ b/tissue/document.scm @@ -153,6 +153,7 @@ and further text, increase-termpos! must be called before indexing." #:data (call-with-output-string (cut write (object->scm document) <>)) #:terms `((,(document-id-term document) . 0)))))) + (index-text! term-generator (document-type document) #:prefix "XT") (index-text! term-generator (document-title document) #:prefix "S") (index-text! term-generator (document-text document)) term-generator)) -- cgit v1.2.3