我正在使用 5.1 版本学习 ElasticSearch。我有一个索引“mycontent”和一个类型“simpledocument”。我在尝试检查 simpledocument 类型的建议/完成功能时遇到错误“illegal_argument_exception no mapping found for field”。详情如下:
GET _search
{
"suggest":{
"my-suggestion":{
"prefix":"ap",
"completion":{
"field":"suggest"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
这给了我回应:
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 6,
"successful": 5,
"failed": 1,
"failures": [
{
"shard": 0,
"index": ".kibana",
"reason": {
"type": "illegal_argument_exception",
"reason": "no mapping found for field [suggest]"
}
}
]
},
......
Run Code Online (Sandbox Code Playgroud)
映射中确实有建议字段:
GET _mapping/simpledocument
{
"mycontent": {
"mappings": {
"simpledocument": {
"properties": {
"description": {
"type": "text",
"fields": {
"keyword": { …Run Code Online (Sandbox Code Playgroud)