Closed
Description
In #35790, we introduced support for making typeless API calls against an index with a custom type name. For example, given an existing index with type my_type
, we allow new documents to be indexed using the typeless endpoint index/_doc/id
. This is functionality is important in supporting the move to typeless APIs, since many users are likely to be working with older indices that were created with a custom type.
The approach in #35790 is fairly fragile, and we would like to step back and consider if there is something cleaner and more solid we could do instead. To help document the current implementation, here is the list of PRs associated with this work:
- Make typeless APIs usable with indices whose type name is different from
_doc
. Make typeless APIs usable with indices whose type name is different from_doc
#35790 - Rewrite SourceToParse with resolved docType. Rewrite SourceToParse with resolved docType #36921
- Make sure to resolve the type in DocumentMapperParser#extractMappings. Make sure to use the resolved type in DocumentMapperService#extractMappings. #37451
- Give precedence to the type from index creation when applying templates. Give precedence to index creation when mixing typed templates with typeless index creation and vice-versa. #37871
- Treat put-mapping calls with
_doc
as a top-level key as typed calls. Treat put-mapping calls with_doc
as a top-level key as typed calls. #38032