From 6db8e0cb25469600097a4317f2c6700d4c25bc64 Mon Sep 17 00:00:00 2001 From: ffont Date: Thu, 28 Dec 2023 08:01:40 +0100 Subject: [PATCH] Avoid + as last character in filter --- utils/search/backends/solr555pysolr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/search/backends/solr555pysolr.py b/utils/search/backends/solr555pysolr.py index 342ba00b2..011e69367 100644 --- a/utils/search/backends/solr555pysolr.py +++ b/utils/search/backends/solr555pysolr.py @@ -261,6 +261,8 @@ def search_filter_make_intersection(query_filter): # be converted to valid lucene/dismax syntax. query_filter = re.sub(r'\b([a-zA-Z_]+:)', r'+\1', query_filter) query_filter = re.sub(r"(\+)\1+", r"\1", query_filter) # This is to avoid having multiple + in a row if user already has added them + if query_filter[-1] == '+': + query_filter = query_filter[:-1] return query_filter