aboutsummaryrefslogtreecommitdiff
path: root/xapian
diff options
context:
space:
mode:
authorArun Isaac2024-05-07 23:13:41 +0100
committerArun Isaac2024-05-07 23:13:41 +0100
commit99cc1a52fd7f5efdede86e3d5f2df5c7ec57a0d5 (patch)
tree1b20517b5428468730ed61409d1da8c12e209f93 /xapian
parent921ae11562125cd1ea83e45f4c9a0f0b29bf01f7 (diff)
downloadguile-xapian-99cc1a52fd7f5efdede86e3d5f2df5c7ec57a0d5.tar.gz
guile-xapian-99cc1a52fd7f5efdede86e3d5f2df5c7ec57a0d5.tar.lz
guile-xapian-99cc1a52fd7f5efdede86e3d5f2df5c7ec57a0d5.zip
xapian: Accept boolean prefixes in parse-query.
* xapian/xapian.scm (parse-query): Accept boolean prefixes.
Diffstat (limited to 'xapian')
-rw-r--r--xapian/xapian.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/xapian/xapian.scm b/xapian/xapian.scm
index 7222e69..6ab879c 100644
--- a/xapian/xapian.scm
+++ b/xapian/xapian.scm
@@ -166,7 +166,7 @@ generated."
(define increase-termpos! TermGenerator-increase-termpos)
-(define* (parse-query querystring #:key stemmer stemming-strategy (prefixes '()) (range-processors '()))
+(define* (parse-query querystring #:key stemmer stemming-strategy (prefixes '()) (boolean-prefixes '()) (range-processors '()))
(let ((queryparser (new-QueryParser)))
(QueryParser-set-stemmer queryparser stemmer)
(when stemming-strategy
@@ -175,6 +175,10 @@ generated."
((field . prefix)
(QueryParser-add-prefix queryparser field prefix)))
prefixes)
+ (for-each (match-lambda
+ ((field . prefix)
+ (QueryParser-add-boolean-prefix queryparser field prefix)))
+ boolean-prefixes)
(for-each (cut QueryParser-add-rangeprocessor queryparser <>)
range-processors)
(let ((query (QueryParser-parse-query queryparser querystring)))