Closed ShostikSergey closed 1 year ago
Hey @ShostikSergey, you should add ['dslVersion' => 8]
in your connection configuration.
Yes, of course, I specified ['dslVersion' => 8] in the elasticsearch connection parameters. But there was a url assembly error in the yiisoft/yii2-elasticsearch/Command.php. At the moment, this error has already been fixed.
Hi. I'm trying to use the library to work with elasticsearch 8.1. I'm getting an error when updating a record ` Exception 'yii\elasticsearch\Exception' with message 'Elasticsearch request failed with code 400. Response body: {"error":"no handler found for uri [/user-data-000001/_doc/IgHuyn8BFVoGVA2IEGZP/_update] and method [POST]"}'
in /usr/share/nginx/app/vendor/yiisoft/yii2-elasticsearch/Connection.php:558
Error Info: Array ( [requestMethod] => POST [requestUrl] => http://host.docker.internal:9200/user-data-000001/_doc/IgHuyn8BFVoGVA2IEGZP/_update [requestBody] => {"doc":{"updated_at":"2022-03-27 19:14:38"}} [responseCode] => 400 [responseHeaders] => Array ( [x-elastic-product] => Elasticsearch [content-type] => application/json [content-length] => 122 )
) `
In the official elasticsearch documentation, this type of urls is found up to version 6.8 inclusive. Starting from version 7, the url for updating documents looks like
POST /index/_update/<_id>
Additional info