Commit af0e036b authored by Gergely Ujvari's avatar Gergely Ujvari

Fix front-end search if multiple "any" terms are given

Previous implementation was flawed that if multiple any terms
were given, every term had to be true inside one field. If couldn't
handle the case when the terms can be found in different fields.

Now any terms are evaluated separately and not bound together.

Fix #1844
parent b62a50b7
......@@ -531,9 +531,11 @@ class ViewFilter
when 'any'
categoryMatch = false
for field in @checkers.any.fields
if @_checkMatch(filter, annotation, @checkers[field])
categoryMatch = true
break
for term in filter.terms
termFilter = {terms: [term], operator: "and"}
if @_checkMatch(termFilter, annotation, @checkers[field])
categoryMatch = true
break
match = categoryMatch
else
match = @_checkMatch filter, annotation, @checkers[category]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment