我的Elasticsearch是"6.4.0"版本,当我创建字段时

{
"domain":
        {
    "type": "string",
    "index": "not_analyzed"
    }
}

 

原因分析

查看官方文档后发现是在新版本中已经移除该操作方式了

的值只能是boolean变量了。

解决方法

修改为

    {
    "domain":{
                    "type":"text",
                    "index":"false"
                },
    }        

 

出现的第二个问题

1. 此时抛出了另外一个error

            {
                "type": "illegal_argument_exception",
                "reason": "Rejecting mapping update to [hn] as the final mapping would have more than 1 type: [poll, job, story]"
            }

 

2. 这个异常引发的原因同样是版本问题

  
  在Elasticsearch 6.0.0或更高版本中创建的索引可能只包含单个mapping type
在具有多种映射类型的5.x中创建的索引将继续像以前一样在Elasticsearch 6.x中运行。映射类型将在Elasticsearch 7.0.0中完全删除。

 

相关文章:

  • 2021-11-19
  • 2021-05-06
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
猜你喜欢
  • 2021-06-15
  • 2021-09-17
  • 2022-12-23
  • 2021-11-03
  • 2021-09-07
  • 2021-11-20
相关资源
相似解决方案