建立索引报错 es版本6.1.2

来源:8-3 索引结构设计(上)

qq_常乐我净_0

2018-03-05

{

  "error": {

    "root_cause": [

      {

        "type": "mapper_parsing_exception",

        "reason": "Failed to parse mapping [house]: Could not convert [roundService.index] to boolean"

      }

    ],

    "type": "mapper_parsing_exception",

    "reason": "Failed to parse mapping [house]: Could not convert [roundService.index] to boolean",

    "caused_by": {

      "type": "illegal_argument_exception",

      "reason": "Could not convert [roundService.index] to boolean",

      "caused_by": {

        "type": "illegal_argument_exception",

        "reason": "Failed to parse value [analyzed] as only [true] or [false] are allowed."

      }

    }

  },

  "status": 400


写回答

2回答

qq_常乐我净_0

提问者

2018-03-06

"mappings": {
 "house": {
   "dynamic": false,
   "properties": {
     "houseId": {
       "type": "long"
     },
     "title": {
       "type": "text",
       "index": "analyzed"
     },
     "price": {
       "type": "integer"
     },
     "area": {
       "type": "integer"
     },
     "createTime": {
       "type": "date",
       "format": "strict_date_optional_time||epoch_millis"
     },
     "lastUpdateTime": {
       "type": "date",
       "format": "strict_date_optional_time||epoch_millis"


我把"index" : "analyzed"  删掉就好了 ,可以put上去

1
1
瓦力老师
亲,结合错误提示,你试着设定"index":true
2018-03-06
共1条回复

瓦力老师

2018-03-05

亲,看报错应该是写错了位置,把具体的mapping贴出来,我们一起看下具体哪里写错了^O^

1
0

BAT大牛亲授 基于ElasticSearch的搜房网实战

ES+MySQL+Kafka,打造强力站内搜索

898 学习 · 285 问题

查看课程