Skip to content

Commit 65e0ea6

Browse files
authored
Update generated examples (#2312)
* Fix example generation * Stop using mktemp It is insecure, though not in this specific context, but tools are flagging this.
1 parent 3f232f1 commit 65e0ea6

File tree

450 files changed

+1946
-2437
lines changed

Some content is hidden

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

450 files changed

+1946
-2437
lines changed

docs/examples/014b788c879e4aaa1020672e45e25473.asciidoc

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// aggregations/bucket/filter-aggregation.asciidoc:58
2+
3+
[source, python]
4+
----
5+
resp = client.search(
6+
index="sales",
7+
size="0",
8+
filter_path="aggregations",
9+
body={
10+
"query": {"term": {"type": "t-shirt"}},
11+
"aggs": {"avg_price": {"avg": {"field": "price"}}},
12+
},
13+
)
14+
print(resp)
15+
----

docs/examples/0bbd30b9be3e54ff3028b9f4459634d2.asciidoc renamed to docs/examples/0246f73cc2ed3dfec577119e8cd15404.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// indices/put-mapping.asciidoc:166
1+
// indices/put-mapping.asciidoc:177
22

33
[source, python]
44
----
55
resp = client.indices.put_mapping(
6-
index="my_index",
6+
index="my-index-000001",
77
body={
88
"properties": {"name": {"properties": {"last": {"type": "text"}}}}
99
},

docs/examples/025b54db0edc50c24ea48a2bd94366ad.asciidoc

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/examples/98b121bf47cebd85671a2cb519688d28.asciidoc renamed to docs/examples/0264e994a7e68561e2ca6be0f0d90ee9.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// aggregations/bucket/terms-aggregation.asciidoc:520
1+
// aggregations/bucket/terms-aggregation.asciidoc:571
22

33
[source, python]
44
----
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// docs/get.asciidoc:79
2+
3+
[source, python]
4+
----
5+
resp = client.get(
6+
index="my-index-000001",
7+
id="0",
8+
_source="*.id",
9+
)
10+
print(resp)
11+
----

docs/examples/033778305d52746f5ce0a2a922c8e521.asciidoc

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/examples/047266b0d20fdb62ebc72d51952c8f6d.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// query-dsl/multi-match-query.asciidoc:341
1+
// query-dsl/multi-match-query.asciidoc:344
22

33
[source, python]
44
----

docs/examples/048d8abd42d094bbdcf4452a58ccb35b.asciidoc

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
// cluster/health.asciidoc:35
1+
// cluster/health.asciidoc:42
22

33
[source, python]
44
----
5-
resp = client.cluster.health(wait_for_status="yellow", timeout="50s")
5+
resp = client.cluster.health(
6+
wait_for_status="yellow",
7+
timeout="50s",
8+
)
69
print(resp)
710
----

docs/examples/04fe1e3a0047b0cdb10987b79fc3f3f3.asciidoc

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/examples/073539a7e38be3cdf13008330b6a536a.asciidoc

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/examples/1bc731a4df952228af6dfa6b48627332.asciidoc renamed to docs/examples/07ba3eaa931f2cf110052e3544db51f8.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// docs/reindex.asciidoc:815
1+
// docs/reindex.asciidoc:878
22

33
[source, python]
44
----
55
resp = client.reindex(
66
body={
77
"max_docs": 10,
88
"source": {
9-
"index": "twitter",
9+
"index": "my-index-000001",
1010
"query": {
1111
"function_score": {"random_score": {}, "min_score": 0.9}
1212
},
1313
},
14-
"dest": {"index": "random_twitter"},
14+
"dest": {"index": "my-new-index-000001"},
1515
},
1616
)
1717
print(resp)

docs/examples/09ecba5814d71e4c44468575eada9878.asciidoc renamed to docs/examples/095d60b2cfc5004c97efc49f27287262.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// aggregations/bucket/datehistogram-aggregation.asciidoc:214
1+
// aggregations/bucket/datehistogram-aggregation.asciidoc:198
22

33
[source, python]
44
----

docs/examples/0989cc65d8924f666ce3eb0820d2d244.asciidoc

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/examples/09cdd5ae8114c49886026fef8d00a19c.asciidoc

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/examples/09d617863a103c82fb4101e6165ea7fe.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[source, python]
44
----
5-
resp = client.search(body={"query": {"match_all": {}}})
5+
resp = client.search(
6+
body={"query": {"match_all": {}}},
7+
)
68
print(resp)
79
----

docs/examples/09dbd90c5e22ea4a17b4cf9aa72e08ae.asciidoc

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/examples/0ba0b2db24852abccb7c0fc1098d566e.asciidoc

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/examples/0be2c28ee65384774b1e479b47dc3d92.asciidoc

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/examples/0c4ad860a485fe53d8140ad3ccd11dcf.asciidoc

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// docs/delete.asciidoc:82
2+
3+
[source, python]
4+
----
5+
resp = client.delete(
6+
index="my-index-000001",
7+
id="1",
8+
routing="shard-1",
9+
)
10+
print(resp)
11+
----

docs/examples/0cc991e3f7f8511a34730e154b3c5edc.asciidoc

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/examples/0ce3606f1dba490eef83c4317b315b62.asciidoc

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/examples/0e118857b815b62118a30c042f079db1.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// query-dsl/multi-match-query.asciidoc:259
1+
// query-dsl/multi-match-query.asciidoc:262
22

33
[source, python]
44
----
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// aggregations/bucket/filter-aggregation.asciidoc:167
2+
3+
[source, python]
4+
----
5+
resp = client.search(
6+
index="sales",
7+
size="0",
8+
filter_path="aggregations",
9+
body={
10+
"aggs": {
11+
"hats": {
12+
"filter": {"term": {"type": "hat"}},
13+
"aggs": {"avg_price": {"avg": {"field": "price"}}},
14+
},
15+
"t_shirts": {
16+
"filter": {"term": {"type": "t-shirt"}},
17+
"aggs": {"avg_price": {"avg": {"field": "price"}}},
18+
},
19+
}
20+
},
21+
)
22+
print(resp)
23+
----
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// mapping/types/numeric.asciidoc:275
2+
3+
[source, python]
4+
----
5+
resp = client.indices.create(
6+
index="idx",
7+
body={
8+
"mappings": {
9+
"_source": {"mode": "synthetic"},
10+
"properties": {
11+
"f": {"type": "scaled_float", "scaling_factor": 0.01}
12+
},
13+
}
14+
},
15+
)
16+
print(resp)
17+
18+
resp = client.index(
19+
index="idx",
20+
id="1",
21+
body={"f": 123},
22+
)
23+
print(resp)
24+
----

0 commit comments

Comments
 (0)