elasticsearch 创建索引模版template

添加索引代码如下:

PUT _template/redsmg-chandemo
{
    "order" : 2,
    "index_patterns" : [
      "redsmg-chandemo_*"
    ],
    "mappings" : {
      "doc" : {
        "dynamic_templates" : [
          {
            "string_as_num" : {
              "mapping" : {
                "type" : "keyword"
              },
              "match_mapping_type" : "string",
              "match" : "CCHR_*"
            }
          },
          {
            "strings" : {
              "mapping" : {
                "type" : "keyword"
              },
              "match_mapping_type" : "string",
              "match" : "SERVICE_*"
            }
          }
        ],
        "properties" : {
          "ticketId" : {
            "type" : "keyword"
          },
          "NOTES" : {
            "type" : "keyword"
          },
          "CREATE_DATE" : {
            "format" : "strict_date_optional_time||epoch_second",
            "type" : "date"
          },
          "@timestamp" : {
            "format" : "strict_date_optional_time||epoch_millis",
            "type" : "date"
          },
          "ACTUAL_END_DATE" : {
            "format" : "strict_date_optional_time||epoch_second",
            "type" : "date"
          },
          "CDT_SCHEDULEDENDDATE" : {
            "format" : "strict_date_optional_time||epoch_second",
            "type" : "date"
          },
          "CDT_SCHEDULEDSTARTDATE" : {
            "format" : "strict_date_optional_time||epoch_second",
            "type" : "date"
          },
          "SCHEDULED_START_DATE" : {
            "format" : "strict_date_optional_time||epoch_second",
            "type" : "date"
          },
          "CCHR_CHANGEID" : {
            "type" : "keyword"
          },
          "MODIFIED_DATE" : {
            "format" : "strict_date_optional_time||epoch_second",
            "type" : "date"
          },
          "ACTUAL_START_DATE" : {
            "format" : "strict_date_optional_time||epoch_second",
            "type" : "date"
          },
          "SCHEDULED_END_DATE" : {
            "format" : "strict_date_optional_time||epoch_second",
            "type" : "date"
          },
          "TASKNAME" : {
            "norms" : false,
            "type" : "keyword"
          }
        }
      }
    },
    "aliases" : { }
  }

你可能感兴趣的:(elasticsearch,elasticsearch,java,大数据)