ES 子文档索引进行字段添加操作

ES版本号:5.3.2

{
  "name": "es-node-1",
  "cluster_name": "es-b2b-dev0",
  "cluster_uuid": "c5LjpmeLSV-1Px7eQv0zDw",
  "version": {
    "number": "5.3.2",
    "build_hash": "3068195",
    "build_date": "2017-04-24T16:15:59.481Z",
    "build_snapshot": false,
    "lucene_version": "6.4.2"
  },
  "tagline": "You Know, for Search"
}
PUT /item-store-search/item/_mapping
{
  "properties": {
    "sale_district_area": {
      "type": "text",
      "analyzer": "sp_with_comma"
    }
  }
}

item-store-search为索引名称,item为索引type类型,新版本改为"_doc"
报错提示:The _parent field's type option can't be changed: [store]->[null]
查看item对应的父文档类型为"store"
GET item-store-search/_mapping

需要指定,"_parent"属性,更新后文档信息为

PUT /item-store-search/item/_mapping
{
  "_parent": {
    "type": "store"
  },
  "properties": {
    "sale_district_area": {
      "type": "text",
      "analyzer": "sp_with_comma"
    }
  }
}

提示:

{
  "acknowledged": true
}

成功

posted @ 2023-08-17 10:40  748573200000  阅读(200)  评论(0编辑  收藏  举报