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

Completely move doc values and fielddata settings to field types #12014

Merged
merged 3 commits into from Jul 6, 2015

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Jul 3, 2015

While MappedFieldType contains settings for doc values and fielddata,
AbstractFieldMapper had special logic in its constructor that
required setting these on the field type from there. This change
removes those settings from the AbstractFieldMapper constructor.
As a result, defaultDocValues(), and defaultFieldDataType() are
no longer needed, and defaultFieldType() is now an internal detail
of AbstractFieldMapper.

…types

While MappedFieldType contains settings for doc values and fielddata,
AbstractFieldMapper had special logic in its constructor that
required setting these on the field type from there. This change
removes those settings from the AbstractFieldMapper constructor.
As a result, defaultDocValues(), defaultFieldType() and
defaultFieldDataType() are no longer needed.
@rjernst rjernst added v2.0.0-beta1 :Search/Mapping Index mappings, including merging and defining field types labels Jul 3, 2015
@@ -81,7 +81,7 @@ public static boolean getSettingsRequireUnits() {
private transient ClassLoader classLoader;

Settings(Map<String, String> settings, ClassLoader classLoader) {
this.settings = ImmutableMap.copyOf(settings);
this.settings = ImmutableMap.copyOf(new TreeMap<>(settings));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need a TreeMap here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This makes the order of iteration consistent for serialization.

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed this to ImmutableSortedMap.copyOf, and added a comment that this is needed for consistent serialization. In the future, we can change this to Collections.unmodifiableMap()

@rjernst
Copy link
Member Author

rjernst commented Jul 6, 2015

Thanks @jpountz, I pushed a new commit.

@jpountz
Copy link
Contributor

jpountz commented Jul 6, 2015

LGTM

rjernst added a commit that referenced this pull request Jul 6, 2015
Completely move doc values and fielddata settings to field types
@rjernst rjernst merged commit ff0f480 into elastic:master Jul 6, 2015
@rjernst rjernst deleted the remove/mapper-doc-values branch July 6, 2015 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Mapping Index mappings, including merging and defining field types v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants