Class PutMappingRequest

    • Constructor Detail

      • PutMappingRequest

        public PutMappingRequest()
      • PutMappingRequest

        public PutMappingRequest​(java.lang.String... indices)
        Constructs a new put mapping request against one or more indices. If nothing is set then it will be executed against all indices.
    • Method Detail

      • setConcreteIndex

        public PutMappingRequest setConcreteIndex​(Index index)
        Sets a concrete index for this put mapping request.
      • getConcreteIndex

        public Index getConcreteIndex()
        Returns a concrete index for this mapping or null if no concrete index is defined
      • indices

        public java.lang.String[] indices()
        The indices the mappings will be put.
        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
      • type

        public java.lang.String type()
        The mapping type.
      • type

        public PutMappingRequest type​(java.lang.String type)
        The type of the mappings.
      • source

        public java.lang.String source()
        The mapping source definition.
      • source

        public PutMappingRequest source​(java.lang.Object... source)
        A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true"). Also supports metadata mapping fields such as `_all` and `_parent` as property definition, these metadata mapping fields will automatically be put on the top level mapping object.
      • origin

        public java.lang.String origin()
      • buildFromSimplifiedDef

        public static XContentBuilder buildFromSimplifiedDef​(java.lang.String type,
                                                             java.lang.Object... source)
        Parameters:
        type - the mapping type
        source - consisting of field/properties pairs (e.g. "field1", "type=string,store=true")
        Returns:
        the mappings definition
        Throws:
        java.lang.IllegalArgumentException - if the number of the source arguments is not divisible by two
      • source

        public PutMappingRequest source​(java.util.Map mappingSource)
        The mapping source definition.
      • updateAllTypes

        public boolean updateAllTypes()
        True if all fields that span multiple types should be updated, false otherwise
      • updateAllTypes

        @Deprecated
        public PutMappingRequest updateAllTypes​(boolean updateAllTypes)
        Deprecated.
        useless with 6.x indices which may only have one type
        True if all fields that span multiple types should be updated, false otherwise.