Commit db78d677 authored by gergely-ujvari's avatar gergely-ujvari

Restore 'or' operator functionality for Query-parser

This part of the code survived the refactoring.
In the past it has received the values in a comma separated string,
now it receives them as a list.

Also, the operator for tag search is 'and' not 'or'
parent 9cfdb051
......@@ -166,7 +166,7 @@ class QueryParser
path: '/tags'
exact_match: false
case_sensitive: false
and_or: 'or'
and_or: 'and'
quote:
path: '/quote'
exact_match: false
......@@ -245,14 +245,10 @@ class QueryParser
if and_or is 'or'
val_list = ''
first = true
for val in terms
unless first then val_list += ',' else first = false
value_part = if rule.formatter then rule.formatter val else val
val_list += value_part
oper_part =
if rule.operator? then rule.operator
else if exact_match then 'one_of' else 'match_of'
filter.addClause mapped_field, oper_part, val_list, case_sensitive, rule.options
filter.addClause mapped_field, oper_part, terms, case_sensitive, rule.options
else
oper_part =
if rule.operator? then rule.operator
......
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