-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Modify removal_of_types.asciidoc #37648
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,22 +157,24 @@ GET twitter/tweet/_search | |
| ---- | ||
| // NOTCONSOLE | ||
|
|
||
| Note the use of the `include_type_name=true` url parameter on index creation. | ||
| This is necessary as the use of types is deprecated in 7.0. In this example | ||
| it is solely used to force the legacy behaviour. | ||
|
|
||
| You could achieve the same thing by adding a custom `type` field as follows: | ||
|
|
||
| [source,js] | ||
| ---- | ||
| PUT twitter?include_type_name=true | ||
| PUT twitter | ||
| { | ||
| "mappings": { | ||
| "_doc": { | ||
| "properties": { | ||
| "type": { "type": "keyword" }, <1> | ||
| "name": { "type": "text" }, | ||
| "user_name": { "type": "keyword" }, | ||
| "email": { "type": "keyword" }, | ||
| "content": { "type": "text" }, | ||
| "tweeted_at": { "type": "date" } | ||
| } | ||
| "properties": { | ||
| "type": { "type": "keyword" }, <1> | ||
| "name": { "type": "text" }, | ||
| "user_name": { "type": "keyword" }, | ||
| "email": { "type": "keyword" }, | ||
| "content": { "type": "text" }, | ||
| "tweeted_at": { "type": "date" } | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -299,7 +301,7 @@ This first example splits our `twitter` index into a `tweets` index and a | |
|
|
||
| [source,js] | ||
| ---- | ||
| PUT users?include_type_name=true | ||
| PUT users | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we remove
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand this example ment to be execute on either 5.6 or 6.x. to split a multiple-type index moving forward. So the new syntax doesn't apply there yet. |
||
| { | ||
| "settings": { | ||
| "index.mapping.single_type": true | ||
|
|
@@ -321,7 +323,7 @@ PUT users?include_type_name=true | |
| } | ||
| } | ||
|
|
||
| PUT tweets?include_type_name=true | ||
| PUT tweets | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we remove
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same reason as before |
||
| { | ||
| "settings": { | ||
| "index.mapping.single_type": true | ||
|
|
@@ -376,7 +378,7 @@ documents of different types which have conflicting IDs: | |
|
|
||
| [source,js] | ||
| ---- | ||
| PUT new_twitter?include_type_name=true | ||
| PUT new_twitter | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we remove
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same reason as before |
||
| { | ||
| "mappings": { | ||
| "_doc": { | ||
|
|
@@ -429,8 +431,11 @@ POST _reindex | |
|
|
||
| Index creation, mappings and document APIs support the `include_type_name` | ||
| option. When set to `false`, this option enables the behavior that will become | ||
| default in 8.0 when types are removed. See some examples of interactions with | ||
| Elasticsearch with this option turned off: | ||
| default in 8.0 when types are removed. Since the default for `include_type_name` | ||
| is `false` starting with 7.0, you can omit using it after 7.0, but you can use | ||
| it in case you want to temporarily force the legacy behaviour. | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be we can phrase this paragraph simpler, removing the sentence "When set to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to @mayya-sharipova's point, I think this whole paragraph will need to be reworked a bit, since we have changed the plan significantly since it was written:
|
||
| See some examples of interactions with Elasticsearch with this option turned off: | ||
|
|
||
| [float] | ||
| ==== Index creation | ||
|
|
||
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.
Small suggestion: instead of 'This is necessary as the use of types is deprecated in 7.0.', we could say 'This is necessary because index creation requests are typeless by default in 7.0.'
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.
Actually, now thinking about it, the example uses two types still and is only there to exemplify the "old" syntax. It shoudln't use "include_type_names" at all and is also not run in the tests (//NOTCONSOLE) so I think we should remove this note again and also remove the parameter here, since it can only work in 5.6 indices this way.