I have the following (Kotlin) code for querying ElasticSearch from a Spring Boot application, using spring-boot-starter-data-elasticsearch version 3.2.2-RELEASE.