Fix issue caused by 7.x breaking change (_source_include/_source_exclude) #1019
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In documentation,
_source_exclude
/_source_include
are still listed as parameters of a few methods (e.g. https://elasticsearch-py.readthedocs.io/en/master/api.html?highlight=get#elasticsearch.Elasticsearch.get ), while_source_excludes
/_source_includes
are not mentioned at all.However, Elasticsearch 7.x ONLY accepts
_source_excludes
/_source_includes
._source_exclude
/_source_include
will cause exception on Elasticsearch 7.x. Hence, when I tried to follow the API documentation, I encountered error like the one below.Given recommended client version is quite clear (https://github.com/elastic/elasticsearch-py#compatibility), the solution can be simply replace all
_source_exclude
/_source_include
with_source_excludes
/_source_includes
.Reference: