Get legacy index templates Deprecated Generally available

GET /_template/{name}

Get information about one or more index templates.

IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8. ##Required authorization

  • Cluster privileges: manage_index_templates
External documentation

Path parameters

  • name string | array[string] Required

    Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. To return all index templates, omit this parameter or use a value of _all or *.

Query parameters

  • flat_settings boolean

    If true, returns settings in flat format.

  • local boolean

    If true, the request retrieves information from the local node only.

  • master_timeout string

    Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

    Values are -1 or 0.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • * object Additional properties
      Hide * attributes Show * attributes object
      • aliases object Required
        Hide aliases attribute Show aliases attribute object
        • * object Additional properties
          Hide * attributes Show * attributes object
          • filter object

            An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

            External documentation
            Hide filter attributes Show filter attributes object
            • bool object
            • boosting object
            • common object Deprecated
            • combined_fields object
            • constant_score object
            • dis_max object
            • distance_feature
            • exists object
            • function_score object
            • fuzzy object

              Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.

              External documentation
            • geo_bounding_box object
            • geo_distance object
            • geo_grid object

              Matches geo_point and geo_shape values that intersect a grid cell from a GeoGrid aggregation.

            • geo_polygon object
            • geo_shape object
            • has_child object
            • has_parent object
            • ids object
            • intervals object

              Returns documents based on the order and proximity of matching terms.

              External documentation
            • knn object
            • match object

              Returns documents that match a provided text, number, date or boolean value. The provided text is analyzed before matching.

              External documentation
            • match_all object
            • match_bool_prefix object

              Analyzes its input and constructs a bool query from the terms. Each term except the last is used in a term query. The last term is used in a prefix query.

              External documentation
            • match_none object
            • match_phrase object

              Analyzes the text and creates a phrase query out of the analyzed text.

              External documentation
            • match_phrase_prefix object

              Returns documents that contain the words of a provided text, in the same order as provided. The last term of the provided text is treated as a prefix, matching any words that begin with that term.

              External documentation
            • more_like_this object
            • multi_match object
            • nested object
            • parent_id object
            • percolate object
            • pinned
            • prefix object

              Returns documents that contain a specific prefix in a provided field.

              External documentation
            • query_string object
            • range object

              Returns documents that contain terms within a provided range.

              External documentation
            • rank_feature object
            • regexp object

              Returns documents that contain terms matching a regular expression.

              External documentation
            • rule object
            • script object
            • script_score object
            • semantic object
            • shape object
            • simple_query_string object
            • span_containing object
            • span_field_masking object
            • span_first object
            • span_multi object
            • span_near object
            • span_not object
            • span_or object
            • span_term object

              Matches spans containing a term.

              External documentation
            • span_within object
            • sparse_vector
            • term object

              Returns documents that contain an exact term in a provided field. To return a document, the query term must exactly match the queried field's value, including whitespace and capitalization.

              External documentation
            • terms object
            • terms_set object

              Returns documents that contain a minimum number of exact terms in a provided field. To return a document, a required number of terms must exactly match the field values, including whitespace and capitalization.

              External documentation
            • text_expansion object Deprecated Generally available; Added in 8.8.0

              Uses a natural language processing model to convert the query text into a list of token-weight pairs which are then used in a query against a sparse vector or rank features field.

              External documentation
            • weighted_tokens object Deprecated Generally available; Added in 8.13.0

              Supports returning text_expansion query results by sending in precomputed tokens with the query.

              External documentation
            • wildcard object

              Returns documents that contain terms matching a wildcard pattern.

              External documentation
            • wrapper object
            • type object
          • index_routing string
          • is_hidden boolean

            If true, the alias is hidden. All indices for the alias must have the same is_hidden value.

          • is_write_index boolean

            If true, the index is the write index for the alias.

          • routing string
          • search_routing string
      • index_patterns array[string] Required
      • mappings object Required
        Hide mappings attributes Show mappings attributes object
        • all_field object
          Hide all_field attributes Show all_field attributes object
          • analyzer string Required
          • enabled boolean Required
          • omit_norms boolean Required
          • search_analyzer string Required
          • similarity string Required
          • store boolean Required
          • store_term_vector_offsets boolean Required
          • store_term_vector_payloads boolean Required
          • store_term_vector_positions boolean Required
          • store_term_vectors boolean Required
        • date_detection boolean
        • dynamic string

          Values are strict, runtime, true, or false.

        • dynamic_date_formats array[string]
        • dynamic_templates array[object]
        • _field_names object
          Hide _field_names attribute Show _field_names attribute object
          • enabled boolean Required
        • index_field object
          Hide index_field attribute Show index_field attribute object
          • enabled boolean Required
        • _meta object
          Hide _meta attribute Show _meta attribute object
          • * object Additional properties
        • numeric_detection boolean
        • properties object
        • _routing object
          Hide _routing attribute Show _routing attribute object
          • required boolean Required
        • _size object
          Hide _size attribute Show _size attribute object
          • enabled boolean Required
        • _source object
          Hide _source attributes Show _source attributes object
          • compress boolean
          • compress_threshold string
          • enabled boolean
          • excludes array[string]
          • includes array[string]
          • mode string

            Values are disabled, stored, or synthetic.

        • runtime object
          Hide runtime attribute Show runtime attribute object
          • * object Additional properties
            Hide * attributes Show * attributes object
            • fields object

              For type composite

              Hide fields attribute Show fields attribute object
              • * object Additional properties
            • fetch_fields array[object]

              For type lookup

            • format string

              A custom format for date type runtime fields.

            • input_field string

              Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

            • target_field string

              Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

            • target_index string
            • script object
              Hide script attributes Show script attributes object
              • source
              • id string
              • params object

                Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.

              • lang
              • options object
            • type string Required

              Values are boolean, composite, date, double, geo_point, geo_shape, ip, keyword, long, or lookup.

        • enabled boolean
        • subobjects string

          Values are true or false.

        • _data_stream_timestamp object
          Hide _data_stream_timestamp attribute Show _data_stream_timestamp attribute object
          • enabled boolean Required
      • order number Required
      • settings object Required
        Hide settings attribute Show settings attribute object
        • * object Additional properties
      • version number
GET /_template/{name}
GET /_template/.monitoring-*
curl \
 --request GET 'http://api.example.com/_template/{name}'

Documentation preview

This is a preview of your version @2025-06-09 which is not yet released.