xpack.sql.translate

edit
client.xpack.sql.translate({
  body: object
})

link:Translate SQL into Elasticsearch queries[Reference]

body

object - Specify the query in the query element.