Migrate code from the Elasticsearch high level REST client to the Java API Client

Proprietary

Translates the code that uses the Elasticsearch 7 RestHighLevelClient into the code that does the same with the Elasticsearch 8 Java API Client: its construction, the requests sent with it, the queries they carry and the responses read from them. A repository changes only when all of its uses of the high level client can be translated, so that its code keeps compiling. A repository also stays as it is when a library it depends on, such as Spring Data Elasticsearch 4 or the high level client extension of Quarkus, uses the high level client, possibly the repository's own, or when no build file of the repository declares the high level client. Every use that cannot be translated yet is listed in a data table instead. The Java API Client has no status on its responses, so the RestStatus of a response becomes the HTTP status code that the high level client derived it from, such as 201 for a document that was created, which is also what printing it shows instead of CREATED. The arrays of the high level client, such as the hits of a search and the fragments of a highlight, are lists in the Java API Client. The client writes documents as the high level client did, with the nulls of a map and with dates as text. As the Java API Client talks only to Elasticsearch, a repository that mentions OpenSearch stays as it is.

io.moderne.elastic.elastic8.MigrateHighLevelRestClient
mod run . --recipe=io.moderne.elastic.elastic8.MigrateHighLevelRestClient

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.