diff options
-rw-r--r-- | xapian/xapian.scm | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/xapian/xapian.scm b/xapian/xapian.scm index 6ab879c..d219c30 100644 --- a/xapian/xapian.scm +++ b/xapian/xapian.scm @@ -166,7 +166,18 @@ generated." (define increase-termpos! TermGenerator-increase-termpos) -(define* (parse-query querystring #:key stemmer stemming-strategy (prefixes '()) (boolean-prefixes '()) (range-processors '())) +(define* (parse-query querystring + #:key + stemmer + stemming-strategy + (prefixes '()) + (boolean-prefixes '()) + (range-processors '()) + (boolean? #t) + (phrases? #t) + (love-hate? #t) + any-case-boolean? + wildcard?) (let ((queryparser (new-QueryParser))) (QueryParser-set-stemmer queryparser stemmer) (when stemming-strategy @@ -181,7 +192,13 @@ generated." boolean-prefixes) (for-each (cut QueryParser-add-rangeprocessor queryparser <>) range-processors) - (let ((query (QueryParser-parse-query queryparser querystring))) + (let ((query (QueryParser-parse-query queryparser + querystring + (bitwise-ior (get-flag QueryParser-FLAG-BOOLEAN boolean?) + (get-flag QueryParser-FLAG-PHRASE phrases?) + (get-flag QueryParser-FLAG-LOVEHATE love-hate?) + (get-flag QueryParser-FLAG-BOOLEAN-ANY-CASE any-case-boolean?) + (get-flag QueryParser-FLAG-WILDCARD wildcard?))))) (delete-QueryParser queryparser) query))) |