Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.core.CheckedFunction;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.xcontent.ConstructingObjectParser;
import org.elasticsearch.xcontent.ParseField;
Expand All @@ -30,9 +28,6 @@
* display values of this field.
*/
public final class FieldAndFormat implements Writeable, ToXContentObject {
private static final String USE_DEFAULT_FORMAT = "use_field_mapping";
private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(FetchDocValuesPhase.class);

public static final ParseField FIELD_FIELD = new ParseField("field");
public static final ParseField FORMAT_FIELD = new ParseField("format");
public static final ParseField INCLUDE_UNMAPPED_FIELD = new ParseField("include_unmapped");
Expand All @@ -48,28 +43,6 @@ public final class FieldAndFormat implements Writeable, ToXContentObject {
PARSER.declareBoolean(ConstructingObjectParser.optionalConstructorArg(), INCLUDE_UNMAPPED_FIELD);
}

private static CheckedFunction<XContentParser, String, IOException> ignoreUseFieldMappingStringParser() {
return (p) -> {
if (p.currentToken() == XContentParser.Token.VALUE_NULL) {
return null;
} else {
String text = p.text();
if (text.equals(USE_DEFAULT_FORMAT)) {
DEPRECATION_LOGGER.compatibleCritical(
"explicit_default_format",
"["
+ USE_DEFAULT_FORMAT
+ "] is a special format that was only used to "
+ "ease the transition to 7.x. It has become the default and shouldn't be set explicitly anymore."
);
return null;
} else {
return text;
}
}
};
}

/**
* Parse a {@link FieldAndFormat} from some {@link XContent}.
*/
Expand Down
Loading