zoukankan      html  css  js  c++  java
  • 创建es索引-格式化和非格式化

    创建es索引-格式化和非格式化

    学习了:https://www.imooc.com/video/15768

    索引有结构化和非结构化的区分;

    1, 先创建索引,然后POST修改mapping

    首先创建索引,使用head插件中的创建索引界面进行创建;

    然后POST http://localhost:9200/book/novel/_mappings

    {
      "novel": {
        "properties": {
          "title": {
            "type": "text"
          }
        }
      }
    }

    2,直接PUT索引,同时带上mapping

    PUT http://localhost:9200/people

    {
        "settings":{
            "number_of_shards":3,
            "number_of_replicas":1
        },
        "mappings":{
            "man":{
                "properties":{
                    "name":{
                        "type":"text"
                    },
                    "country":{
                        "type":"keyword"
                    },
                    "date":{
                        "type":"date",
                        "format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
                    }
                }
            },
            "woman":{}
        }
    }
  • 相关阅读:
    黄宗禹9.11作业
    黄宗禹第一次作业
    9.11
    9.18
    计算平均速度
    圆的周长与面积
    JAVA 作业
    9.11
    9.25
    计算平均速度题
  • 原文地址:https://www.cnblogs.com/stono/p/8976648.html
Copyright © 2011-2022 走看看