Class PutIndexTemplateRequest

    • Constructor Detail

      • PutIndexTemplateRequest

        public PutIndexTemplateRequest​(StreamInput in)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • PutIndexTemplateRequest

        public PutIndexTemplateRequest()
      • PutIndexTemplateRequest

        public PutIndexTemplateRequest​(java.lang.String name)
        Constructs a new put index template request with the provided name.
    • Method Detail

      • name

        public java.lang.String name()
        The name of the index template.
      • patterns

        public java.util.List<java.lang.String> patterns()
      • order

        public int order()
      • version

        public java.lang.Integer version()
      • create

        public PutIndexTemplateRequest create​(boolean create)
        Set to true to force only creation, not an update of an index template. If it already exists, it will fail with an IllegalArgumentException.
      • create

        public boolean create()
      • settings

        public PutIndexTemplateRequest settings​(java.lang.String source,
                                                XContentType xContentType)
        The settings to create the index template with (either json/yaml format).
      • settings

        public PutIndexTemplateRequest settings​(java.util.Map<java.lang.String,​java.lang.Object> source)
        The settings to create the index template with (either json or yaml format).
      • mapping

        public PutIndexTemplateRequest mapping​(java.lang.String type,
                                               java.lang.String source,
                                               XContentType xContentType)
        Adds mapping that will be added when the index gets created.
        Parameters:
        type - The mapping type
        source - The mapping source
        xContentType - The type of content contained within the source
      • cause

        public PutIndexTemplateRequest cause​(java.lang.String cause)
        The cause for this index template creation.
      • cause

        public java.lang.String cause()
      • mapping

        public PutIndexTemplateRequest mapping​(java.lang.String type,
                                               XContentBuilder source)
        Adds mapping that will be added when the index gets created.
        Parameters:
        type - The mapping type
        source - The mapping source
      • mapping

        public PutIndexTemplateRequest mapping​(java.lang.String type,
                                               BytesReference source,
                                               XContentType xContentType)
        Adds mapping that will be added when the index gets created.
        Parameters:
        type - The mapping type
        source - The mapping source
        xContentType - the source content type
      • mapping

        public PutIndexTemplateRequest mapping​(java.lang.String type,
                                               java.util.Map<java.lang.String,​java.lang.Object> source)
        Adds mapping that will be added when the index gets created.
        Parameters:
        type - The mapping type
        source - The mapping source
      • mapping

        public PutIndexTemplateRequest mapping​(java.lang.String type,
                                               java.lang.Object... source)
        A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true").
      • mappings

        public java.util.Map<java.lang.String,​java.lang.String> mappings()
      • source

        public PutIndexTemplateRequest source​(java.util.Map<java.lang.String,​java.lang.Object> templateSource)
        The template source definition.
      • aliases

        public java.util.Set<Alias> aliases()
      • aliases

        public PutIndexTemplateRequest aliases​(java.util.Map<java.lang.String,​?> source)
        Sets the aliases that will be associated with the index when it gets created
      • aliases

        public PutIndexTemplateRequest aliases​(java.lang.String source)
        Sets the aliases that will be associated with the index when it gets created
      • alias

        public PutIndexTemplateRequest alias​(Alias alias)
        Adds an alias that will be added when the index gets created.
        Parameters:
        alias - The metadata for the new alias
        Returns:
        the index template creation request
      • indices

        public java.lang.String[] indices()
        Description copied from interface: IndicesRequest
        Returns the array of indices that the action relates to
        Specified by:
        indices in interface IndicesRequest
      • indicesOptions

        public IndicesOptions indicesOptions()
        Description copied from interface: IndicesRequest
        Returns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.
        Specified by:
        indicesOptions in interface IndicesRequest