org.elasticsearch.index.mapper.internal.AllFieldMapper Java Examples

The following examples show how to use org.elasticsearch.index.mapper.internal.AllFieldMapper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IndexQueryParserService.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Inject
public IndexQueryParserService(Index index, IndexSettingsService indexSettingsService,
                               IndicesQueriesRegistry indicesQueriesRegistry,
                               ScriptService scriptService, AnalysisService analysisService,
                               MapperService mapperService, IndexCache indexCache, IndexFieldDataService fieldDataService,
                               BitsetFilterCache bitsetFilterCache,
                               @Nullable SimilarityService similarityService) {
    super(index, indexSettingsService.getSettings());
    this.indexSettingsService = indexSettingsService;
    this.scriptService = scriptService;
    this.analysisService = analysisService;
    this.mapperService = mapperService;
    this.similarityService = similarityService;
    this.indexCache = indexCache;
    this.fieldDataService = fieldDataService;
    this.bitsetFilterCache = bitsetFilterCache;

    Settings indexSettings = indexSettingsService.getSettings();
    this.defaultField = indexSettings.get(DEFAULT_FIELD, AllFieldMapper.NAME);
    this.queryStringLenient = indexSettings.getAsBoolean(QUERY_STRING_LENIENT, false);
    this.parseFieldMatcher = new ParseFieldMatcher(indexSettings);
    this.defaultAllowUnmappedFields = indexSettings.getAsBoolean(ALLOW_UNMAPPED, true);
    this.indicesQueriesRegistry = indicesQueriesRegistry;
}
 
Example #2
Source File: ObjectMapper.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public ObjectMapper includeInAllIfNotSet(Boolean includeInAll) {
    if (includeInAll == null || this.includeInAll != null) {
        return this;
    }

    ObjectMapper clone = clone();
    clone.includeInAll = includeInAll;
    // when called from outside, apply this on all the inner mappers
    for (Mapper mapper : clone.mappers.values()) {
        if (mapper instanceof AllFieldMapper.IncludeInAll) {
            clone.putMapper(((AllFieldMapper.IncludeInAll) mapper).includeInAllIfNotSet(includeInAll));
        }
    }
    return clone;
}
 
Example #3
Source File: FieldMapper.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
private MultiFields(ContentPath.Type pathType, ImmutableOpenMap<String, FieldMapper> mappers) {
    this.pathType = pathType;
    ImmutableOpenMap.Builder<String, FieldMapper> builder = new ImmutableOpenMap.Builder<>();
    // we disable the all in multi-field mappers
    for (ObjectObjectCursor<String, FieldMapper> cursor : mappers) {
        FieldMapper mapper = cursor.value;
        if (mapper instanceof AllFieldMapper.IncludeInAll) {
            mapper = (FieldMapper) ((AllFieldMapper.IncludeInAll) mapper).unsetIncludeInAll();
        }
        builder.put(cursor.key, mapper);
    }
    this.mappers = builder.build();
}
 
Example #4
Source File: ObjectMapper.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public ObjectMapper unsetIncludeInAll() {
    if (includeInAll == null) {
        return this;
    }
    ObjectMapper clone = clone();
    clone.includeInAll = null;
    // when called from outside, apply this on all the inner mappers
    for (Mapper mapper : mappers.values()) {
        if (mapper instanceof AllFieldMapper.IncludeInAll) {
            clone.putMapper(((AllFieldMapper.IncludeInAll) mapper).unsetIncludeInAll());
        }
    }
    return clone;
}
 
Example #5
Source File: MapperTestUtils.java    From elasticsearch-analysis-baseform with Apache License 2.0 5 votes vote down vote up
private static Map<String, MetadataFieldMapper.TypeParser> registerBuiltInMetadataMappers() {
    Map<String, MetadataFieldMapper.TypeParser> metadataMapperParsers = new LinkedHashMap<>();
    metadataMapperParsers.put(UidFieldMapper.NAME, new UidFieldMapper.TypeParser());
    metadataMapperParsers.put(IdFieldMapper.NAME, new IdFieldMapper.TypeParser());
    metadataMapperParsers.put(RoutingFieldMapper.NAME, new RoutingFieldMapper.TypeParser());
    metadataMapperParsers.put(IndexFieldMapper.NAME, new IndexFieldMapper.TypeParser());
    metadataMapperParsers.put(SourceFieldMapper.NAME, new SourceFieldMapper.TypeParser());
    metadataMapperParsers.put(TypeFieldMapper.NAME, new TypeFieldMapper.TypeParser());
    metadataMapperParsers.put(AllFieldMapper.NAME, new AllFieldMapper.TypeParser());
    metadataMapperParsers.put(TimestampFieldMapper.NAME, new TimestampFieldMapper.TypeParser());
    metadataMapperParsers.put(TTLFieldMapper.NAME, new TTLFieldMapper.TypeParser());
    metadataMapperParsers.put(VersionFieldMapper.NAME, new VersionFieldMapper.TypeParser());
    metadataMapperParsers.put(ParentFieldMapper.NAME, new ParentFieldMapper.TypeParser());
    return metadataMapperParsers;
}
 
Example #6
Source File: DocumentMapper.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public AllFieldMapper allFieldMapper() {
    return metadataMapper(AllFieldMapper.class);
}
 
Example #7
Source File: ObjectMapper.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
protected void putMapper(Mapper mapper) {
    if (mapper instanceof AllFieldMapper.IncludeInAll) {
        mapper = ((AllFieldMapper.IncludeInAll) mapper).includeInAllIfNotSet(includeInAll);
    }
    mappers = mappers.copyAndPut(mapper.simpleName(), mapper);
}