网上关于ES的访问,非常多是关于TCP访问的。但草泥 妈马的总是报配置问题。
先用REST服务吧。草泥妈的。FUCK YOU .ELASEARCH! FUCK YOU.那些个吊毛对单机配置了elasticsearch.yml配置文件却不公布上来。FUCK YOU!!!!
@RequestMapping("/getesdata")
@ResponseBody
public Map<String, Object> sendJson2ES(){
Map<String, Object> varsRequest = new HashMap<String, Object>();
Map<String, Object> queryContent = new HashMap<String, Object>();
Map<String, Object> matchContent = new HashMap<String, Object>();
queryContent.put("match_all", matchContent);
varsRequest.put("query", queryContent);
String strTemp4 = varsRequest.toString();
Map<String, Object> varsResponse = restTemplate.postForObject("http://localhost:9200/_search", varsRequest, HashMap.class);
return varsResponse;
}
先用REST服务吧。草泥妈的。FUCK YOU .ELASEARCH! FUCK YOU.那些个吊毛对单机配置了elasticsearch.yml配置文件却不公布上来。FUCK YOU!!!!
@RequestMapping("/getesdata")
@ResponseBody
public Map<String, Object> sendJson2ES(){
Map<String, Object> varsRequest = new HashMap<String, Object>();
Map<String, Object> queryContent = new HashMap<String, Object>();
Map<String, Object> matchContent = new HashMap<String, Object>();
queryContent.put("match_all", matchContent);
varsRequest.put("query", queryContent);
String strTemp4 = varsRequest.toString();
Map<String, Object> varsResponse = restTemplate.postForObject("http://localhost:9200/_search", varsRequest, HashMap.class);
return varsResponse;
}