我在node.js做弹性搜索。我有50k+用户在私密搜索,现在我有一个电话号码。现在,我希望从弹性搜索中获得那些在数组中匹配这些数字的用户,为此,我编写了搜索查询字符串,但是这个查询给了我异常,我不知道我在查询字符串中做了什么错误。
查询字符串
{
"query": {
"bool": {
"must": [
{
"prefix": {
"phone":{"+9665509548","+93565822145",...}
}
}
]
}
}
}发布于 2018-01-26 10:41:07
这就是你想要的吗?
{
"query": {
"bool": {
"should": [
{
"prefix": {
"phone": "+9665509548"
}
},
{
"prefix": {
"phone": "+93565822145"
}
},
//...
],
"minimum_should_match": 1
}
}
}https://stackoverflow.com/questions/48459631
复制相似问题