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

Disallow `include_in_all` for 6.0+ indices #22970

Merged
merged 1 commit into from Feb 8, 2017

Conversation

Projects
None yet
2 participants
@dakrone
Member

dakrone commented Feb 3, 2017

Since _all is now deprecated and cannot be set for new indices, we should also
disallow any field that has the include_in_all parameter set.

Resolves #22923

@dakrone

This comment has been minimized.

Member

dakrone commented Feb 3, 2017

I'll open a separate PR for deprecating this in 5.x

dakrone added a commit to dakrone/elasticsearch that referenced this pull request Feb 6, 2017

@imotov

imotov approved these changes Feb 7, 2017

Left one very minor comment. LGTM.

core/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java Outdated
@@ -247,6 +247,9 @@ public static void parseField(FieldMapper.Builder builder, String name, Map<Stri
if (parserContext.isWithinMultiField()) {
throw new MapperParsingException("include_in_all in multi fields is not allowed. Found the include_in_all in field ["
+ name + "] which is within a multi field.");
} else if (parserContext.indexVersionCreated().onOrAfter(Version.V_6_0_0_alpha1_UNRELEASED)) {
throw new MapperParsingException("[include_in_all] is not allowed for indices created on or after version 6.0.0 as " +
"[_all] is deprecated.");

This comment has been minimized.

@imotov

imotov Feb 7, 2017

Member

I think it might be a useful to repeat the same message you added to _all field here. Something like "As a replacement, you can use an [copy_to] on mapping fields to create your own catch all field."

This comment has been minimized.

@dakrone

dakrone Feb 8, 2017

Member

Sure, I'll do that!

@dakrone

This comment has been minimized.

Member

dakrone commented Feb 8, 2017

Thanks @imotov!

Disallow include_in_all for 6.0+ indices
Since `_all` is now deprecated and cannot be set for new indices, we should also
disallow any field that has the `include_in_all` parameter set.

Resolves #22923

@dakrone dakrone merged commit b3c27a7 into elastic:master Feb 8, 2017

1 of 2 checks passed

elasticsearch-ci Build started sha1 is merged.
Details
CLA Commit author has signed the CLA
Details

@clintongormley clintongormley changed the title from Disallow include_in_all for 6.0+ indices to Disallow `include_in_all` for 6.0+ indices May 5, 2017

@dakrone dakrone deleted the dakrone:disallow-include-in-all branch May 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment