-
Notifications
You must be signed in to change notification settings - Fork 736
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
Analyze removed support for request parameters #1370
Conversation
Guest what ... ^ |
lib/Elastica/Index.php
Outdated
* @param array $args OPTIONAL Additional arguments | ||
* | ||
* @return array Server response | ||
* | ||
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html | ||
*/ | ||
public function analyze($text, $args = []) | ||
public function analyze($body, $args = []) | ||
{ | ||
$endpoint = new Analyze(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should return an error in case body is not a map to make it easier for app devs to detect the problem early.
60c0a34
to
f7845ee
Compare
sorry I make some mistakes between comments and review ... ;)
|
f7845ee
to
7e748b3
Compare
I like the strict typing of array. This will also show developers and error very quickly which hopefully pushes them to read the changelog :-) |
I like strict type hinting too... maybe when this major upgrade has ended we could plan a major refactor in order to make Elastica more respectful of it, considering we are now upgraded to php7. |
I like the idea as it will make devs detect problems much earlier. But it will definitively break all older versions (which is probably fine looking at http://php.net/supported-versions.php). |
Analyze endpoint removed support for request parameters, we should use request body instead. I updated the Analyze endpoint in order to accept not only text, but an array of values, so even the explain functionality will work.