ES索引映射信息

33 阅读1分钟
{
  "es_db" : {
    "aliases" : { },
    "mappings" : {
      "properties" : {
        "address" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "age" : {
          "type" : "long"
        },
        "name" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "rmark" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "sex" : {
          "type" : "long"
        }
      }
    },
    "settings" : {
      "index" : {
        "routing" : {
          "allocation" : {
            "include" : {
              "_tier_preference" : "data_content"
            }
          }
        },
        "number_of_shards" : "1",
        "provided_name" : "es_db",
        "creation_date" : "1695537727008",
        "number_of_replicas" : "1",
        "uuid" : "HHVdin5kQTqzSE9zx0Dodw",
        "version" : {
          "created" : "7130499"
        }
      }
    }
  }
}

  • "es_db": 这是索引的名称。
  • "aliases": 索引别名,这个索引当前没有定义别名。
  • "mappings": 开始定义索引中的字段映射。
  • "properties": 映射的字段列表。
  • "address": 定义了一个名称为address的字段。
  • "type": address字段的类型是text,表示文本类型。
  • "fields": address的子字段配置。
  • "keyword": address的一个子字段,类型是keyword,用于排序、聚合等操作。
  • "ignore_above": keyword子字段的忽略超过256个字符的限制。
  • "age": 另一个字段,类型是long,表示长整型。
  • "name": 另一个文本类型字段。
  • "sex": 字段类型是long。
  • "settings": 开始定义索引设置。
  • "index": 索引特定设置。
  • "routing": 自定义路由设置。
  • "allocation": 分片分配设置。
  • "number_of_shards": 主分片数设置为1。
  • "number_of_replicas": 复制分片数设置为1。
  • "uuid": 索引唯一标识。
  • "version": 版本信息。