首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Elasticsearch根映射不支持param

Elasticsearch根映射不支持param
EN

Stack Overflow用户
提问于 2019-11-20 12:48:09
回答 1查看 360关注 0票数 0

我试图用如下的PUT命令在弹性搜索中配置索引,并得到如下错误。我不知道是什么错误。我用了7.4.2版本的麋鹿

PUT代码如下:

代码语言:javascript
复制
PUT /myfeed
{
   "settings": {
      "index": {
         "number_of_shards": 1,
         "number_of_replicas": 0
      },
      "analysis": {
         "analyzer": {
            "folding": {
               "type": "custom",
               "tokenizer": "standard",
               "char_filter": ["html_strip"],
               "filter": ["lowercase", "asciifolding"]
            }
         }
      }
   },
   "mappings": {
      "feed": {
         "_all": {
            "enabled": false
         },
         "properties": {
            "feed": {
               "type": "keyword"
            },
            "link": {
               "type": "keyword"
            },
            "published": {
               "type": "date"
            },
            "message": {
               "type": "string",
               "analyzer": "folding"
            },
            "title": {
               "type": "string",
               "analyzer": "folding"
            }
         }
      }
   }
}

控制台上的错误如下:

代码语言:javascript
复制
{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "Root mapping definition has unsupported parameters:  [feed : {_all={enabled=false}, properties={feed={type=keyword}, link={type=keyword}, published={type=date}, message={analyzer=folding, type=string}, title={analyzer=folding, type=string}}}]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [feed : {_all={enabled=false}, properties={feed={type=keyword}, link={type=keyword}, published={type=date}, message={analyzer=folding, type=string}, title={analyzer=folding, type=string}}}]",
    "caused_by": {
      "type": "mapper_parsing_exception",
      "reason": "Root mapping definition has unsupported parameters:  [feed : {_all={enabled=false}, properties={feed={type=keyword}, link={type=keyword}, published={type=date}, message={analyzer=folding, type=string}, title={analyzer=folding, type=string}}}]"
    }
  },
  "status": 400
}

请帮我修一下这个

EN

回答 1

Stack Overflow用户

发布于 2019-11-21 05:37:38

Lupanoide(谢谢)对_all表示反对,因此对我的映射如下所示

代码语言:javascript
复制
 PUT /myfeed
{
  "mappings": {
         "properties": {
            "feed": {
               "type": "keyword"
            },
            "link": {
               "type": "keyword"
            },
            "published": {
               "type": "date"
            },
            "message": {
               "type": "text",
               "analyzer": "folding"
            },
            "title": {
               "type": "keyword"
            }
         }
      },
   "settings": {
      "index": {
         "number_of_shards": 1,
         "number_of_replicas": 0
      },
      "analysis": {
         "analyzer": {
            "folding": {
               "type": "custom",
               "tokenizer": "standard",
               "char_filter": ["html_strip"],
               "filter": ["lowercase", "asciifolding"]
            }
         }
      }
   }
}

谢谢

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58954738

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档