Multiple ElasticsearchDeprecationWarning using Elasticsearch 7.7.0
See original GitHub issueIssue Summary
With elasticsearch-py 7.7.0 and Elasticsearch 7.7.0, I’m getting the following deprecation warnings on ./manage.py update_index
:
(venv) ➜ wagtail-elasticsearch-7.7.0 ./manage.py update_index
Updating backend: default
default: Rebuilding index wagtail__wagtailcore_page
/Users/yngve/Repositories/issues/wagtail-elasticsearch-7.7.0/venv/lib/python3.7/site-packages/wagtail/search/backends/elasticsearch2.py:795: ElasticsearchDeprecationWarning: The [nGram] tokenizer name is deprecated and will be removed in a future version. Please change the tokenizer name to [ngram] instead.
self.es.indices.create(self.name, self.backend.settings)
/Users/yngve/Repositories/issues/wagtail-elasticsearch-7.7.0/venv/lib/python3.7/site-packages/wagtail/search/backends/elasticsearch2.py:795: ElasticsearchDeprecationWarning: The [edgeNGram] tokenizer name is deprecated and will be removed in a future version. Please change the tokenizer name to [edge_ngram] instead.
self.es.indices.create(self.name, self.backend.settings)
/Users/yngve/Repositories/issues/wagtail-elasticsearch-7.7.0/venv/lib/python3.7/site-packages/wagtail/search/backends/elasticsearch2.py:795: ElasticsearchDeprecationWarning: The [edgeNGram] token filter name is deprecated and will be removed in a future version. Please change the filter name to [edge_ngram] instead.
self.es.indices.create(self.name, self.backend.settings)
/Users/yngve/Repositories/issues/wagtail-elasticsearch-7.7.0/venv/lib/python3.7/site-packages/wagtail/search/backends/elasticsearch2.py:795: ElasticsearchDeprecationWarning: The [nGram] token filter name is deprecated and will be removed in a future version. Please change the filter name to [ngram] instead.
self.es.indices.create(self.name, self.backend.settings)
/Users/yngve/Repositories/issues/wagtail-elasticsearch-7.7.0/venv/lib/python3.7/site-packages/wagtail/search/backends/elasticsearch7.py:25: ElasticsearchDeprecationWarning: The [nGram] tokenizer name is deprecated and will be removed in a future version. Please change the tokenizer name to [ngram] instead.
self.es.indices.put_mapping(index=self.name, body=mapping.get_mapping())
/Users/yngve/Repositories/issues/wagtail-elasticsearch-7.7.0/venv/lib/python3.7/site-packages/wagtail/search/backends/elasticsearch7.py:25: ElasticsearchDeprecationWarning: The [edgeNGram] tokenizer name is deprecated and will be removed in a future version. Please change the tokenizer name to [edge_ngram] instead.
self.es.indices.put_mapping(index=self.name, body=mapping.get_mapping())
/Users/yngve/Repositories/issues/wagtail-elasticsearch-7.7.0/venv/lib/python3.7/site-packages/wagtail/search/backends/elasticsearch7.py:25: ElasticsearchDeprecationWarning: The [edgeNGram] token filter name is deprecated and will be removed in a future version. Please change the filter name to [edge_ngram] instead.
self.es.indices.put_mapping(index=self.name, body=mapping.get_mapping())
/Users/yngve/Repositories/issues/wagtail-elasticsearch-7.7.0/venv/lib/python3.7/site-packages/wagtail/search/backends/elasticsearch7.py:25: ElasticsearchDeprecationWarning: The [nGram] token filter name is deprecated and will be removed in a future version. Please change the filter name to [ngram] instead.
self.es.indices.put_mapping(index=self.name, body=mapping.get_mapping())
/Users/yngve/Repositories/issues/wagtail-elasticsearch-7.7.0/venv/lib/python3.7/site-packages/elasticsearch/helpers/actions.py:122: ElasticsearchDeprecationWarning: [types removal] Specifying types in bulk requests is deprecated.
resp = client.bulk("\n".join(bulk_actions) + "\n", *args, **kwargs)
default: home.HomePage .
default: wagtailcore.Page .
default: indexed 2 objects
default: Rebuilding index wagtail__wagtaildocs_document
default: wagtaildocs.Document
default: indexed 0 objects
default: Rebuilding index wagtail__wagtailimages_image
default: wagtailimages.Image
default: indexed 0 objects
Considering that these are just deprecation warnings, we are not in a hurry to get rid of them.
Steps to Reproduce
- Install Elasticsearch 7.7.0
- Clone https://github.com/yhoiseth/wagtail-elasticsearch-7.7.0 (just a fresh Wagtail project configured for Elasticsearch and with
elasticsearch-py
inrequirements.txt
) pip install -r requirements.txt
./manage.py migrate
./manage.py update_index
- I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: yes
Technical details
- Python version: 3.7.7
- Django version: 3.0.6
- Wagtail version: 2.9
- Browser version: Not relevant
Elasticsearch
(venv) ➜ wagtail-elasticsearch-7.7.0 git:(master) curl localhost:9200
{
"name" : "Yngves-2015-MacBook-Pro.local",
"cluster_name" : "elasticsearch_yngve",
"cluster_uuid" : "xH8J69c9ToCQLKUN3cFeuA",
"version" : {
"number" : "7.7.0",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "81a1e9eda8e6183f5237786246f6dced26a10eaf",
"build_date" : "2020-05-12T02:01:37.602180Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Elasticsearch version 7.7.0 | Elasticsearch Guide [7.17] | Elastic
SQL: If a WHERE clause contains at least two relational operators joined by ... a deprecation warning for indices created in Elasticsearch 7.7.0...
Read more >Release notes | Elasticsearch Python Client [7.17] | Elastic
Changed the DeprecationWarning for the body parameter to be a "removed in a future version" instead of "removed in 8.0" in line with...
Read more >Elasticsearch 7.7.0 released | Elastic Blog
We are pleased to announce the release of Elasticsearch 7.7.0, ... many more features (e.g., two new aggregations) included with the release ...
Read more >Elasticsearch 7.7.0 | Elastic
The pure Apache 2.0 licensed distribution is available here. The distribution that's not bundled with a JDK is available here. You can obtain...
Read more >Breaking changes in 7.7 | Elasticsearch Guide [7.17] | Elastic
If you configure more than one realm of any type with the same order, the node will fail to start. Deprecation of insecure...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We just need to remove
_type
from this line: https://github.com/wagtail/wagtail/blob/a501dc257d086ea4c9d38398a0cc29dc3aaa6f76/wagtail/search/backends/elasticsearch7.py#L52Thanks for reporting! Looks like these are two really simple changes for the Elasticsearch 7 backend:
nGram
tongram
andedgeNGram
toedge_ngram
_type
parameter from the bulk request (not used in recent Elasticsearch versions anyway)