-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Auto generate index.routing_path from mapping #86790
Auto generate index.routing_path from mapping #86790
Conversation
11154a5
to
27c3ca8
Compare
27c3ca8
to
64fcfb8
Compare
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.
It makes sense to me. I'm not particularly worried about the overhead involved when validating templates. I think it's a fairly infrequent action - just on template PUT. Is that true?
@@ -92,4 +118,54 @@ public Settings getAdditionalIndexSettings( | |||
return Settings.EMPTY; | |||
} | |||
|
|||
// Find fields in mapping that are of type keyword and time_series_dimension enabled. |
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.
I'd use javadoc for this. It'll show up when you mouseover the method in your IDE which is kind of nice.
@@ -633,10 +634,11 @@ protected Node( | |||
searchModule.getRequestCacheKeyDifferentiator() | |||
); | |||
|
|||
final var parameters = new IndexSettingProvider.Parameters(indicesService::createIndexMapperService); |
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.
While I'm thinking about it - could you make another PR that renames createIndexMapperService
to createIndexMapperServiceForValidation
or something? The name of the method feels so innocuous but it does a genuinely funny thing.
This will be used when creating a template (as part of validating), when simulating a template via simulate api and creation of a backing index of data stream. The latter will be the most frequent compared to the other two use cases and happens as part of creating a new data stream or rolling over a data stream. I still think that this is okay. |
Pinging @elastic/es-data-management (Team:Data Management) |
Pinging @jsoriano for awareness. |
Rename from `createIndexMapperService(...)`` to `createIndexMapperServiceForValidation(...)` Followup from elastic#86790
Rename from `createIndexMapperService(...)`` to `createIndexMapperServiceForValidation(...)` Followup from #86790
Thanks! |
If no
index.routing_path
has been specified in the matching template or the component template that the template refers to then attempt to generate theindex.routing_path
index setting from the matching template's mapping or component template the template refers to.Relates #74660