RestHighLevelClient, warning "Deprecated field [type] used"


I am using RestHighLevelClient

and I get a warning from our 7.17.13 server

Warning: 299 Elasticsearch-7.17.13-2b211dbb8bfdecaf7f5b44d356bdfe54b1050c13 "Deprecated field [type] used, this field is unused and will be removed entirely"

This is filling up my stack logs. Is there a way to get rid off this warning.
What are my options ?
I guess using

will solve the issue ?
Thank you

The log message says "this field is unused and will be removed entirely". So your best option is most certainly to stop using this type field!

the "type" field it is complaining about, is the one from the GeoBoundingBoxQueryBuilder 7.17.16 class.

  "geo_bounding_box" : {
    "location" : {
      "top_left" : [
      "bottom_right" : [
    "validation_method" : "STRICT",
    "type" : "MEMORY",
    "ignore_unmapped" : true,
    "boost" : 1.0

Here is some code that reproduce the issue:

public class MyMain {
    public static void main(String arg[]) {
        final CredentialsProvider credentialProvider = new BasicCredentialsProvider();
                new UsernamePasswordCredentials(
                        "my un",

        RestHighLevelClient highLevelClient = new RestHighLevelClient(
                RestClient.builder(new HttpHost("my_server_address", 9200, "http"))
                        .setHttpClientConfigCallback(httpAsyncClientBuilder -> {
                            return httpAsyncClientBuilder;

        // Calling API synchronously.
        try {
            CountRequest request = new CountRequest(new String[]{"pj-search-request-alias-1-dev"});

            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();

            final GeoBoundingBoxQueryBuilder geoBuilder = QueryBuilders
                    .setCorners(45.0, -0.5, 44.2, 0.5)

            QueryBuilder queryBuilder = QueryBuilders


            CountResponse count = highLevelClient.count(request, RequestOptions.DEFAULT);
            System.out.println("******* done" + count);

        } catch (IOException e) {
            throw new RuntimeException(e);



Thanks for the additional details. By default the RestHighLevelClient will send type = "MEMORY" and the server will issue a warning. And unfortunately setting type to null will throw an exception.

There are two options:

OK, thanks for the reply, will disable warnings through config for now.

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