From fd596deb7137afe0f08bc3d990ca3470fc23c15b Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 21 Sep 2026 14:58:08 +0100 Subject: Add query-xor. --- xapian/xapian.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'xapian/xapian.scm') diff --git a/xapian/xapian.scm b/xapian/xapian.scm index c769a98..e83fae0 100644 --- a/xapian/xapian.scm +++ b/xapian/xapian.scm @@ -1,5 +1,5 @@ ;;; guile-xapian --- Guile bindings for Xapian -;;; Copyright © 2020, 2022, 2024, 2025 Arun Isaac +;;; Copyright © 2020, 2022, 2024–2026 Arun Isaac ;;; Copyright © 2021 Bob131 ;;; ;;; This file is part of guile-xapian. @@ -55,6 +55,7 @@ query query-and query-or + query-xor query-filter prefixed-range-processor suffixed-range-processor @@ -308,6 +309,14 @@ In a weighted context, the weight is the sum of the weights for matching queries." (apply query-combine (Query-OP-OR) (Query-MatchNothing) queries)) +(define (query-xor . queries) + "Return a query matching documents which an odd number of @var{queries} +match. + +In a weighted context, the weight is the sum of the weights for +matching queries." + (apply query-combine (Query-OP-XOR) (Query-MatchNothing) queries)) + (define (query-filter . queries) "Return a query matching only documents matching all @var{queries}, but only take weight from the first of @var{queries}. -- cgit 1.4.1