1. 过滤器 post_filter
1.1 gt:大于 、lt:小于
返回60<money<1000的数据:
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 3,
"successful": 3,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 4,
"relation": "eq"
},
"max_score": 7.372511,
"hits": [
{
"_index": "shop",
"_type": "_doc",
"_id": "1001",
"_score": 7.372511,
"_source": {
"id": 1001,
"age": 18,
"username": "imoocAmazing",
"nickname": "慕课网",
"money": 88.8,
"desc": "我在慕课网学习java和前端, 学习到了很多知识",
"sex": 0,
"birthday": "1922-12-24",
"face": "https://www.imooc.com/static/img/index/logo.png"
}
},
{
"_index": "shop",
"_type": "_doc",
"_id": "1003",
"_score": 6.846202,
"_source": {
"id": 1003,
"age": 20,
"username": "bigFace",
"nickname": "飞翔的巨鹰",
"money": 66.8,
"desc": "慕课网团队和导游坐飞机去海外旅游,去了新马泰和欧洲",
"sex": 1,
"birthday": "1996-01-14",
"face": "https://www.imooc.com/static/img/index/logo.png"
}
},
{
"_index": "shop",
"_type": "_doc",
"_id": "1005",
"_score": 1.6699551,
"_source": {
"id": 1005,
"age": 25,
"username": "gotoplay",
"nickname": "ps游戏机",
"money": 155.8,
"desc": "今天生日,女友送了我一台play station游戏机,非常好玩,非常不错",
"sex": 1,
"birthday": "1989-03-14",
"face": "https://www.imooc.com/static/img/index/logo.png"
}
},
{
"_index": "shop",
"_type": "_doc",
"_id": "1006",
"_score": 0.88025683,
"_source": {
"id": 1006,
"age": 19,
"username": "missimooc",
"nickname": "我叫小慕",
"money": 156.8,
"desc": "我叫凌云慕,今年20岁,是一名律师,我在奇䯲星球做演讲",
"sex": 1,
"birthday": "1993-04-14",
"face": "https://www.imooc.com/static/img/index/logo.png"
}
}
]
}
}
1.2 gte:大于等于 、lte:小于等于
返回66.8<=money<=155.8的数据:
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 3,
"successful": 3,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 3,
"relation": "eq"
},
"max_score": 7.372511,
"hits": [
{
"_index": "shop",
"_type": "_doc",
"_id": "1001",
"_score": 7.372511,
"_source": {
"id": 1001,
"age": 18,
"username": "imoocAmazing",
"nickname": "慕课网",
"money": 88.8,
"desc": "我在慕课网学习java和前端, 学习到了很多知识",
"sex": 0,
"birthday": "1922-12-24",
"face": "https://www.imooc.com/static/img/index/logo.png"
}
},
{
"_index": "shop",
"_type": "_doc",
"_id": "1003",
"_score": 6.846202,
"_sou