查询
http:127.0.0.1:9200/get/bool/novel?params=
GetResponse result = this.client.PrepareGet("book","novel").get();
@Autowired
TransportClient transportClient;
@GetMapping("/get/{index}/{type}/{id}")
public Object get(@PathVariable String index, @PathVariable String type, @PathVariable String id) {
GetResponse response = transportClient.prepareGet(index, type, id).get();
return response.getSource();
}使用Restful风格API接口,可以做通用查询接口。
GET http://localhost:8080/es/book/novel/1
查询接口开发
利用TrancportClient来执行查询