From d9bd3869d61a9013685d9e6b82d3f2a617483bb4 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 18 Oct 2022 01:59:06 +0530 Subject: xapian: Allow indexing text without position information. * xapian/xapian.scm (index-text!): Add positions? argument. --- xapian/xapian.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'xapian') diff --git a/xapian/xapian.scm b/xapian/xapian.scm index 0da12a5..f8ba284 100644 --- a/xapian/xapian.scm +++ b/xapian/xapian.scm @@ -148,11 +148,15 @@ bytevector." (TermGenerator-set-document term-generator document) term-generator)) -(define* (index-text! term-generator text #:key (wdf-increment 1) (prefix "")) +(define* (index-text! term-generator text #:key (wdf-increment 1) (prefix "") (positions? #t)) "Index @var{text} using @var{term-generator}. @var{wdf-increment} is the within document frequency increment. @var{prefix} is the term -prefix to use." - (TermGenerator-index-text term-generator text wdf-increment prefix)) +prefix to use. If @var{positions?} is #f, position information is not +generated." + ((if positions? + TermGenerator-index-text + TermGenerator-index-text-without-positions) + term-generator text wdf-increment prefix)) (define increase-termpos! TermGenerator-increase-termpos) -- cgit v1.2.3