How to validated index templates

Hello,

I am trying to use multiple index templates in elasticsearch and need to verify that the final index template, after they are merged together by elasticsearch, is what I was aiming for. For example, if I add the following templates:

PUT /_template/red-base
{
  "index_patterns": [
    "red-*"
  ],
  "order": 25,
  "settings": {
    "analysis": {
      "normalizer": {
        "lowerascii": {
          "type": "custom",
          "char_filter": [],
          "filter": [
            "lowercase",
            "asciifolding"
          ]
        }
      },
      "analyzer": {
        "autocomplete": {
          "filter": [
            "lowercase"
          ],
          "tokenizer": "autocomplete"
        },
        "autocomplete_search": {
          "tokenizer": "lowercase"
        }
      },
      "tokenizer": {
        "autocomplete": {
          "max_gram": 10,
          "min_gram": 2,
          "token_chars": [
            "letter",
            "digit",
            "symbol"
          ],
          "type": "edge_ngram"
        }
      }
    }
  },
  "mappings": {
    "_default_": {
      "_size": {
        "enabled": "true"
      },
      "dynamic_templates": [
        {
          "string_fields": {
            "match_mapping_type": "string",
            "mapping": {
              "fields": {
                "raw": {
                  "type": "text"
                },
                "original": {
                  "type": "keyword"
                }
              },
              "type": "keyword",
              "normalizer": "lowerascii",
              "analyzer": "autocomplete",
              "search_analyzer": "autocomplete_search"
            }
          }
        }
      ]
    }
  },
  "aliases": {}
}
PUT /_template/red-networkinfo
{
  "index_patterns": [
    "red-networkinfo*"
  ],
  "order": 250,
  "mappings": {
    "_default_": {
      "properties": {
        "realip": {
          "type": "ip"
        }
      }
    }
  }
}

How can I determine what the final, combined index template for a 'red-networkinfo-01' index is?

Hi @TeraInferno

You can easily test by adding a document in a red-networkinfo-01 index with a string field and a field realip with an IP value inside.

POST red-networkinfo-01/doc/1
{
   "foo": "bar",
   "realip": "172.0.0.1"
}

Ten you can confirm by checking the mapping.

GET red-networkinfo-01/doc/_mapping

it will return the defined mapping.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.