你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
kevinscott - 小白
赞同来自: rochy 、zhuzh2019
A Query builder which allows building a query given JSON string or binary data provided as input. This is useful when you want to use the Java Builder API but still have JSON query strings at hand that you want to combine with other query builders.
QueryBuilders.wrapperQuery("{\"term\": {\"field\":\"value\"}}")
JackGe
赞同来自:
w565039616 - 90后it男
yxy
TransportClient client = new PreBuiltTransportClient(Settings.builder().put("cluster.name", es集群名称).build()) .addTransportAddress(new TransportAddress(InetAddress.getByName(es的IP), Integer.parseInt(es的Port(一般为9300这个))));
WrapperQueryBuilder wqb = QueryBuilders.wrapperQuery(json);
SearchResponse searchResponse = client.prepareSearch(索引) .setTypes(索引映射).setQuery(wqb).get();
{ "query": { "match": { "title": { "query": "小米手机" } } } }
{ "match": { "title": { "query": "小米手机" } } }
要回复问题请先登录或注册
90后it男
4 个回复
kevinscott - 小白
赞同来自: rochy 、zhuzh2019
JackGe
赞同来自:
client().prepareSearch().setQuery("{ \"term\" : { \"field1\" : \"value1_1\" }}")
或者自己提交http POST请求传入dsl语句的方式
w565039616 - 90后it男
赞同来自:
yxy
赞同来自:
json为自己拼接的查询语句
注意:kibana中的查询为:
但是拼接json时需要去掉第二行的query,如下