-
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
Elasticsearch creates index templates with deprecated types #37773
Comments
Pinging @elastic/es-search |
Per @chrisdavies on Slack, clarifying the issue:
There may be another way around this for the Kibana test suite, but we should still clear all of these up for the reasons detailed in #37442. /cc @jtibshirani for awareness |
Thank you for flagging this @chrisdavies, and sorry that you ran into these issues! We had actually planned to keep the type name
We will certainly plan to move to typeless templates after the 7.0 release, when we begin to update more server-side code to be typeless, and work towards the goal of removing types completely in elasticsearch. While I don’t think there’s immediate action in terms of upgrading templates, the error you ran into highlights a bug in our current approach: it’s not possible to issue a typeless 'create index' request when it triggers an index template that contains a custom type. I will look into fixing this bug, as it’s something I think we should be able to support. Lastly, @jpountz or @bleskes would you be able to confirm if the reasoning above around templates above makes sense to you as well? |
@jtibshirani Agreed. |
@jtibshirani I'm ok with the approach. I'm not 100% sure I understand why we can't update all the templates (it's just json, right?) to remove the types in 7.0.0 but I trust your judgement. |
Yeah. This actually makes Kibana's process trickier, I think, because this will mean we have "doc" in some places and "_doc" / default in some places. That said, what I'm doing right now is just removing the mappings for these indices from our test archives, and that seems to be working out so far. It may be that we don't have any production code in Kibana that explicitly specifies the root type for these indices. I'll know more in a few days once the Eleasticsearch 7 update is complete on our end. |
…peless index creation and vice-versa. Currently if you mix typed templates and typeless index creation or typeless templates and typed index creation then you will end up with an error because Elasticsearch tries to create an index that has multiple types: `_doc` and the explicit type name that you used. This commit proposes to give precedence to the index creation call so that the type from the template will be ignored if the index creation call is typeless while the template is typed, and the type from the index creation call will be used if there is a typeless template. This is consistent with the fact that index creation already "wins" if a field is defined differently in the index creation call and in a template: the definition from the index creation call is used in such cases. Closes elastic#37773
@bleskes The main issue is all the indices generated from the templates would switch from having type @chrisdavies After we fix the bug mentioned above, I wouldn't think that there'd be a situation where you still need to refer to the old |
@chrisdavies Can you tell us what API call you did exactly to run into this error? |
It was es_archiver in Kibana, which basically is doing a create index with mappings. |
Ok, so it is creating an index explicitly that matches a template, rather than letting the index be created automatically, this is what I needed to know. Thank you. |
…peless index creation and vice-versa. (#37871) Currently if you mix typed templates and typeless index creation or typeless templates and typed index creation then you will end up with an error because Elasticsearch tries to create an index that has multiple types: `_doc` and the explicit type name that you used. This commit proposes to give precedence to the index creation call so that the type from the template will be ignored if the index creation call is typeless while the template is typed, and the type from the index creation call will be used if there is a typeless template. This is consistent with the fact that index creation already "wins" if a field is defined differently in the index creation call and in a template: the definition from the index creation call is used in such cases. Closes #37773
We're trying to get Kibana to work with ES7, but are getting errors like this:
The reason is that we're modifying Kibana to no longer specify the root type for a document, but there are existing index templates which are interfering with us.
Here's a list of template names and their root doc types:
I saw that there are some individual issues to track this (#37442) but I thought it might be good to have a more comprehensive issue.
Feel free to close if this is redundant!
The text was updated successfully, but these errors were encountered: