-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add index level setting to unmap fields beyond total fields limit #14939
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14939 +/- ##
============================================
- Coverage 71.95% 71.95% -0.01%
+ Complexity 63128 63092 -36
============================================
Files 5196 5196
Lines 295311 295357 +46
Branches 42677 42683 +6
============================================
+ Hits 212496 212528 +32
+ Misses 65436 65380 -56
- Partials 17379 17449 +70 ☔ View full report in Codecov by Sentry. |
return true; | ||
} | ||
|
||
List<ObjectMapper> newObjectMappers = new ArrayList<>(); |
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.
This method and the one below look expensive to be happening on every new field addition. Can you optimize these?
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.
Thanks @vikasvb90 , I've made some optimization for it, the main point is to add a new field dynamicFieldCount
to the class MappingLookup
, when a new dynamic mapper is added, we increase the dynamicFieldCount
, then we check if the current total fields count exceed the limit, so we don't need to calculate the dynamic field count from the dynamicMappers every time the check happens. Please help to take a look, thank you!
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
553f304
to
814f715
Compare
❌ Gradle check result for 553f304: ABORTED Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
❕ Gradle check result for 456e8ba: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
❌ Gradle check result for 9495dae: ABORTED Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
❕ Gradle check result for 9f15262: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
This PR is stalled because it has been open for 30 days with no activity. |
Description
This PR introduces a new index level setting
index.mapping.total_fields.unmap_fields_beyond_limit
, the default value is false, if it's set to true, then all the new detected fields beyond theindex.mapping.total_fields.limit
will not be added to the mapping, not indexed, not searchable but still be stored in the_source
field.Example usage:
, we can see that the fields
field3
,field4
andfield5
are not in the mapping because the total fields limit is 3.Related Issues
#14031
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.