在rest客户端中使用QueryBuilders构建查询

时间:2017-09-09 13:49:13

标签: elasticsearch

使用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构建查询

0 个答案:

没有答案