{
"query":{
"bool":{
"must":{
"match":{
"scode":"ios"
}
},
"must":{
"match":{
"scode":"5000up"
}
},
"minimum_number_should_match": "100%"
}
},
"from": 0,
"size": 200
}
这个用javaapi怎么表示,
String[] split = queryParam.split(" ");
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
for (String s : split) {
boolQueryBuilder = boolQueryBuilder.must(QueryBuilders.matchQuery("scode", s.trim()).minimumShouldMatch("100%"));
}
QueryBuilder builder = boolQueryBuilder;
return builder;
我这样构建出来的builder 查询结果和上面json格式的不一样
"query":{
"bool":{
"must":{
"match":{
"scode":"ios"
}
},
"must":{
"match":{
"scode":"5000up"
}
},
"minimum_number_should_match": "100%"
}
},
"from": 0,
"size": 200
}
这个用javaapi怎么表示,
String[] split = queryParam.split(" ");
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
for (String s : split) {
boolQueryBuilder = boolQueryBuilder.must(QueryBuilders.matchQuery("scode", s.trim()).minimumShouldMatch("100%"));
}
QueryBuilder builder = boolQueryBuilder;
return builder;
我这样构建出来的builder 查询结果和上面json格式的不一样
1 个回复
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: