-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setTerms no longer normalize array parameters in 7.x #2139
Comments
@ruflin damn, looks like a case we did not properly check (see also: #1872) Should we:
Any inputs? |
What speaks for 2, is that there is just one way of doing things which should simplify code maintenance. What speaks for 1 is that it removes the breaking change but it means we have to keep it like that for a while. One option we could do, reintroduce 1 for 7.x, deprecate it and do 2 in 8.x? @pandafox Would be great to your input on this one. Would it be tricky to change your code to adapt for 2? |
@ruflin I agree that "there is just one way of doing [this]". As the current implementation is buggy when not using a list, I would expect projects to already be using the right parameters here (maybe Not sure if throwing an exception would be a BC break, but I vote for this option as being the cleaner and future-proof one. WDYT? |
I think throwing exception would prob make sense for future release, the underlying incorrect usage be identified easier (and hence for them to use it correctly) It'll be great if 7.x can be made backward compatible. Though it doesn't seem to receive much attention atm so its not yet properly patched. |
in 6.x
https://github.com/ruflin/Elastica/blob/6.x/lib/Elastica/Query/Terms.php#L53
in 7.x
https://github.com/ruflin/Elastica/blob/7.x/src/Query/Terms.php#L42
Which no longer normalize the array.
In normal usage of regular arrays there's no issue, but when an array elements were removed the terms generated aren't recognized properly by ES and results in failed to parse field error
ex:
The text was updated successfully, but these errors were encountered: