Skip to content

Commit

Permalink
Avoid + as last character in filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ffont committed Dec 28, 2023
1 parent e9a2b78 commit 6db8e0c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils/search/backends/solr555pysolr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 6db8e0c

Please sign in to comment.