V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
xinyana
V2EX  ›  问与答

ElasticSearch7.9.1, ik 分词无法插入数据

  •  
  •   xinyana · Sep 13, 2020 · 945 views
    This topic created in 2058 days ago, the information mentioned may be changed or developed.

    elasticsearch7.9.1,ik 分词也是 7.9.1

    前两步没有问题,但是插入数据报错 报错:Mapper 冲突

    求解,非常感谢!

    #1.创建 index
    PUT /news
    
    #2.设置分词
    PUT /news/_mapping
    {
      "properties": {
        "content": {
          "type": "text",
          "analyzer": "ik_max_word",
          "search_analyzer": "ik_max_word"
        }
      }
    }
    
    #3.插入数据
    PUT gd/gd/1iNC
    {
      "title": "这里是标题",
      "content": "这里是内容"
    }
    
    DELETE /news
    

    第三步插入数据报错:

    {
      "error" : {
        "root_cause" : [
          {
            "type" : "illegal_argument_exception",
            "reason" : "Mapper for [content] conflicts with existing mapping:\n[mapper [content] has different [analyzer]]"
          }
        ],
        "type" : "illegal_argument_exception",
        "reason" : "Mapper for [content] conflicts with existing mapping:\n[mapper [content] has different [analyzer]]"
      },
      "status" : 400
    }
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1190 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 17:08 · PVG 01:08 · LAX 10:08 · JFK 13:08
    ♥ Do have faith in what you're doing.