@@ -112,7 +112,7 @@ have looked something like this:
112
112
113
113
[source,js]
114
114
----
115
- PUT twitter?include_type_name=true
115
+ PUT twitter
116
116
{
117
117
"mappings": {
118
118
"user": {
@@ -157,16 +157,16 @@ GET twitter/tweet/_search
157
157
----
158
158
// NOTCONSOLE
159
159
160
- You could achieve the same thing by adding a custom `type` field as follows:
160
+ You can achieve the same thing by adding a custom `type` field as follows:
161
161
162
162
[source,js]
163
163
----
164
- PUT twitter?include_type_name=true
164
+ PUT twitter?include_type_name=true <1>
165
165
{
166
166
"mappings": {
167
167
"_doc": {
168
168
"properties": {
169
- "type": { "type": "keyword" }, <1 >
169
+ "type": { "type": "keyword" }, <2 >
170
170
"name": { "type": "text" },
171
171
"user_name": { "type": "keyword" },
172
172
"email": { "type": "keyword" },
@@ -204,15 +204,17 @@ GET twitter/_search
204
204
},
205
205
"filter": {
206
206
"match": {
207
- "type": "tweet" <1 >
207
+ "type": "tweet" <2 >
208
208
}
209
209
}
210
210
}
211
211
}
212
212
}
213
213
----
214
214
// NOTCONSOLE
215
- <1> The explicit `type` field takes the place of the implicit `_type` field.
215
+ <1> Use `include_type_name=true` in case need to use the "old" syntax including the "_doc" object like
216
+ in this example
217
+ <2> The explicit `type` field takes the place of the implicit `_type` field.
216
218
217
219
[float]
218
220
==== Parent/Child without mapping types
@@ -299,7 +301,7 @@ This first example splits our `twitter` index into a `tweets` index and a
299
301
300
302
[source,js]
301
303
----
302
- PUT users?include_type_name=true
304
+ PUT users
303
305
{
304
306
"settings": {
305
307
"index.mapping.single_type": true
@@ -321,7 +323,7 @@ PUT users?include_type_name=true
321
323
}
322
324
}
323
325
324
- PUT tweets?include_type_name=true
326
+ PUT tweets
325
327
{
326
328
"settings": {
327
329
"index.mapping.single_type": true
@@ -376,7 +378,7 @@ documents of different types which have conflicting IDs:
376
378
377
379
[source,js]
378
380
----
379
- PUT new_twitter?include_type_name=true
381
+ PUT new_twitter
380
382
{
381
383
"mappings": {
382
384
"_doc": {
@@ -427,10 +429,12 @@ POST _reindex
427
429
[float]
428
430
=== Use `include_type_name=false` to prepare for upgrade to 8.0
429
431
430
- Index creation, mappings and document APIs support the `include_type_name`
431
- option. When set to `false`, this option enables the behavior that will become
432
- default in 8.0 when types are removed. See some examples of interactions with
433
- Elasticsearch with this option turned off:
432
+ Index creation and mapping APIs support a new `include_type_name` url parameter
433
+ starting with version 6.7. It will default to `true` in version 6.7, default to
434
+ `false` in version 7.0 and will be removed in version 8.0. When set to `true`,
435
+ this parameter enables the pre-7.0 behavior of using type names in the API.
436
+
437
+ See some examples of interactions with Elasticsearch with this option turned off:
434
438
435
439
[float]
436
440
==== Index creation
0 commit comments