Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always write doc_values param to mapping for wildcard field #16988

Merged
Merged
Show file tree
Hide file tree
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 @@ -101,7 +101,7 @@ public static final class Builder extends ParametrizedFieldMapper.Builder {
);
private final Parameter<String> normalizer = Parameter.stringParam("normalizer", false, m -> toType(m).normalizerName, "default");
private final Parameter<Map<String, String>> meta = Parameter.metaParam();
private final Parameter<Boolean> hasDocValues = Parameter.docValuesParam(m -> toType(m).hasDocValues, false);
private final Parameter<Boolean> hasDocValues = Parameter.docValuesParam(m -> toType(m).hasDocValues, false).alwaysSerialize();
private final IndexAnalyzers indexAnalyzers;

public Builder(String name, IndexAnalyzers indexAnalyzers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class WildcardFieldMapperTests extends MapperTestCase {
@Override
protected void minimalMapping(XContentBuilder b) throws IOException {
b.field("type", "wildcard");
b.field("doc_values", false);
}

@Override
Expand All @@ -59,7 +60,10 @@ protected void writeFieldValue(XContentBuilder builder) throws IOException {
@Override
protected void registerParameters(ParameterChecker checker) throws IOException {
checker.registerConflictCheck("normalizer", b -> b.field("normalizer", "lowercase"));
checker.registerConflictCheck("doc_values", b -> b.field("doc_values", true));
checker.registerConflictCheck("doc_values", fieldMapping(this::minimalMapping), fieldMapping(xcb -> {
xcb.field("type", "wildcard");
xcb.field("doc_values", true);
}));
checker.registerConflictCheck("null_value", b -> b.field("null_value", "foo"));
checker.registerUpdateCheck(b -> b.field("ignore_above", 256), m -> assertEquals(256, ((WildcardFieldMapper) m).ignoreAbove()));
}
Expand Down
Loading