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();
}
}

'언어 > java' 카테고리의 다른 글

변수 [ Java의 정석 ]  (0) 2020.04.06
elasticsearch + java + index 삭제  (0) 2019.12.14
elasticsearch java api search  (0) 2019.03.13
크롤링 => json 파일로 적재  (0) 2019.03.03
crawling + json  (0) 2019.02.13