鉴于此映射
"mappings": {
"schools": {
"properties": {
"autocomplete": {
"type": "string"
}
...
}
}
}
此查询有效:
GET records-schools/_search
{
"query": {
"query_string": {
"query": "my_*al",
"default_field": "autocomplete",
"analyze_wildcard": true
}
},
"from": 0,
"size": 10
}
但是这个,不是:
GET records-schools/_search
{
"query": {
"wildcard": {
"autocomplete": "my_*al"
}
},
"from": 0,
"size": 10
}
虽然,如果我将上一个查询的值更改为简单的星号*
,就可以。
为什么通配符查询不起作用?
注意:
ElasticSearch版本:2.4