Skip to content

Commit 25aac4f

Browse files
author
Christoph Büscher
authored
Remove include_type_name in asciidoc where possible (#37568)
The "include_type_name" parameter was temporarily introduced in #37285 to facilitate moving the default parameter setting to "false" in many places in the documentation code snippets. Most of the places can simply be reverted without causing errors. In this change I looked for asciidoc files that contained the "include_type_name=true" addition when creating new indices but didn't look likey they made use of the "_doc" type for mappings. This is mostly the case e.g. in the analysis docs where index creating often only contains settings. I manually corrected the use of types in some places where the docs still used an explicit type name and not the dummy "_doc" type.
1 parent 2f0e0b2 commit 25aac4f

File tree

71 files changed

+252
-272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+252
-272
lines changed

docs/painless/painless-contexts/painless-context-examples.asciidoc

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,20 @@ the request URL.
4343
+
4444
[source,js]
4545
----
46-
PUT /seats?include_type_name=true
46+
PUT /seats
4747
{
4848
"mappings": {
49-
"seat": {
50-
"properties": {
51-
"theatre": { "type": "keyword" },
52-
"play": { "type": "text" },
53-
"actors": { "type": "text" },
54-
"row": { "type": "integer" },
55-
"number": { "type": "integer" },
56-
"cost": { "type": "double" },
57-
"sold": { "type": "boolean" },
58-
"datetime": { "type": "date" },
59-
"date": { "type": "keyword" },
60-
"time": { "type": "keyword" }
61-
}
49+
"properties": {
50+
"theatre": { "type": "keyword" },
51+
"play": { "type": "text" },
52+
"actors": { "type": "text" },
53+
"row": { "type": "integer" },
54+
"number": { "type": "integer" },
55+
"cost": { "type": "double" },
56+
"sold": { "type": "boolean" },
57+
"datetime": { "type": "date" },
58+
"date": { "type": "keyword" },
59+
"time": { "type": "keyword" }
6260
}
6361
}
6462
}

docs/plugins/analysis-kuromoji.asciidoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Then create an analyzer as follows:
124124

125125
[source,js]
126126
--------------------------------------------------
127-
PUT kuromoji_sample?include_type_name=true
127+
PUT kuromoji_sample
128128
{
129129
"settings": {
130130
"index": {
@@ -186,7 +186,7 @@ BaseFormAttribute. This acts as a lemmatizer for verbs and adjectives. Example:
186186

187187
[source,js]
188188
--------------------------------------------------
189-
PUT kuromoji_sample?include_type_name=true
189+
PUT kuromoji_sample
190190
{
191191
"settings": {
192192
"index": {
@@ -243,7 +243,7 @@ For example:
243243

244244
[source,js]
245245
--------------------------------------------------
246-
PUT kuromoji_sample?include_type_name=true
246+
PUT kuromoji_sample
247247
{
248248
"settings": {
249249
"index": {
@@ -317,7 +317,7 @@ katakana reading form:
317317

318318
[source,js]
319319
--------------------------------------------------
320-
PUT kuromoji_sample?include_type_name=true
320+
PUT kuromoji_sample
321321
{
322322
"settings": {
323323
"index":{
@@ -381,7 +381,7 @@ This token filter accepts the following setting:
381381

382382
[source,js]
383383
--------------------------------------------------
384-
PUT kuromoji_sample?include_type_name=true
384+
PUT kuromoji_sample
385385
{
386386
"settings": {
387387
"index": {
@@ -434,7 +434,7 @@ predefined list, then use the
434434

435435
[source,js]
436436
--------------------------------------------------
437-
PUT kuromoji_sample?include_type_name=true
437+
PUT kuromoji_sample
438438
{
439439
"settings": {
440440
"index": {
@@ -493,7 +493,7 @@ to regular Arabic decimal numbers in half-width characters. For example:
493493

494494
[source,js]
495495
--------------------------------------------------
496-
PUT kuromoji_sample?include_type_name=true
496+
PUT kuromoji_sample
497497
{
498498
"settings": {
499499
"index": {

docs/plugins/analysis-nori.asciidoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Then create an analyzer as follows:
9090

9191
[source,js]
9292
--------------------------------------------------
93-
PUT nori_sample?include_type_name=true
93+
PUT nori_sample
9494
{
9595
"settings": {
9696
"index": {
@@ -164,7 +164,7 @@ the `user_dictionary_rules` option:
164164

165165
[source,js]
166166
--------------------------------------------------
167-
PUT nori_sample?include_type_name=true
167+
PUT nori_sample
168168
{
169169
"settings": {
170170
"index": {
@@ -332,7 +332,7 @@ For example:
332332

333333
[source,js]
334334
--------------------------------------------------
335-
PUT nori_sample?include_type_name=true
335+
PUT nori_sample
336336
{
337337
"settings": {
338338
"index": {
@@ -398,7 +398,7 @@ The `nori_readingform` token filter rewrites tokens written in Hanja to their Ha
398398

399399
[source,js]
400400
--------------------------------------------------
401-
PUT nori_sample?include_type_name=true
401+
PUT nori_sample
402402
{
403403
"settings": {
404404
"index":{

docs/plugins/analysis-phonetic.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The `phonetic` token filter takes the following settings:
2929

3030
[source,js]
3131
--------------------------------------------------
32-
PUT phonetic_sample?include_type_name=true
32+
PUT phonetic_sample
3333
{
3434
"settings": {
3535
"index": {

docs/plugins/store-smb.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ It can also be set on a per-index basis at index creation time:
4646

4747
[source,js]
4848
----
49-
PUT my_index?include_type_name=true
49+
PUT my_index
5050
{
5151
"settings": {
5252
"index.store.type": "smb_mmap_fs"

docs/reference/aggregations/bucket/nested-aggregation.asciidoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ price for the product. The mapping could look like:
88

99
[source,js]
1010
--------------------------------------------------
11-
PUT /index?include_type_name=true
11+
PUT /index
1212
{
13-
"mappings": {
14-
"product" : {
13+
"mappings": {
1514
"properties" : {
1615
"resellers" : { <1>
1716
"type" : "nested",
@@ -22,7 +21,6 @@ PUT /index?include_type_name=true
2221
}
2322
}
2423
}
25-
}
2624
}
2725
--------------------------------------------------
2826
// CONSOLE
@@ -52,7 +50,7 @@ GET /_search
5250
--------------------------------------------------
5351
// CONSOLE
5452
// TEST[s/GET \/_search/GET \/_search\?filter_path=aggregations/]
55-
// TEST[s/^/PUT index\/product\/0\?refresh\n{"name":"led", "resellers": [{"name": "foo", "price": 350.00}, {"name": "bar", "price": 500.00}]}\n/]
53+
// TEST[s/^/PUT index\/_doc\/0\?refresh\n{"name":"led", "resellers": [{"name": "foo", "price": 350.00}, {"name": "bar", "price": 500.00}]}\n/]
5654

5755
As you can see above, the nested aggregation requires the `path` of the nested documents within the top level documents.
5856
Then one can define any type of aggregation over these nested documents.

docs/reference/aggregations/bucket/reverse-nested-aggregation.asciidoc

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,19 @@ the issue documents as nested documents. The mapping could look like:
1717

1818
[source,js]
1919
--------------------------------------------------
20-
PUT /issues?include_type_name=true
20+
PUT /issues
2121
{
2222
"mappings": {
23-
"issue" : {
24-
"properties" : {
25-
"tags" : { "type" : "keyword" },
26-
"comments" : { <1>
27-
"type" : "nested",
28-
"properties" : {
29-
"username" : { "type" : "keyword" },
30-
"comment" : { "type" : "text" }
31-
}
32-
}
33-
}
34-
}
23+
"properties" : {
24+
"tags" : { "type" : "keyword" },
25+
"comments" : { <1>
26+
"type" : "nested",
27+
"properties" : {
28+
"username" : { "type" : "keyword" },
29+
"comment" : { "type" : "text" }
30+
}
31+
}
32+
}
3533
}
3634
}
3735
--------------------------------------------------
@@ -45,7 +43,7 @@ tags of the issues the user has commented on:
4543
4644
[source,js]
4745
--------------------------------------------------
48-
POST /issues/issue/0?refresh
46+
POST /issues/_doc/0?refresh
4947
{"tags": ["tag_1"], "comments": [{"username": "username_1"}]}
5048
--------------------------------------------------
5149
// CONSOLE

docs/reference/aggregations/bucket/significantterms-aggregation.asciidoc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,21 @@ that is significant and probably very relevant to their search. 5/10,000,000 vs
1919
2020
[source,js]
2121
--------------------------------------------------
22-
PUT /reports?include_type_name=true
22+
PUT /reports
2323
{
2424
"mappings": {
25-
"report": {
26-
"properties": {
27-
"force": {
28-
"type": "keyword"
29-
},
30-
"crime_type": {
31-
"type": "keyword"
32-
}
25+
"properties": {
26+
"force": {
27+
"type": "keyword"
28+
},
29+
"crime_type": {
30+
"type": "keyword"
3331
}
3432
}
3533
}
3634
}
3735
38-
POST /reports/report/_bulk?refresh
36+
POST /reports/_bulk?refresh
3937
{"index":{"_id":0}}
4038
{"force": "British Transport Police", "crime_type": "Bicycle theft"}
4139
{"index":{"_id":1}}

docs/reference/aggregations/bucket/terms-aggregation.asciidoc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,21 @@ A multi-bucket value source based aggregation where buckets are dynamically buil
77
88
[source,js]
99
--------------------------------------------------
10-
PUT /products?include_type_name=true
10+
PUT /products
1111
{
1212
"mappings": {
13-
"product": {
14-
"properties": {
15-
"genre": {
16-
"type": "keyword"
17-
},
18-
"product": {
19-
"type": "keyword"
20-
}
13+
"properties": {
14+
"genre": {
15+
"type": "keyword"
16+
},
17+
"product": {
18+
"type": "keyword"
2119
}
2220
}
2321
}
2422
}
2523
26-
POST /products/product/_bulk?refresh
24+
POST /products/_bulk?refresh
2725
{"index":{"_id":0}}
2826
{"genre": "rock", "product": "Product A"}
2927
{"index":{"_id":1}}

docs/reference/analysis/analyzers/custom-analyzer.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Token Filters::
5353

5454
[source,js]
5555
--------------------------------
56-
PUT my_index?include_type_name=true
56+
PUT my_index
5757
{
5858
"settings": {
5959
"analysis": {
@@ -157,7 +157,7 @@ Here is an example:
157157

158158
[source,js]
159159
--------------------------------------------------
160-
PUT my_index?include_type_name=true
160+
PUT my_index
161161
{
162162
"settings": {
163163
"analysis": {

0 commit comments

Comments
 (0)