Class MapperService

    • Field Detail

      • SINGLE_MAPPING_NAME

        public static final java.lang.String SINGLE_MAPPING_NAME
        See Also:
        Constant Field Values
      • INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING

        public static final Setting<java.lang.Long> INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING
      • INDEX_MAPPING_NESTED_DOCS_LIMIT_SETTING

        public static final Setting<java.lang.Long> INDEX_MAPPING_NESTED_DOCS_LIMIT_SETTING
      • INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING

        public static final Setting<java.lang.Long> INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING
      • INDEX_MAPPING_DEPTH_LIMIT_SETTING

        public static final Setting<java.lang.Long> INDEX_MAPPING_DEPTH_LIMIT_SETTING
      • INDEX_MAPPER_DYNAMIC_DEFAULT

        public static final boolean INDEX_MAPPER_DYNAMIC_DEFAULT
        See Also:
        Constant Field Values
      • INDEX_MAPPER_DYNAMIC_SETTING

        @Deprecated
        public static final Setting<java.lang.Boolean> INDEX_MAPPER_DYNAMIC_SETTING
        Deprecated.
    • Method Detail

      • hasNested

        public boolean hasNested()
      • getNamedAnalyzer

        public NamedAnalyzer getNamedAnalyzer​(java.lang.String analyzerName)
      • parseMapping

        public static java.util.Map<java.lang.String,​java.lang.Object> parseMapping​(NamedXContentRegistry xContentRegistry,
                                                                                          java.lang.String mappingSource)
                                                                                   throws java.lang.Exception
        Parses the mappings (formatted as JSON) into a map
        Throws:
        java.lang.Exception
      • updateMapping

        public boolean updateMapping​(IndexMetaData currentIndexMetaData,
                                     IndexMetaData newIndexMetaData)
                              throws java.io.IOException
        Update mapping by only merging the metadata that is different between received and stored entries
        Throws:
        java.io.IOException
      • merge

        public void merge​(java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.Object>> mappings,
                          MapperService.MergeReason reason)
      • documentMapper

        public DocumentMapper documentMapper()
        Return the document mapper, or null if no mapping has been put yet.
      • documentMapperWithAutoCreate

        public DocumentMapperForType documentMapperWithAutoCreate​(java.lang.String type)
        Returns the document mapper created, including a mapping update if the type has been dynamically created.
      • fullName

        public MappedFieldType fullName​(java.lang.String fullName)
        Returns the MappedFieldType for the give fullName. If multiple types have fields with the same full name, the first is returned.
      • simpleMatchToFullName

        public java.util.Collection<java.lang.String> simpleMatchToFullName​(java.lang.String pattern)
        Returns all the fields that match the given pattern. If the pattern is prefixed with a type then the fields will be returned with a type prefix.
      • fieldTypes

        public java.lang.Iterable<MappedFieldType> fieldTypes()
        Returns all mapped field types.
      • getObjectMapper

        public ObjectMapper getObjectMapper​(java.lang.String name)
      • unmappedFieldType

        public MappedFieldType unmappedFieldType​(java.lang.String type)
        Given a type (eg. long, string, ...), return an anonymous field mapper that can be used for search operations.
      • indexAnalyzer

        public org.apache.lucene.analysis.Analyzer indexAnalyzer()
      • searchAnalyzer

        public org.apache.lucene.analysis.Analyzer searchAnalyzer()
      • searchQuoteAnalyzer

        public org.apache.lucene.analysis.Analyzer searchQuoteAnalyzer()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • isMetadataField

        public static boolean isMetadataField​(java.lang.String fieldName)
        Returns:
        Whether a field is a metadata field.
      • getAllMetaFields

        public static java.lang.String[] getAllMetaFields()