udpated :lower modifier to apply after all other normalizations
This commit is contained in:
@@ -680,21 +680,6 @@ func (r *runner) processLastProp(collection *Collection, prop string) (*search.R
|
||||
|
||||
cleanFieldName := inflector.Columnify(field.GetName())
|
||||
|
||||
// field with ":lower" modifier
|
||||
// -------------------------------------------------------
|
||||
if modifier == lowerModifier {
|
||||
result := &search.ResolverResult{
|
||||
Identifier: "LOWER([[" + r.activeTableAlias + "." + cleanFieldName + "]])",
|
||||
}
|
||||
|
||||
if r.withMultiMatch {
|
||||
r.multiMatch.valueIdentifier = "LOWER([[" + r.multiMatchActiveTableAlias + "." + cleanFieldName + "]])"
|
||||
result.MultiMatchSubQuery = r.multiMatch
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// arrayable fields with ":length" modifier
|
||||
// -------------------------------------------------------
|
||||
if modifier == lengthModifier && isMultivaluer {
|
||||
@@ -747,11 +732,11 @@ func (r *runner) processLastProp(collection *Collection, prop string) (*search.R
|
||||
// default
|
||||
// -------------------------------------------------------
|
||||
result := &search.ResolverResult{
|
||||
Identifier: fmt.Sprintf("[[%s.%s]]", r.activeTableAlias, cleanFieldName),
|
||||
Identifier: "[[" + r.activeTableAlias + "." + cleanFieldName + "]]",
|
||||
}
|
||||
|
||||
if r.withMultiMatch {
|
||||
r.multiMatch.valueIdentifier = fmt.Sprintf("[[%s.%s]]", r.multiMatchActiveTableAlias, cleanFieldName)
|
||||
r.multiMatch.valueIdentifier = "[[" + r.multiMatchActiveTableAlias + "." + cleanFieldName + "]]"
|
||||
result.MultiMatchSubQuery = r.multiMatch
|
||||
}
|
||||
|
||||
@@ -777,5 +762,13 @@ func (r *runner) processLastProp(collection *Collection, prop string) (*search.R
|
||||
}
|
||||
}
|
||||
|
||||
// account for the ":lower" modifier
|
||||
if modifier == lowerModifier {
|
||||
result.Identifier = "LOWER(" + result.Identifier + ")"
|
||||
if r.withMultiMatch {
|
||||
r.multiMatch.valueIdentifier = "LOWER(" + r.multiMatch.valueIdentifier + ")"
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user