ObjectMapper( String name, String fullPath, boolean enabled, Nested nested, Dynamic dynamic, ContentPath.Type pathType, Map<String, Mapper> mappers, @Nullable @IndexSettings Settings settings) { this.name = name; this.fullPath = fullPath; this.enabled = enabled; this.nested = nested; this.dynamic = dynamic; this.pathType = pathType; this.mappers = UpdateInPlaceMap.of(MapperService.getFieldMappersCollectionSwitch(settings)); if (mappers != null) { UpdateInPlaceMap<String, Mapper>.Mutator mappersMutator = this.mappers.mutator(); mappersMutator.putAll(mappers); mappersMutator.close(); } this.nestedTypePathAsString = "__" + fullPath; this.nestedTypePathAsBytes = new BytesRef(nestedTypePathAsString); this.nestedTypeFilter = new TermFilter(new Term(TypeFieldMapper.NAME, nestedTypePathAsBytes)); }
public OntologyMapper( FieldMapper.Names names, FieldType fieldType, Boolean docValues, NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer, PostingsFormatProvider postingsFormat, DocValuesFormatProvider docValuesFormat, SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings, MultiFields multiFields, OntologySettings oSettings, Map<String, FieldMapper<String>> fieldMappers, ThreadPool threadPool) { super( names, 1f, fieldType, docValues, searchAnalyzer, indexAnalyzer, postingsFormat, docValuesFormat, similarity, null, fieldDataSettings, indexSettings, multiFields, null); this.ontologySettings = oSettings; // Mappers are added to mappers map as they are used/created this.mappers = UpdateInPlaceMap.of(MapperService.getFieldMappersCollectionSwitch(indexSettings)); mappers.mutator().putAll(fieldMappers).close(); this.threadPool = threadPool; }