用java代码查询ES索引
public class ElasticsearchSearchTest {
public static void main(String[] args) throws IOException {
RestHighLevelClient restHighLevelClient = new RestHighLevelClient(RestClient.builder(
new HttpHost("localhost", 9200, "http")));
try {
GetIndexRequest getIndexRequest = new GetIndexRequest("hello1");
GetIndexResponse getIndexResponse = restHighLevelClient.indices().
get(getIndexRequest, RequestOptions.DEFAULT);
System.out.println(getIndexResponse.getAliases());
System.out.println(getIndexResponse.getMappings());
System.out.println(getIndexResponse.getSettings());
} catch (Exception e) {
e.printStackTrace();
} finally {
restHighLevelClient.close();
}
}
}
用postman请求查询