From e6daadaa220a3dbb115fe6ffc5c692654f3e9e9f Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 23 Sep 2026 01:49:31 +0100 Subject: Allow specifying the default operator in queries. --- xapian/xapian.scm | 5 +++++ 1 file changed, 5 insertions(+) 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?) -- cgit 1.4.1