1212import org .elasticsearch .common .io .stream .StreamInput ;
1313import org .elasticsearch .common .io .stream .StreamOutput ;
1414import org .elasticsearch .common .io .stream .Writeable ;
15- import org .elasticsearch .common .logging .DeprecationLogger ;
16- import org .elasticsearch .core .CheckedFunction ;
1715import org .elasticsearch .core .Nullable ;
1816import org .elasticsearch .xcontent .ConstructingObjectParser ;
1917import org .elasticsearch .xcontent .ParseField ;
3028 * display values of this field.
3129 */
3230public final class FieldAndFormat implements Writeable , ToXContentObject {
33- private static final String USE_DEFAULT_FORMAT = "use_field_mapping" ;
34- private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger .getLogger (FetchDocValuesPhase .class );
35-
3631 public static final ParseField FIELD_FIELD = new ParseField ("field" );
3732 public static final ParseField FORMAT_FIELD = new ParseField ("format" );
3833 public static final ParseField INCLUDE_UNMAPPED_FIELD = new ParseField ("include_unmapped" );
@@ -48,28 +43,6 @@ public final class FieldAndFormat implements Writeable, ToXContentObject {
4843 PARSER .declareBoolean (ConstructingObjectParser .optionalConstructorArg (), INCLUDE_UNMAPPED_FIELD );
4944 }
5045
51- private static CheckedFunction <XContentParser , String , IOException > ignoreUseFieldMappingStringParser () {
52- return (p ) -> {
53- if (p .currentToken () == XContentParser .Token .VALUE_NULL ) {
54- return null ;
55- } else {
56- String text = p .text ();
57- if (text .equals (USE_DEFAULT_FORMAT )) {
58- DEPRECATION_LOGGER .compatibleCritical (
59- "explicit_default_format" ,
60- "["
61- + USE_DEFAULT_FORMAT
62- + "] is a special format that was only used to "
63- + "ease the transition to 7.x. It has become the default and shouldn't be set explicitly anymore."
64- );
65- return null ;
66- } else {
67- return text ;
68- }
69- }
70- };
71- }
72-
7346 /**
7447 * Parse a {@link FieldAndFormat} from some {@link XContent}.
7548 */
0 commit comments