简体   繁体   中英

In Elasticsearch, how can I get 'max_result_window' value using [Elasticsearch Clients, Java API]?

For example: I can get 'max_result_window' value using an HTTP request, like http://esIp:9200/index/_settings .

But I want to get this value in Java runtime environment using [elasticsearch client, Java Api]. I look through the official document but result in finding no relevant infomation about it.

So, How can I get 'max_result_window' value using [Elasticsearch Clients, Java API]?

If you are talking about native transport client you can use admin API. Here is the example:

TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
            .addTransportAddress(new TransportAddress(InetAddress.getLoopbackAddress(), 9300));
GetSettingsResponse response = client.admin().indices().prepareGetSettings("test").get();
String maxResultWindow = response.getSetting("test", "index.max_result_window");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM