언어/java

elasticsearch java api : total index search

파아랑새 2019. 4. 22. 18:59

public void totalIndex() {

GetIndexRequest getIndexRequest = new GetIndexRequest().indices("*");
GetIndexResponse response = null;

try {

response = _highClient.indices().get(getIndexRequest, RequestOptions.DEFAULT);
String[] indices = response.getIndices();

for (int i = 0; i < indices.length; i++) {
System.out.println(indices[i]);
}

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}