@Override public FieldNamesFieldMapper build(BuilderContext context) { setupFieldType(context); FieldNamesFieldType fieldNamesFieldType = (FieldNamesFieldType) fieldType; fieldNamesFieldType.setEnabled(enabled); return new FieldNamesFieldMapper(fieldType, fieldDataSettings, context.indexSettings()); }
public FieldNamesFieldMapper(MappedFieldType fieldType, Settings indexSettings) { super(NAME, fieldType, Defaults.FIELD_TYPE, indexSettings); this.pre13Index = Version.indexCreated(indexSettings).before(Version.V_1_3_0); if (this.pre13Index) { FieldNamesFieldType newFieldType = fieldType().clone(); newFieldType.setEnabled(false); newFieldType.freeze(); fieldTypeRef.set(newFieldType); } }