Skip to content

Add limit to total number of fields in mapping #17203

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

Closed
wants to merge 0 commits into from

Conversation

yanjunh
Copy link
Contributor

@yanjunh yanjunh commented Mar 19, 2016

Closes #13547
This is to prevent mapping explosion when dynamic keys such as UUID are used as field names. index.mapping.total_fields.limit specifies the total number of fields an index can have. An exception will be thrown when the limit is reached. The default limit is 0 which means no limit. This setting is runtime adjustable.

@@ -84,6 +84,8 @@
public static final String DEFAULT_MAPPING = "_default_";
public static final Setting<Long> INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING =
Setting.longSetting("index.mapping.nested_fields.limit", 50L, 0, Property.Dynamic, Property.IndexScope);
public static final Setting<Long> INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING =
Setting.longSetting("index.mapping.total_fields.limit", 0, 0, Property.Dynamic, Property.IndexScope);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seemed to be consensus about setting a default limit of 1000 in #13547. Let's do that?

@jpountz
Copy link
Contributor

jpountz commented Mar 22, 2016

Thanks @yanjunh. Would you mind adding some docs a test that enables the limit and makes sure that you get an exception when trying to add more fields? (like #15989)

@jpountz jpountz self-assigned this Mar 22, 2016
@yanjunh
Copy link
Contributor Author

yanjunh commented Mar 24, 2016

@jpountz Sure. I will take a look this weekend. thanks.

@clintongormley clintongormley added the :Search Foundations/Mapping Index mappings, including merging and defining field types label Mar 24, 2016
@yanjunh yanjunh closed this Mar 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement resiliency :Search Foundations/Mapping Index mappings, including merging and defining field types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants