Closed aallam closed 2 years ago
Thanks!
I am not sure about the behavior of single string filter.
👋🏻 @godelized do you remember how
"color:green,color:yellow"
should be translated? is it[["color:green"],["color:yellow"]]
It looks like it is the legacy format: https://github.com/algolia/AlgoliaSaaS/blob/330cbefd4e3d36eba3565760a2e9ca96708c3ca4/algolia/api/json_parsers/DecodeJSONStringArray.cpp#L153-L181. If I understand correctly the first level are separate groups (i.e. conjunctions) and inside-parenthesis items are assigned to the same group (i.e.) disjunctions.
So:
color:green,color:yellow
is equivalent to ["color:green", "color:yellow"]
and [["color:green"], ["color:yellow"]]
.(color:green, color:yellow)
is equivalent to [["color:green", "color:yellow"]]
.To be validated with a test :smile:.
I did a pass on the tests :)
color:green,color:yellow
[["color:green"],["color:yellow"]]
assertANDEDListResult
instead of assertOREDResult
["color:green","color:yellow"]
[["color:green"],["color:yellow"]]
assertOREDListResult
but I didn't find the definition, but since it's a and, the test should use assertANDEDListResult
Looks good :)
color:green,color:yellow
for the engine it is equivalent to a and:
[["color:green"],["color:yellow"]]
["color:green","color:yellow"]
for the engine it is equivalent to a and:
[["color:green"],["color:yellow"]]
color:green,color:yellow
and ["color:green","color:yellow"]
are then equivalent! I've pushed a small changes to match the above.
Thank you @godelized for your help 🙌
Describe your change
Fixes
optionalFilters
deserialization for following special cases:["A:1", "B:2"]
->[["A:1"], ["B:2"]]
"A:1", "B:2"
->[["A:1"], ["B:2"]]