This Elasticsearch output still has a lot of code related to Elasticsearch versions from 1.x to 6.x
Given 9.0.0 version of the stack is being worked on we could benefit from code cleanup related to older versions of Elasticsearch.
Changes will be introduced in the plugin version meant for Logstash 9.0.0, so that Logstash 8.x's version will still be able to connect to much older ES instances, while Logstash 9.x will be able to connect to ES 7.x, 8.x and 9.x.