Hi,
I am using ES 7.10.2
I have come across Index Stats API in ES documentation. Also in Java Lib there is class available named
I did come across NodeClient
, so I am trying to fetch index stats as below :
NodeClient nodeClient = new NodeClient(Settings.EMPTY, new ThreadPool(Settings.EMPTY));
IndicesStatsRequestBuilder indicesStatsRequestBuilder = nodeClient.admin()
.indices()
.prepareStats("indexNameHere");
IndicesStatsResponse indicesStatsResponse = indicesStatsRequestBuilder.get();
System.out.println("indicesStatsResponse = " + indicesStatsResponse);
But I am getting NodeClient has not been initialized
exception, what I am doing wrong ? or am I missing any steps ?
Any help is much appreciated:)