summaryrefslogtreecommitdiff
path: root/xapian
diff options
context:
space:
mode:
Diffstat (limited to 'xapian')
-rw-r--r--xapian/xapian.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/xapian/xapian.scm b/xapian/xapian.scm
index 92bf5d3..112e6c5 100644
--- a/xapian/xapian.scm
+++ b/xapian/xapian.scm
@@ -19,6 +19,7 @@
(define-module (xapian xapian)
#:use-module (rnrs arithmetic bitwise)
+ #:use-module (rnrs bytevectors)
#:use-module (ice-9 match)
#:use-module (srfi srfi-26)
#:use-module (xapian wrap)
@@ -33,6 +34,7 @@
replace-document!
make-document
document-data
+ document-bytes
document-slot-ref
make-stem
make-term-generator
@@ -84,6 +86,11 @@
(define document-data Document-get-data)
(define document-slot-ref Document-get-value)
+(define (document-bytes document)
+ "Return the data of DOCUMENT as a bytevector."
+ (u8-list->bytevector
+ (map char->integer (string->list (document-data document)))))
+
(define make-stem new-Stem)
(define* (make-term-generator #:key stem document)