suggest出现了no mapping found for field [description]的问题
Elasticsearch | 作者 Sakura0408 | 发布于2019年12月16日 | 阅读数:4618
								按照官方文档写的,我映射里面的字段类型也改成completion了,还是报这个错误。。
映射信息
 
															
																				映射信息
"mappings": {
	"_doc": {
		"properties": {
			"creator": {
				"type": "integer"
			},
			"gmtModified": {
				"type": "date"
			},
			"description": {
				"max_input_length": 50,
				"analyzer": "ik_max_word",
				"preserve_position_increments": true,
				"type": "completion",
				"preserve_separators": true
			},
			"likeCount": {
				"type": "integer"
			},
			"id": {
				"type": "integer"
			},
			"tag": {
				"max_input_length": 50,
				"analyzer": "ik_max_word",
				"preserve_position_increments": true,
				"type": "completion",
				"preserve_separators": true
			},
			"viewCount": {
				"type": "integer"
			},
			"gmtCreate": {
				"type": "date"
			},
			"title": {
				"max_input_length": 50,
				"analyzer": "ik_max_word",
				"preserve_position_increments": true,
				"type": "completion",
				"preserve_separators": true
			},
			"commentCount": {
				"type": "integer"
			}
		}
	}
"suggest": {
    "s1": {
      "text": "SpringBoot",
      "completion": {
        "field": "description"
      }
    }
  }{
  "took" : 10,
  "timed_out" : false,
  "_shards" : {
    "total" : 10,
    "successful" : 5,
    "skipped" : 0,
    "failed" : 5,
    "failures" : [
      {
        "shard" : 0,
        "index" : "comment_1.0",
        "node" : "eF0OemQ-SFS2bbi7Va_rsA",
        "reason" : {
          "type" : "illegal_argument_exception",
          "reason" : "no mapping found for field [description]"
        }
      }
    ]
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  },
  "suggest" : {
    "s1" : [
      {
        "text" : "SpringBoot",
        "offset" : 0,
        "length" : 10,
        "options" : [ ]
      }
    ]
  }
}

 
	
0 个回复