使用rest client
Map<String, String> paramMap = new HashMap<String, String>();
String qqq = g.toJson(query.toString());
paramMap.put("q", "make:chevrolet");
paramMap.put("pretty", "true");
try {
Response response = restClient.performRequest("GET", "vehicles/_search", paramMap);
return EntityUtils.toString(response.getEntity());
这里不使用map对象,而是如何使用QueryBuilders构建查询