@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); } }
@Override public void checkCompatibility( MappedFieldType fieldType, List<String> conflicts, boolean strict) { if (strict) { FieldNamesFieldType other = (FieldNamesFieldType) fieldType; if (isEnabled() != other.isEnabled()) { conflicts.add( "mapper [" + names().fullName() + "] is used by multiple types. Set update_all_types to true to update [enabled] across all types."); } } }