-
实现in操作
- 脚本查询:
{
"query" : {
"filtered" : {
"filter" : {
"terms" : {
"sku" : ["10022295323","1007285302","10437642356"]
}
}
}
}
}
- javaAPI
BoolQueryBuilder skuTerm = QueryBuilders.boolQuery();
for(String sku : task.getSku().split(",")) {
skuTerm.should(QueryBuilders.termQuery("sku", sku));
}