Java Code Examples for org.elasticsearch.index.mapper.internal.AllFieldMapper#IncludeInAll

The following examples show how to use org.elasticsearch.index.mapper.internal.AllFieldMapper#IncludeInAll . 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: 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 2
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 3
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 4
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);
}