aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xapian/xapian.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/xapian/xapian.scm b/xapian/xapian.scm
index 2ddc8b4..577791b 100644
--- a/xapian/xapian.scm
+++ b/xapian/xapian.scm
@@ -32,6 +32,7 @@
replace-document!
make-document
document-data
+ document-ref
make-stem
make-term-generator
index-text!
@@ -64,7 +65,7 @@
(define add-document! WritableDatabase-add-document)
(define replace-document! WritableDatabase-replace-document)
-(define* (make-document #:key data (terms '()))
+(define* (make-document #:key data (terms '()) (values '()))
(let ((doc (new-Document)))
(when data
(Document-set-data doc data))
@@ -72,9 +73,14 @@
((term . wdf-increment)
(Document-add-term doc term wdf-increment)))
terms)
+ (for-each (match-lambda
+ ((slot . value)
+ (Document-add-value doc slot value)))
+ values)
doc))
(define document-data Document-get-data)
+(define document-ref Document-get-value)
(define make-stem new-Stem)