Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
- Fix 404 when the search term is mangled out of existence
  p.s. this is introduced by ree-fix-standalone-wildcard-error branch
  • Loading branch information
reebalazs committed Jul 21, 2023
1 parent cbe8ff4 commit d672300
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/collective/solr/mangler.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ def mangleSearchableText(value, config, force_complex_search=False):
(term_value, term_base_value) = makeSimpleExpressions(term, levenstein_distance)
value_parts.append(term_value)
base_value_parts.append(term_base_value)
if len(value_parts) == 0:
# Mangled out of existence. This must be done because Solr will choke on an
# empty field query.
return None

base_value = " ".join(base_value_parts)
value = " ".join(value_parts)
Expand Down

0 comments on commit d672300

Please sign in to comment.