-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Allow _doc as a type.
#27816
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
Allow _doc as a type.
#27816
Conversation
Allowing `_doc` as a type will enable users to make the transition to 7.0 smoother since the index APIs will be `PUT index/_doc/id` and `POST index/_doc`. This also moves most of the documentation to `_doc` as a type name. Closes elastic#27750 Closes elastic#27751
clintongormley
left a comment
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 couldn't check all 196(!) files, but it looks like you've got most things, thank you.
Added some comments about the removal of types page.
| } | ||
| }, | ||
| "tweet": { | ||
| "_doc": { |
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 one shouldn't change
| "user_name": "kimchy", | ||
| "email": "[email protected]" | ||
| } | ||
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.
doc in lines 167 and 180 could become _doc
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.
Line 167 still needs changing
| PUT twitter/doc/tweet-1 | ||
| { | ||
| "type": "tweet", <1> | ||
| "type": "_doc", <1> |
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 one shouldn't change
| "filter": { | ||
| "match": { | ||
| "type": "tweet" <1> | ||
| "type": "_doc" <1> |
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 one shouldn't change
| "settings": { | ||
| "index.mapping.single_type": true | ||
| }, | ||
| "mappings": { |
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.
In line 242 above, under changes coming in 6.x, mention addition of _doc as an acceptable type name to ease the transition to new URLs
| "source": { | ||
| "index": "twitter", | ||
| "type": "tweet" | ||
| "type": "_doc" |
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 is the source, so the type name should remain
| "index": "twitter", | ||
| "type": "tweet" | ||
| "type": "_doc" | ||
| }, |
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.
in lines 375 and 413 below, use _doc instead of doc
|
@clintongormley done |
clintongormley
left a comment
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.
One missed change and a couple of suggestions, otherwise LGTM
| "user_name": "kimchy", | ||
| "email": "[email protected]" | ||
| } | ||
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.
Line 167 still needs changing
| can be used for the type, but there can be only one. | ||
| can be used for the type, but there can be only one. The preferred type name | ||
| is `_doc`, so that index APIs have the same path as they will have in 7.0: | ||
| `PUT index/_doc/id` and `POST index/_doc` |
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.
perhaps PUT {index}/_doc/{id} instead?
| a document no longer requires a document `type`. | ||
| a document no longer requires a document `type`. The new index APIs | ||
| are `PUT index/_doc/id` in case of explicit ids and `POST index/_doc` | ||
| for auto-generated ids. |
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.
same here. perhaps PUT {index}/_doc/{id} instead?
The test assumes that all 6.x indices support `_doc` as a type name but support for it was actually only added in 6.2 via elastic#27816.
The test assumed that it could run against all 6.x indices but it actually requires 6.2+ since 6.2 is the first version that allowed `_doc` as a type name (elastic#27816). Closes elastic#38202
Allowing
_docas a type will enable users to make the transition to 7.0smoother since the index APIs will be
PUT index/_doc/idandPOST index/_doc.This also moves same tests and most of the documentation to
_docas a type name.Closes #27750
Closes #27751