很高兴认识你!|

yourxiong

园龄:7年4个月粉丝:0关注:2

ElasticSearch 7.x 中新建表(Mapping)、新增字段(Field)、新增文档(doc)

新建表(Mapping) 示例

PUT user_manager
{
    "mappings": {
        "properties": {
            "id": {
                "type": "keyword"
            },
            "status": {
                "type": "keyword"
            },
            "createTime": {
                "type": "date",
                "format": "yyyy-MM-dd HH:mm:ss"
            },
            "updateTime": {
                "type": "date",
                "format": "yyyy-MM-dd HH:mm:ss"
            }
        }
    }
}

新增字段(Field) 示例

POST user_manager/_mapping
{
  "properties": {
    "openId": {
      "type": "keyword"
    }
  }
}

新增文档(doc) 示例

POST user_manager/_doc/1551753844109601212
{
    "id": "1551753844109601212",
    "type": [
        "3"
    ],
    "userId": "123",
    "userName": "test",
    "title": "大欢喜",
    "thumb": "img/test.png",
    "status": "1",
    "createTime": "2022-07-08 16:32:23",
    "updateTime": "2022-07-08 16:32:23"
}

本文作者:yourxiong

本文链接:https://www.cnblogs.com/yourxiong/p/16882087.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   yourxiong  阅读(156)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.