我的文档如下所示:
[
{
"Additional_Tests":"null",
"New":"N",
"name":"DIABETIC"
},
{
"Additional_Tests":"null",
"New":"N",
"name":"DIABETIS"
},
{
"Additional_Tests":"null",
"New":"N",
"name":"DIABETICS"
},
{
"Additional_Tests":"null",
"New":"N",
"name":"LIVER"
}
]
现在,我要实现的是,当我写diabetis
时,应该给我以下结果:
[
{
"Additional_Tests":"null",
"New":"N",
"name":"DIABETIC"
},
{
"Additional_Tests":"null",
"New":"N",
"name":"DIABETIS"
},
{
"Additional_Tests":"null",
"New":"N",
"name":"DIABETICS"
}
]
为此,我编写了如下所示的查询:
{
"query":{
"regexp":{
"name":"diabetis.*"
}
}
}
但是以某种方式它给了我零点击,如下所示:
{ took: 0,
timed_out: false,
_shards: { total: 1, successful: 1, skipped: 0, failed: 0 },
hits: { total: 0, max_score: null, hits: [] } }
那么我有什么办法可以实现?