Skip to content

$es->indices->exists_template() doesn't support "include_type_name" #192

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

Closed
truj opened this issue Jul 22, 2020 · 3 comments
Closed

$es->indices->exists_template() doesn't support "include_type_name" #192

truj opened this issue Jul 22, 2020 · 3 comments

Comments

@truj
Copy link

truj commented Jul 22, 2020

Thanks for fixing #169, which allows using the parameter include_type_name in $es->indices->exists().
But now we have the same issue with $es->indices->exists_template().
Please fix it there as well.

Background:
We try to fix our deprecation warnings before upgrading to ES 7.
Currently we use ES 6, and we get these warnings.

exists_template() is mapped to a HEAD request to /_template/...
But without include_type_name we get a warning:

curl -XHEAD -i -I "http://user:password@our-es-host:9201/_template/test/?pretty=true"

HTTP/1.1 404 Not Found
Server: nginx/1.10.3
Date: Wed, 22 Jul 2020 13:24:02 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 4
Connection: keep-alive
X-Opaque-Id: 10.35.150.25:37264
Warning: 299 Elasticsearch-6.7.2-56c6e48 "[types removal] The parameter include_type_name should be explicitly specified in get template requests to prepare for 7.0. In 7.0 include_type_name will default to 'false', which means responses will omit the type name in mapping definitions."

With this parameter the warning vanishes:

curl -XHEAD -i -I "http://user:password@our-es-host:9201/_template/test/?pretty=true&include_type_name=false"

HTTP/1.1 404 Not Found
Server: nginx/1.10.3
Date: Wed, 22 Jul 2020 13:23:37 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 4
Connection: keep-alive
X-Opaque-Id: 10.35.150.25:37245

Alternatively you can consider fixing #171.
Then this issue would be fixed automatically, and maybe other similar problems as well.

@ezimuel
Copy link
Contributor

ezimuel commented Aug 5, 2020

We just released a dev version 7.30_1 supporting Elasticsearch 7.3 APIs. Please check this version and let me know if this solve the issue. Thanks!

@truj
Copy link
Author

truj commented Sep 2, 2020

Meanwhile we upgraded to ES 6.8.11 on our test system.
Tried 7.30_1 with this but our unit tests fail.
Seems like 7.30_1 is only working with ES 7.X but not ES 6.X

Is this the expected behaviour?

If yes, I have to wait until everything is switched to 6.8.11. Then we can switch the test system to 7.X, and then I can test 7.30_1.
If not, I will have to check deeper, why the tests are failing with 7.30_1. (With 6.81 they are successful, apart from the not-yet-fixed deprecation warnings.)

@ezimuel
Copy link
Contributor

ezimuel commented Sep 2, 2020

@truj elasticsearch-perl 7.30_1 works only for ES 7.x (up to 7.3). This is the expected behaviour. If you want to use ES 6.x with elasticsearch-perl 7.30_1 you need to specify 6_0::Direct parameter in the Search::Elasticsearch constructor:

use Search::Elasticsearch;
my $e = Search::Elasticsearch->new(
    client => '6_0::Direct'
);

Basically, the 7.30_1 version includes all the previous APIs for ES 6.x. I'm going to remove the support to the previous version 5.x, 2.x, 1.x and 0.x, see #193.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants