From f82c115b0e1a4cc30c2ee7c0a969402b7fd3eebf Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 30 Mar 2023 09:16:23 +0300 Subject: Gotchas: Pure `NOT` queries not supported Add a section in the documentations about things that are not entirely obvious to the user when doing search. --- topics/xapian-search-queries.gmi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'topics') diff --git a/topics/xapian-search-queries.gmi b/topics/xapian-search-queries.gmi index 0364344..74966f7 100644 --- a/topics/xapian-search-queries.gmi +++ b/topics/xapian-search-queries.gmi @@ -90,3 +90,25 @@ Alternatively, this same query may be expressed using kilo or mega suffixes. Hs:chr4:9130k..9980k species:mouse Hs:chr4:9.13M..9.98M species:mouse ``` + +## Gotchas + +### Pure `NOT` queries are not supported + +Due to +=> https://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html#ae96a58a8de9d219ca3214a5a66e0407eacafc7c8cf7c90adac0fc07d02125aed0 performance reasons, +pure `NOT` queries are not supported. + +A search such as: + +``` +NOT author:hager +``` + +will fail. + +You will need to add something to the query to prevent the error, e.g. + +``` +species:mouse NOT author:hager +``` -- cgit v1.2.3