Class IndexTemplateMetadata.Builder

java.lang.Object
org.elasticsearch.cluster.metadata.IndexTemplateMetadata.Builder
Enclosing class:
IndexTemplateMetadata

public static class IndexTemplateMetadata.Builder
extends java.lang.Object
  • Constructor Details

    • Builder

      public Builder​(java.lang.String name)
    • Builder

      public Builder​(IndexTemplateMetadata indexTemplateMetadata)
  • Method Details

    • order

      public IndexTemplateMetadata.Builder order​(int order)
    • version

      public IndexTemplateMetadata.Builder version​(java.lang.Integer version)
    • patterns

      public IndexTemplateMetadata.Builder patterns​(java.util.List<java.lang.String> indexPatterns)
    • settings

      public IndexTemplateMetadata.Builder settings​(Settings.Builder settings)
    • settings

      public IndexTemplateMetadata.Builder settings​(Settings settings)
    • putMapping

      public IndexTemplateMetadata.Builder putMapping​(java.lang.String mappingType, CompressedXContent mappingSource)
    • putMapping

      public IndexTemplateMetadata.Builder putMapping​(java.lang.String mappingType, java.lang.String mappingSource) throws java.io.IOException
      Throws:
      java.io.IOException
    • putAlias

      public IndexTemplateMetadata.Builder putAlias​(AliasMetadata aliasMetadata)
    • putAlias

      public IndexTemplateMetadata.Builder putAlias​(AliasMetadata.Builder aliasMetadata)
    • build

      public IndexTemplateMetadata build()
    • toXContentWithTypes

      public static void toXContentWithTypes​(IndexTemplateMetadata indexTemplateMetadata, org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Serializes the template to xContent, using the legacy format where the mappings are nested under the type name. This method is used for serializing templates before storing them in the cluster metadata, and also in the REST layer when returning a deprecated typed response.
      Throws:
      java.io.IOException
    • removeType

      public static void removeType​(IndexTemplateMetadata indexTemplateMetadata, org.elasticsearch.common.xcontent.XContentBuilder builder) throws java.io.IOException
      Removes the nested type in the xContent representation of IndexTemplateMetadata. This method is useful to help bridge the gap between an the internal representation which still uses (the legacy format) a nested type in the mapping, and the external representation which does not use a nested type in the mapping.
      Throws:
      java.io.IOException
    • toXContent

      public static void toXContent​(IndexTemplateMetadata indexTemplateMetadata, org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Serializes the template to xContent, making sure not to nest mappings under the type name. Note that this method should currently only be used for creating REST responses, and not when directly updating stored templates. Index templates are still stored in the old, typed format, and have yet to be migrated to be typeless.
      Throws:
      java.io.IOException
    • fromXContent

      public static IndexTemplateMetadata fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser, java.lang.String templateName) throws java.io.IOException
      Throws:
      java.io.IOException