1.请求方式:GET
2.请求URL:
http://127.0.0.1:9200/shopping/_search
3.请求参数:
filter结合range
{
"query" : {
"bool" : {
"should" : [
{
"match" : {
"category" : "小米"
}
},
{
"match" : {
"category" : "华为"
}
}
],
"filter" : {
"range" : {
"price" : {
"gt" : 9000
}
}
}
}
},
"from" : 0,
"size" : 10,
"_source" : ["title", "category", "price"],
"sort" : {
"price" : {
"order" : "desc"
}
}
}
4.响应信息
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"Failed": 0
},
"hits": {
"total": {
"value": 2,
"relation": "eq"
},
"max_score": null,
"hits": [
{
"_index": "shopping",
"_type": "_doc",
"_id": "1009",
"_score": null,
"_source": {
"price": 9999.0,
"title": "小米手机",
"category": "小米"
},
"sort": [
9999.0
]
},
{
"_index": "shopping",
"_type": "_doc",
"_id": "1007",
"_score": null,
"_source": {
"price": 9999.0,
"title": "华为手机",
"category": "华为"
},
"sort": [
9999.0
]
}
]
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。