美文网首页
elasticsearch使用es-head在已有索引中新增字段

elasticsearch使用es-head在已有索引中新增字段

作者: 呼啦啦zz | 来源:发表于2019-11-13 20:10 被阅读0次

    elasticsearch版本7.0,7.0版本有默认的type,8.0会彻底废弃

    1、向索引idx_resource添加image_analyse字段,类型为text

    语句:

    {

        “properties”:{

                "image_analyse":{

                            "type":"text"

                    }

            }

    }

    2、向索引中更新某条数据的某个字段

    :http://localhost:9200/index/type/id

    其中index、type是必填的。

    id是可选的,,不提供es自动生成。

    index、type将信息进行分层,利于管理。

    index可以理解为数据库,type理解为数据表,id相当于数据库表中记录的主键,具有唯一性。

    http://localhost:9200/idx_resource/_doc/247134

    PUT

    {

          "catalog_id":7,

          "image_analyse":"深圳光盘日行动"

    }

    注:更新语句中的字段若没有,则此字段的值默认为空

    相关文章

      网友评论

          本文标题:elasticsearch使用es-head在已有索引中新增字段

          本文链接:https://www.haomeiwen.com/subject/dhmkictx.html