大家 . 这是一个带有elasitcsearch document url的简单测试代码
curl -XPOST 'localhost:9200/customer/external/_search?pretty'
{“take”:3,“timed_out”:false,“_ shards”:{“total”:5,“success”:5,“failed”:0},“hits”:{“total”:2,“ max_score“:1.0,”点击“:[{”_ index“:”customer“,”_ type“:”external“,”_ id“:”1“,”_ score“:1.0,”_ source“:{”age“: 20,“balance”:100000,“name”:“Thomas.St.Wang”}},{“_ index”:“customer”,“_ type”:“external”,“_ id”:“2”,“score” :1.0,“ source”:{“age”:19,“balance”:10000,“name”:“TSW”}}]}}
以下请求不是我期望的结果 . 为什么 .
curl -XPOST 'localhost:9200/customer/external/_search?pretty' -d
{
"query":{
"filtered":{
"query":{
"match_all":{
}
},
"filter":{
"range":{
"balance":{
"gte":9999,
"lte":100001
}
}
}
}
}
}
{“take”:2,“timed_out”:false,“_ shards”:{“total”:5,“success”:5,“failed”:0},“hits”:{“total”:0,“ max_score“:null,”点击“:[]}}
我的查询有什么问题?谢谢 .
1 回答
这就是答案 . 因为余额是一个字符串 . 我需要删除索引,然后重启索引 .