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,7 +531,9 @@ class ViewFilter ...@@ -531,7 +531,9 @@ class ViewFilter
when 'any' when 'any'
categoryMatch = false categoryMatch = false
for field in @checkers.any.fields for field in @checkers.any.fields
if @_checkMatch(filter, annotation, @checkers[field]) for term in filter.terms
termFilter = {terms: [term], operator: "and"}
if @_checkMatch(termFilter, annotation, @checkers[field])
categoryMatch = true categoryMatch = true
break break
match = categoryMatch match = categoryMatch
......
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