Can we use Elasticsearch-dsl-py 7.4 with Elasticsearch-8.x?

We have some Python programs that use Elasticsearch-dsl-py and Elasticsearch-py Python clients to process Elasticsearch data. We are considering upgrading to Elasticsearch-8. From PyPI we can see that elasticsearch-py-8.1.0 is available. However, elasticsearch-dsl is still at 7.4.0. The DSL documentation explicitly states that

The library is compatible with all Elasticsearch versions since 2.x but you have to use a matching major version:

For Elasticsearch 7.0 and later, use the major version 7 (7.x.y) of the library.

Is use of Elasticsearch-DSL-7.4 supported for Elasticsearch-8.x? Or is there a plan to release a v8 of the client?

Elasticsearch 7.0 is EOL and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

To answer my own question

  • elasticsearch-dsl-7.4.0 enforces a require dependency on elasticsearch-7.x so it is impossible to install both elasticsearch==8.x and elasticsearch-dsl on same environment.
  • We have worked around this limitation by creating a temporary local package 7.4.1 in which the requirement for elasticsearch is loosened (>=7.0,<9.0).
  • Since we also only use the Search() API for Elasticsearch-DSL, we were able to use elasticsearch-dsl as it is with Elasticsearch-8.x

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.