Skip to content

Commit

Permalink
Handle empty query strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ffont committed Dec 28, 2023
1 parent 6db8e0c commit f50789d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/search/backends/solr555pysolr.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ 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] == '+':
if len(query_filter) > 0 and query_filter[-1] == '+':
query_filter = query_filter[:-1]
return query_filter

Expand Down

0 comments on commit f50789d

Please sign in to comment.