-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ML] Disable dynamic mapping to DFA dest index #65972
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -321,10 +321,10 @@ public void testFieldCardinalityLimitsIsEmpty() { | |
| assertThat(createTestInstance().getFieldCardinalityConstraints(), is(empty())); | ||
| } | ||
|
|
||
| public void testGetExplicitlyMappedFields() { | ||
| Map<String, Object> explicitlyMappedFields = new Regression("foo").getExplicitlyMappedFields("results", null); | ||
| assertThat(explicitlyMappedFields, hasEntry("results.foo_prediction", Collections.singletonMap("type", "double"))); | ||
| assertThat(explicitlyMappedFields, hasEntry("results.feature_importance", Regression.FEATURE_IMPORTANCE_MAPPING)); | ||
| public void testGetResultMappings() { | ||
| Map<String, Object> resultMappings = new Regression("foo").getResultMappings("results", null); | ||
| assertThat(resultMappings, hasEntry("results.foo_prediction", Collections.singletonMap("type", "double"))); | ||
| assertThat(resultMappings, hasEntry("results.feature_importance", Regression.FEATURE_IMPORTANCE_MAPPING)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also add |
||
| } | ||
|
|
||
| public void testGetStateDocId() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,12 @@ public void testMergeMappings_GivenIndicesWithIdenticalMappings() { | |
|
|
||
| MappingMetadata mergedMappings = MappingsMerger.mergeMappings(newSource(), getMappingsResponse); | ||
|
|
||
| assertThat(mergedMappings.getSourceAsMap(), equalTo(index1Mappings)); | ||
| Map<String, Object> mergedMappingsMap = mergedMappings.getSourceAsMap(); | ||
| assertThat(mergedMappingsMap.size(), equalTo(2)); | ||
| assertThat(mergedMappingsMap.containsKey("dynamic"), is(true)); | ||
| assertThat(mergedMappingsMap.get("dynamic"), equalTo(false)); | ||
| assertThat(mergedMappingsMap.containsKey("properties"), is(true)); | ||
| assertThat(mergedMappingsMap.get("properties"), equalTo(index1Mappings.get("properties"))); | ||
|
||
| } | ||
|
|
||
| public void testMergeMappings_GivenFieldWithDifferentMapping() { | ||
|
|
@@ -80,7 +85,9 @@ public void testMergeMappings_GivenIndicesWithDifferentMappingsButNoConflicts() | |
| MappingMetadata mergedMappings = MappingsMerger.mergeMappings(newSource(), getMappingsResponse); | ||
|
|
||
| Map<String, Object> mappingsAsMap = mergedMappings.getSourceAsMap(); | ||
| assertThat(mappingsAsMap.size(), equalTo(1)); | ||
| assertThat(mappingsAsMap.size(), equalTo(2)); | ||
| assertThat(mappingsAsMap.containsKey("dynamic"), is(true)); | ||
| assertThat(mappingsAsMap.get("dynamic"), equalTo(false)); | ||
| assertThat(mappingsAsMap.containsKey("properties"), is(true)); | ||
|
|
||
| @SuppressWarnings("unchecked") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[optional] An alternative which I sometimes find more readable is: