about summary refs log tree commit diff
path: root/xapian/xapian.scm
diff options
context:
space:
mode:
authorArun Isaac2026-09-23 01:49:31 +0100
committerArun Isaac2026-09-23 02:00:52 +0100
commite6daadaa220a3dbb115fe6ffc5c692654f3e9e9f (patch)
tree42e328dcbcdd1af7afcbab3d5d2882aa28066a30 /xapian/xapian.scm
parent502566073c07eac6a91131847691cc0dbc093b18 (diff)
downloadguile-xapian-e6daadaa220a3dbb115fe6ffc5c692654f3e9e9f.tar.gz
guile-xapian-e6daadaa220a3dbb115fe6ffc5c692654f3e9e9f.tar.lz
guile-xapian-e6daadaa220a3dbb115fe6ffc5c692654f3e9e9f.zip
Allow specifying the default operator in queries.
Diffstat (limited to 'xapian/xapian.scm')
-rw-r--r--xapian/xapian.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/xapian/xapian.scm b/xapian/xapian.scm
index 00a4896..09554e7 100644
--- a/xapian/xapian.scm
+++ b/xapian/xapian.scm
@@ -191,6 +191,7 @@ generated."
                       (prefixes '())
                       (boolean-prefixes '())
                       (range-processors '())
+                      (default-operator (Query-OP-OR))
                       (boolean? #t)
                       (phrases? #t)
                       (love-hate? #t)
@@ -205,6 +206,9 @@ mapping fields to prefixes or @code{FieldProcessor}
 objects. @var{range-processors} is a list of @code{RangeProcessor}
 objects.
 
+Use @code{default-operator} to combine non-filter query items when no
+explicit operator is used.
+
 When @var{boolean?} is @code{#t}, boolean operators (AND, OR, etc.)
 and bracketed subexpressions are supported.
 
@@ -236,6 +240,7 @@ When @var{partial?} is @code{#t}, enable partial matching."
               boolean-prefixes)
     (for-each (cut QueryParser-add-rangeprocessor queryparser <>)
               range-processors)
+    (QueryParser-set-default-op queryparser default-operator)
     (let ((query (QueryParser-parse-query queryparser
                                           querystring
                                           (bitwise-ior (get-flag QueryParser-FLAG-BOOLEAN boolean?)