Commit 79d2cdd8 authored by gergely-ujvari's avatar gergely-ujvari

Unbreak QueryParser.parseModels()

My last commit here (https://github.com/hypothesis/h/commit/5f56d8ad0424f11e52736fd9a1f9b8c30ab0f6a1)
has broken this function for or operators, because it forgets to apply the rule.format() call
to the search terms

I.e the user field uses this to transform the username to the full user format (acct:username@domain)
And because of this the user streams were broken.

Fix #1391
parent cd65ac8c
......@@ -248,7 +248,13 @@ class QueryParser
oper_part =
if rule.operator? then rule.operator
else if exact_match then 'one_of' else 'match_of'
filter.addClause mapped_field, oper_part, terms, case_sensitive, rule.options
value_part = []
for term in terms
t = if rule.formatter then rule.formatter term else term
value_part.push t
filter.addClause mapped_field, oper_part, value_part, 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