diff --git a/.gitignore b/.gitignore
index c6aa5471c..88a36d19c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
+node_modules
# PyInstaller
# Usually these files are written by a python script from a template
diff --git a/docs/examples/00272f75a6afea91f8554ef7cda0c1f2.asciidoc b/docs/examples/00272f75a6afea91f8554ef7cda0c1f2.asciidoc
new file mode 100644
index 000000000..dc87b0549
--- /dev/null
+++ b/docs/examples/00272f75a6afea91f8554ef7cda0c1f2.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-cache.asciidoc:69
+
+[source, python]
+----
+resp = client.security.clear_cached_realms(
+ realms="default_file,ldap1",
+)
+print(resp)
+----
diff --git a/docs/examples/004743b9c9f61588926ccf734696b713.asciidoc b/docs/examples/004743b9c9f61588926ccf734696b713.asciidoc
new file mode 100644
index 000000000..9e5b1713a
--- /dev/null
+++ b/docs/examples/004743b9c9f61588926ccf734696b713.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/forcemerge.asciidoc:210
+
+[source, python]
+----
+resp = client.indices.forcemerge(
+ index=".ds-my-data-stream-2099.03.07-000001",
+ max_num_segments="1",
+)
+print(resp)
+----
diff --git a/docs/examples/004a17b42ab5155bb61da797a006fa9f.asciidoc b/docs/examples/004a17b42ab5155bb61da797a006fa9f.asciidoc
new file mode 100644
index 000000000..2dd6527c5
--- /dev/null
+++ b/docs/examples/004a17b42ab5155bb61da797a006fa9f.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/pinned-query.asciidoc:13
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "pinned": {
+ "ids": [
+ "1",
+ "4",
+ "100"
+ ],
+ "organic": {
+ "match": {
+ "description": "iphone"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/006e0e16c9f1da58c0bfe57377f7fc38.asciidoc b/docs/examples/006e0e16c9f1da58c0bfe57377f7fc38.asciidoc
new file mode 100644
index 000000000..8b35af92e
--- /dev/null
+++ b/docs/examples/006e0e16c9f1da58c0bfe57377f7fc38.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/stemmer-tokenfilter.asciidoc:85
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/007179b5e241da650562a5f0a5007823.asciidoc b/docs/examples/007179b5e241da650562a5f0a5007823.asciidoc
new file mode 100644
index 000000000..438bc152b
--- /dev/null
+++ b/docs/examples/007179b5e241da650562a5f0a5007823.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/example-watches/example-watch-clusterstatus.asciidoc:193
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="cluster_health_watch",
+ trigger={
+ "schedule": {
+ "interval": "10s"
+ }
+ },
+ input={
+ "http": {
+ "request": {
+ "host": "localhost",
+ "port": 9200,
+ "path": "/_cluster/health"
+ }
+ }
+ },
+ condition={
+ "compare": {
+ "ctx.payload.status": {
+ "eq": "red"
+ }
+ }
+ },
+ actions={
+ "send_email": {
+ "email": {
+ "to": "username@example.org",
+ "subject": "Cluster Status Warning",
+ "body": "Cluster status is RED"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/008ed823c89e703c447ac89c6b689833.asciidoc b/docs/examples/008ed823c89e703c447ac89c6b689833.asciidoc
new file mode 100644
index 000000000..97fa31508
--- /dev/null
+++ b/docs/examples/008ed823c89e703c447ac89c6b689833.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// migration/apis/feature-migration.asciidoc:152
+
+[source, python]
+----
+resp = client.migration.post_feature_upgrade()
+print(resp)
+----
diff --git a/docs/examples/0091fc75271b1fbbd4269622a4881e8b.asciidoc b/docs/examples/0091fc75271b1fbbd4269622a4881e8b.asciidoc
new file mode 100644
index 000000000..d57c253c2
--- /dev/null
+++ b/docs/examples/0091fc75271b1fbbd4269622a4881e8b.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/common-script-uses.asciidoc:107
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "match": {
+ "http.clientip": "40.135.0.0"
+ }
+ },
+ fields=[
+ "http.clientip"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/00b3b6d76a368ae71277ea24af318693.asciidoc b/docs/examples/00b3b6d76a368ae71277ea24af318693.asciidoc
new file mode 100644
index 000000000..41250b193
--- /dev/null
+++ b/docs/examples/00b3b6d76a368ae71277ea24af318693.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/shard-stores.asciidoc:134
+
+[source, python]
+----
+resp = client.indices.shard_stores()
+print(resp)
+----
diff --git a/docs/examples/00c05aa931fc985985e3e21c93cf43ff.asciidoc b/docs/examples/00c05aa931fc985985e3e21c93cf43ff.asciidoc
new file mode 100644
index 000000000..a38c069a7
--- /dev/null
+++ b/docs/examples/00c05aa931fc985985e3e21c93cf43ff.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:443
+
+[source, python]
+----
+resp = client.render_search_template(
+ source="{ \"query\": {{#toJson}}my_query{{/toJson}} }",
+ params={
+ "my_query": {
+ "match_all": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/00d65f7b9daa1c6b18eedd8ace206bae.asciidoc b/docs/examples/00d65f7b9daa1c6b18eedd8ace206bae.asciidoc
new file mode 100644
index 000000000..4bc6f9d6a
--- /dev/null
+++ b/docs/examples/00d65f7b9daa1c6b18eedd8ace206bae.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/asciifolding-tokenfilter.asciidoc:21
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "asciifolding"
+ ],
+ text="açaí à la carte",
+)
+print(resp)
+----
diff --git a/docs/examples/00e0c964c79fcc1876ab957da2ffce82.asciidoc b/docs/examples/00e0c964c79fcc1876ab957da2ffce82.asciidoc
new file mode 100644
index 000000000..873a5e84a
--- /dev/null
+++ b/docs/examples/00e0c964c79fcc1876ab957da2ffce82.asciidoc
@@ -0,0 +1,69 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1204
+
+[source, python]
+----
+resp = client.indices.create(
+ index="italian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "italian_elision": {
+ "type": "elision",
+ "articles": [
+ "c",
+ "l",
+ "all",
+ "dall",
+ "dell",
+ "nell",
+ "sull",
+ "coll",
+ "pell",
+ "gl",
+ "agl",
+ "dagl",
+ "degl",
+ "negl",
+ "sugl",
+ "un",
+ "m",
+ "t",
+ "s",
+ "v",
+ "d"
+ ],
+ "articles_case": True
+ },
+ "italian_stop": {
+ "type": "stop",
+ "stopwords": "_italian_"
+ },
+ "italian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "esempio"
+ ]
+ },
+ "italian_stemmer": {
+ "type": "stemmer",
+ "language": "light_italian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_italian": {
+ "tokenizer": "standard",
+ "filter": [
+ "italian_elision",
+ "lowercase",
+ "italian_stop",
+ "italian_keywords",
+ "italian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc b/docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc
new file mode 100644
index 000000000..22b4df510
--- /dev/null
+++ b/docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-elasticsearch.asciidoc:93
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="my-e5-model",
+ inference_config={
+ "service": "elasticsearch",
+ "service_settings": {
+ "num_allocations": 1,
+ "num_threads": 1,
+ "model_id": ".multilingual-e5-small"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/010d5e901a2690fa7b2396edbe6cd463.asciidoc b/docs/examples/010d5e901a2690fa7b2396edbe6cd463.asciidoc
new file mode 100644
index 000000000..c76a26693
--- /dev/null
+++ b/docs/examples/010d5e901a2690fa7b2396edbe6cd463.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/common-log-format-example.asciidoc:161
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my-data-stream-template",
+ index_patterns=[
+ "my-data-stream*"
+ ],
+ data_stream={},
+ priority=500,
+)
+print(resp)
+----
diff --git a/docs/examples/0163af36c8472ac0c5160c8b716f5b26.asciidoc b/docs/examples/0163af36c8472ac0c5160c8b716f5b26.asciidoc
index a6b6b6116..9b1b7668f 100644
--- a/docs/examples/0163af36c8472ac0c5160c8b716f5b26.asciidoc
+++ b/docs/examples/0163af36c8472ac0c5160c8b716f5b26.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/filter-aggregation.asciidoc:58
[source, python]
@@ -6,10 +7,18 @@ resp = client.search(
index="sales",
size="0",
filter_path="aggregations",
- body={
- "query": {"term": {"type": "t-shirt"}},
- "aggs": {"avg_price": {"avg": {"field": "price"}}},
+ query={
+ "term": {
+ "type": "t-shirt"
+ }
+ },
+ aggs={
+ "avg_price": {
+ "avg": {
+ "field": "price"
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/016f3147dae9ff2c3e831257ae470361.asciidoc b/docs/examples/016f3147dae9ff2c3e831257ae470361.asciidoc
new file mode 100644
index 000000000..b1bdb6ee6
--- /dev/null
+++ b/docs/examples/016f3147dae9ff2c3e831257ae470361.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:52
+
+[source, python]
+----
+resp = client.indices.update_aliases(
+ actions=[
+ {
+ "add": {
+ "index": "logs-*",
+ "alias": "logs"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/019e329ed5a930aef825266822e7377a.asciidoc b/docs/examples/019e329ed5a930aef825266822e7377a.asciidoc
new file mode 100644
index 000000000..7dad75c86
--- /dev/null
+++ b/docs/examples/019e329ed5a930aef825266822e7377a.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/asciifolding-tokenfilter.asciidoc:118
+
+[source, python]
+----
+resp = client.indices.create(
+ index="asciifold_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_asciifolding": {
+ "tokenizer": "standard",
+ "filter": [
+ "my_ascii_folding"
+ ]
+ }
+ },
+ "filter": {
+ "my_ascii_folding": {
+ "type": "asciifolding",
+ "preserve_original": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/01bc0f2ed30eb3dd23511d01ce0ac6e1.asciidoc b/docs/examples/01bc0f2ed30eb3dd23511d01ce0ac6e1.asciidoc
new file mode 100644
index 000000000..f3c753df4
--- /dev/null
+++ b/docs/examples/01bc0f2ed30eb3dd23511d01ce0ac6e1.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/start-transform.asciidoc:79
+
+[source, python]
+----
+resp = client.transform.start_transform(
+ transform_id="ecommerce_transform",
+)
+print(resp)
+----
diff --git a/docs/examples/01da9e0620e48270617fc248e6415cac.asciidoc b/docs/examples/01da9e0620e48270617fc248e6415cac.asciidoc
new file mode 100644
index 000000000..4d4576e70
--- /dev/null
+++ b/docs/examples/01da9e0620e48270617fc248e6415cac.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations.asciidoc:36
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ aggs={
+ "my-agg-name": {
+ "terms": {
+ "field": "my-field"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/01dc7bdc223bd651574ed2d3954a5b1c.asciidoc b/docs/examples/01dc7bdc223bd651574ed2d3954a5b1c.asciidoc
new file mode 100644
index 000000000..81e0a9db9
--- /dev/null
+++ b/docs/examples/01dc7bdc223bd651574ed2d3954a5b1c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/execute-watch.asciidoc:147
+
+[source, python]
+----
+resp = client.watcher.execute_watch(
+ id="my_watch",
+)
+print(resp)
+----
diff --git a/docs/examples/01f50acf7998b24969f451e922d145eb.asciidoc b/docs/examples/01f50acf7998b24969f451e922d145eb.asciidoc
new file mode 100644
index 000000000..82d372661
--- /dev/null
+++ b/docs/examples/01f50acf7998b24969f451e922d145eb.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:184
+
+[source, python]
+----
+resp = client.indices.create(
+ index="basque_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "basque_stop": {
+ "type": "stop",
+ "stopwords": "_basque_"
+ },
+ "basque_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "Adibidez"
+ ]
+ },
+ "basque_stemmer": {
+ "type": "stemmer",
+ "language": "basque"
+ }
+ },
+ "analyzer": {
+ "rebuilt_basque": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "basque_stop",
+ "basque_keywords",
+ "basque_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/020c95db88ef356093f03be84893ddf9.asciidoc b/docs/examples/020c95db88ef356093f03be84893ddf9.asciidoc
new file mode 100644
index 000000000..f179d62cb
--- /dev/null
+++ b/docs/examples/020c95db88ef356093f03be84893ddf9.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/get-follow-stats.asciidoc:35
+
+[source, python]
+----
+resp = client.ccr.follow_stats(
+ index="",
+)
+print(resp)
+----
diff --git a/docs/examples/020de6b6cb960a76297452725a38889f.asciidoc b/docs/examples/020de6b6cb960a76297452725a38889f.asciidoc
new file mode 100644
index 000000000..2336f7674
--- /dev/null
+++ b/docs/examples/020de6b6cb960a76297452725a38889f.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/has-child-query.asciidoc:53
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "has_child": {
+ "type": "child",
+ "query": {
+ "match_all": {}
+ },
+ "max_children": 10,
+ "min_children": 2,
+ "score_mode": "min"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0246f73cc2ed3dfec577119e8cd15404.asciidoc b/docs/examples/0246f73cc2ed3dfec577119e8cd15404.asciidoc
index cf6311f6b..71415a0a1 100644
--- a/docs/examples/0246f73cc2ed3dfec577119e8cd15404.asciidoc
+++ b/docs/examples/0246f73cc2ed3dfec577119e8cd15404.asciidoc
@@ -1,12 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:177
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "properties": {"name": {"properties": {"last": {"type": "text"}}}}
+ properties={
+ "name": {
+ "properties": {
+ "last": {
+ "type": "text"
+ }
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/025155da86802ebf4c3aeee5aab692f9.asciidoc b/docs/examples/025155da86802ebf4c3aeee5aab692f9.asciidoc
new file mode 100644
index 000000000..a19a5579b
--- /dev/null
+++ b/docs/examples/025155da86802ebf4c3aeee5aab692f9.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/tophits-aggregation.asciidoc:254
+
+[source, python]
+----
+resp = client.indices.create(
+ index="sales",
+ mappings={
+ "properties": {
+ "tags": {
+ "type": "keyword"
+ },
+ "comments": {
+ "type": "nested",
+ "properties": {
+ "username": {
+ "type": "keyword"
+ },
+ "comment": {
+ "type": "text"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/02520ac7816b2c4cf8fb413fd16122f2.asciidoc b/docs/examples/02520ac7816b2c4cf8fb413fd16122f2.asciidoc
new file mode 100644
index 000000000..788c4344b
--- /dev/null
+++ b/docs/examples/02520ac7816b2c4cf8fb413fd16122f2.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/flush-job.asciidoc:75
+
+[source, python]
+----
+resp = client.ml.flush_job(
+ job_id="low_request_rate",
+ calc_interim=True,
+)
+print(resp)
+----
diff --git a/docs/examples/0264e994a7e68561e2ca6be0f0d90ee9.asciidoc b/docs/examples/0264e994a7e68561e2ca6be0f0d90ee9.asciidoc
index a5cd8c9d7..bb4801a01 100644
--- a/docs/examples/0264e994a7e68561e2ca6be0f0d90ee9.asciidoc
+++ b/docs/examples/0264e994a7e68561e2ca6be0f0d90ee9.asciidoc
@@ -1,18 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:571
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "JapaneseCars": {
- "terms": {"field": "make", "include": ["mazda", "honda"]}
- },
- "ActiveCarManufacturers": {
- "terms": {"field": "make", "exclude": ["rover", "jensen"]}
- },
+ aggs={
+ "JapaneseCars": {
+ "terms": {
+ "field": "make",
+ "include": [
+ "mazda",
+ "honda"
+ ]
+ }
+ },
+ "ActiveCarManufacturers": {
+ "terms": {
+ "field": "make",
+ "exclude": [
+ "rover",
+ "jensen"
+ ]
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/0280247e0cf2e561c548f22c9fb31163.asciidoc b/docs/examples/0280247e0cf2e561c548f22c9fb31163.asciidoc
new file mode 100644
index 000000000..10c5d0ce4
--- /dev/null
+++ b/docs/examples/0280247e0cf2e561c548f22c9fb31163.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-tokens.asciidoc:199
+
+[source, python]
+----
+resp = client.security.invalidate_token(
+ username="myuser",
+)
+print(resp)
+----
diff --git a/docs/examples/02853293a5b7cd9cc7a886eb413bbeb6.asciidoc b/docs/examples/02853293a5b7cd9cc7a886eb413bbeb6.asciidoc
new file mode 100644
index 000000000..334a58f58
--- /dev/null
+++ b/docs/examples/02853293a5b7cd9cc7a886eb413bbeb6.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/charfilters/mapping-charfilter.asciidoc:26
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="keyword",
+ char_filter=[
+ {
+ "type": "mapping",
+ "mappings": [
+ "٠ => 0",
+ "١ => 1",
+ "٢ => 2",
+ "٣ => 3",
+ "٤ => 4",
+ "٥ => 5",
+ "٦ => 6",
+ "٧ => 7",
+ "٨ => 8",
+ "٩ => 9"
+ ]
+ }
+ ],
+ text="My license plate is ٢٥٠١٥",
+)
+print(resp)
+----
diff --git a/docs/examples/029de2f5383a42e1ac4ca1565bd2a130.asciidoc b/docs/examples/029de2f5383a42e1ac4ca1565bd2a130.asciidoc
new file mode 100644
index 000000000..c94a28285
--- /dev/null
+++ b/docs/examples/029de2f5383a42e1ac4ca1565bd2a130.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/index-prefixes.asciidoc:41
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "full_name": {
+ "type": "text",
+ "index_prefixes": {
+ "min_chars": 1,
+ "max_chars": 10
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/02b00f21e9d23d82276ace0dd154d779.asciidoc b/docs/examples/02b00f21e9d23d82276ace0dd154d779.asciidoc
new file mode 100644
index 000000000..92be54aba
--- /dev/null
+++ b/docs/examples/02b00f21e9d23d82276ace0dd154d779.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/routing-field.asciidoc:62
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ routing="user1,user2",
+ query={
+ "match": {
+ "title": "document"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/02b6aa3e5652839f03de3a655854b897.asciidoc b/docs/examples/02b6aa3e5652839f03de3a655854b897.asciidoc
new file mode 100644
index 000000000..bc1939367
--- /dev/null
+++ b/docs/examples/02b6aa3e5652839f03de3a655854b897.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-manual.asciidoc:466
+
+[source, python]
+----
+resp = client.search(
+ index="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/02c48d461536709c3fc8a0e8147c3787.asciidoc b/docs/examples/02c48d461536709c3fc8a0e8147c3787.asciidoc
new file mode 100644
index 000000000..6257ccae1
--- /dev/null
+++ b/docs/examples/02c48d461536709c3fc8a0e8147c3787.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/pipeline.asciidoc:54
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="pipelineB",
+ description="outer pipeline",
+ processors=[
+ {
+ "pipeline": {
+ "name": "pipelineA"
+ }
+ },
+ {
+ "set": {
+ "field": "outer_pipeline_set",
+ "value": "outer"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/02f65c6bab8f40bf3ce18160623d1870.asciidoc b/docs/examples/02f65c6bab8f40bf3ce18160623d1870.asciidoc
new file mode 100644
index 000000000..c34253d87
--- /dev/null
+++ b/docs/examples/02f65c6bab8f40bf3ce18160623d1870.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-index-template-v1.asciidoc:35
+
+[source, python]
+----
+resp = client.indices.get_template(
+ name="template_1",
+)
+print(resp)
+----
diff --git a/docs/examples/02fad6b80bb29c2a7e6840db2fc67b18.asciidoc b/docs/examples/02fad6b80bb29c2a7e6840db2fc67b18.asciidoc
new file mode 100644
index 000000000..32e1d86f6
--- /dev/null
+++ b/docs/examples/02fad6b80bb29c2a7e6840db2fc67b18.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/types/wildcard.asciidoc:78
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "my_wildcard": {
+ "type": "wildcard"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "my_wildcard": "This string can be quite lengthy"
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ query={
+ "wildcard": {
+ "my_wildcard": {
+ "value": "*quite*lengthy"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/0308cbd85281f95fc458042afe3f587d.asciidoc b/docs/examples/0308cbd85281f95fc458042afe3f587d.asciidoc
index e123c5da9..7ca4d69ff 100644
--- a/docs/examples/0308cbd85281f95fc458042afe3f587d.asciidoc
+++ b/docs/examples/0308cbd85281f95fc458042afe3f587d.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:79
[source, python]
@@ -5,7 +6,7 @@
resp = client.get(
index="my-index-000001",
id="0",
- _source="*.id",
+ source="*.id",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/032eac56b798bea29390e102538f4a26.asciidoc b/docs/examples/032eac56b798bea29390e102538f4a26.asciidoc
new file mode 100644
index 000000000..8f4b0e3ed
--- /dev/null
+++ b/docs/examples/032eac56b798bea29390e102538f4a26.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/refresh.asciidoc:103
+
+[source, python]
+----
+resp = client.indices.refresh(
+ index="my-index-000001,my-index-000002",
+)
+print(resp)
+----
diff --git a/docs/examples/033838729cfb5d1a28d04f69ee78d924.asciidoc b/docs/examples/033838729cfb5d1a28d04f69ee78d924.asciidoc
index ead161354..f7ac4831e 100644
--- a/docs/examples/033838729cfb5d1a28d04f69ee78d924.asciidoc
+++ b/docs/examples/033838729cfb5d1a28d04f69ee78d924.asciidoc
@@ -1,25 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:300
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "Polygon",
"orientation": "LEFT",
"coordinates": [
[
- [-177, 10],
- [176, 15],
- [172, 0],
- [176, -15],
- [-177, -10],
- [-177, 10],
+ [
+ -177,
+ 10
+ ],
+ [
+ 176,
+ 15
+ ],
+ [
+ 172,
+ 0
+ ],
+ [
+ 176,
+ -15
+ ],
+ [
+ -177,
+ -10
+ ],
+ [
+ -177,
+ 10
+ ]
]
- ],
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/0350410d11579f4e876c798ce1eaef5b.asciidoc b/docs/examples/0350410d11579f4e876c798ce1eaef5b.asciidoc
new file mode 100644
index 000000000..41f174407
--- /dev/null
+++ b/docs/examples/0350410d11579f4e876c798ce1eaef5b.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:565
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="5",
+ refresh=True,
+ document={
+ "query": {
+ "bool": {
+ "should": [
+ {
+ "match": {
+ "message": {
+ "query": "Japanese art",
+ "_name": "query1"
+ }
+ }
+ },
+ {
+ "match": {
+ "message": {
+ "query": "Holand culture",
+ "_name": "query2"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0350ff5ebb8207c004eb771088339cb4.asciidoc b/docs/examples/0350ff5ebb8207c004eb771088339cb4.asciidoc
new file mode 100644
index 000000000..5a6d5b272
--- /dev/null
+++ b/docs/examples/0350ff5ebb8207c004eb771088339cb4.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// search/rrf.asciidoc:123
+
+[source, python]
+----
+resp = client.search(
+ index="example-index",
+ retriever={
+ "rrf": {
+ "retrievers": [
+ {
+ "standard": {
+ "query": {
+ "term": {
+ "text": "blue shoes sale"
+ }
+ }
+ }
+ },
+ {
+ "standard": {
+ "query": {
+ "sparse_vector": {
+ "field": "ml.tokens",
+ "inference_id": "my_elser_model",
+ "query": "What blue shoes are on sale?"
+ }
+ }
+ }
+ }
+ ],
+ "rank_window_size": 50,
+ "rank_constant": 20
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/03582fc93683e573062bcfda45e01d69.asciidoc b/docs/examples/03582fc93683e573062bcfda45e01d69.asciidoc
new file mode 100644
index 000000000..06133d1ae
--- /dev/null
+++ b/docs/examples/03582fc93683e573062bcfda45e01d69.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/custom-analyzer.asciidoc:59
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_custom_analyzer": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "char_filter": [
+ "html_strip"
+ ],
+ "filter": [
+ "lowercase",
+ "asciifolding"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_custom_analyzer",
+ text="Is this déjà vu?",
+)
+print(resp1)
+----
diff --git a/docs/examples/035a7a919eb6513b4769a3727b7d6447.asciidoc b/docs/examples/035a7a919eb6513b4769a3727b7d6447.asciidoc
new file mode 100644
index 000000000..63e35fb7a
--- /dev/null
+++ b/docs/examples/035a7a919eb6513b4769a3727b7d6447.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/testing.asciidoc:9
+
+[source, python]
+----
+resp = client.indices.analyze(
+ analyzer="whitespace",
+ text="The quick brown fox.",
+)
+print(resp)
+----
diff --git a/docs/examples/03891265df2111a38e0b6b24c1b967e1.asciidoc b/docs/examples/03891265df2111a38e0b6b24c1b967e1.asciidoc
new file mode 100644
index 000000000..f46691025
--- /dev/null
+++ b/docs/examples/03891265df2111a38e0b6b24c1b967e1.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-service-accounts.asciidoc:267
+
+[source, python]
+----
+resp = client.security.get_service_accounts()
+print(resp)
+----
diff --git a/docs/examples/03b1d76fa0b773d5b7d74ecb7e1e1a80.asciidoc b/docs/examples/03b1d76fa0b773d5b7d74ecb7e1e1a80.asciidoc
new file mode 100644
index 000000000..3a4032e03
--- /dev/null
+++ b/docs/examples/03b1d76fa0b773d5b7d74ecb7e1e1a80.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:152
+
+[source, python]
+----
+resp = client.snapshot.restore(
+ repository="my_repository",
+ snapshot="my_snapshot_2099.05.06",
+ indices="my-index,logs-my_app-default",
+ rename_pattern="(.+)",
+ rename_replacement="restored-$1",
+)
+print(resp)
+----
diff --git a/docs/examples/03c4b815bf1e6a8c5cfcc6ddf94bc093.asciidoc b/docs/examples/03c4b815bf1e6a8c5cfcc6ddf94bc093.asciidoc
new file mode 100644
index 000000000..b8fb76686
--- /dev/null
+++ b/docs/examples/03c4b815bf1e6a8c5cfcc6ddf94bc093.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/apis/sql-search-api.asciidoc:11
+
+[source, python]
+----
+resp = client.sql.query(
+ format="txt",
+ query="SELECT * FROM library ORDER BY page_count DESC LIMIT 5",
+)
+print(resp)
+----
diff --git a/docs/examples/04412d11783dac25b5fd2ec5407078a3.asciidoc b/docs/examples/04412d11783dac25b5fd2ec5407078a3.asciidoc
new file mode 100644
index 000000000..639dc270c
--- /dev/null
+++ b/docs/examples/04412d11783dac25b5fd2ec5407078a3.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-api-key-id-api.asciidoc:86
+
+[source, python]
+----
+resp = client.connector.update_api_key_id(
+ connector_id="my-connector",
+ api_key_id="my-api-key-id",
+ api_key_secret_id="my-connector-secret-id",
+)
+print(resp)
+----
diff --git a/docs/examples/044b2f99e7438e408685b258db17f863.asciidoc b/docs/examples/044b2f99e7438e408685b258db17f863.asciidoc
new file mode 100644
index 000000000..0cea98b17
--- /dev/null
+++ b/docs/examples/044b2f99e7438e408685b258db17f863.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:141
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n process where process.name == \"regsvr32.exe\"\n ",
+ size=50,
+)
+print(resp)
+----
diff --git a/docs/examples/046b2249bbc49e77848c114cee940f17.asciidoc b/docs/examples/046b2249bbc49e77848c114cee940f17.asciidoc
new file mode 100644
index 000000000..0289db8e2
--- /dev/null
+++ b/docs/examples/046b2249bbc49e77848c114cee940f17.asciidoc
@@ -0,0 +1,55 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/text-expansion-query.asciidoc:157
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ retriever={
+ "rrf": {
+ "retrievers": [
+ {
+ "standard": {
+ "query": {
+ "multi_match": {
+ "query": "How is the weather in Jamaica?",
+ "fields": [
+ "title",
+ "description"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "standard": {
+ "query": {
+ "text_expansion": {
+ "ml.inference.title_expanded.predicted_value": {
+ "model_id": ".elser_model_2",
+ "model_text": "How is the weather in Jamaica?"
+ }
+ }
+ }
+ }
+ },
+ {
+ "standard": {
+ "query": {
+ "text_expansion": {
+ "ml.inference.description_expanded.predicted_value": {
+ "model_id": ".elser_model_2",
+ "model_text": "How is the weather in Jamaica?"
+ }
+ }
+ }
+ }
+ }
+ ],
+ "window_size": 10,
+ "rank_constant": 20
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0470d7101637568b9d3d1239f06325a7.asciidoc b/docs/examples/0470d7101637568b9d3d1239f06325a7.asciidoc
new file mode 100644
index 000000000..b8b157197
--- /dev/null
+++ b/docs/examples/0470d7101637568b9d3d1239f06325a7.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/update-desired-nodes.asciidoc:15
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_internal/desired_nodes/<history_id>/<version>",
+ headers={"Content-Type": "application/json"},
+ body={
+ "nodes": [
+ {
+ "settings": {
+ "node.name": "instance-000187",
+ "node.external_id": "instance-000187",
+ "node.roles": [
+ "data_hot",
+ "master"
+ ],
+ "node.attr.data": "hot",
+ "node.attr.logical_availability_zone": "zone-0"
+ },
+ "processors": 8,
+ "memory": "58gb",
+ "storage": "2tb"
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/047266b0d20fdb62ebc72d51952c8f6d.asciidoc b/docs/examples/047266b0d20fdb62ebc72d51952c8f6d.asciidoc
index 0e046a8d3..d36cb165e 100644
--- a/docs/examples/047266b0d20fdb62ebc72d51952c8f6d.asciidoc
+++ b/docs/examples/047266b0d20fdb62ebc72d51952c8f6d.asciidoc
@@ -1,18 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:344
[source, python]
----
resp = client.search(
- body={
- "query": {
- "multi_match": {
- "query": "Will Smith",
- "type": "cross_fields",
- "fields": ["first_name", "last_name"],
- "operator": "and",
- }
+ query={
+ "multi_match": {
+ "query": "Will Smith",
+ "type": "cross_fields",
+ "fields": [
+ "first_name",
+ "last_name"
+ ],
+ "operator": "and"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/048652b6abfe195da8ea8cef10ee01b1.asciidoc b/docs/examples/048652b6abfe195da8ea8cef10ee01b1.asciidoc
new file mode 100644
index 000000000..26a2e9379
--- /dev/null
+++ b/docs/examples/048652b6abfe195da8ea8cef10ee01b1.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/reset-transform.asciidoc:61
+
+[source, python]
+----
+resp = client.transform.reset_transform(
+ transform_id="ecommerce_transform",
+)
+print(resp)
+----
diff --git a/docs/examples/04d586a536061ec1045d0bb2dc3d1a5f.asciidoc b/docs/examples/04d586a536061ec1045d0bb2dc3d1a5f.asciidoc
new file mode 100644
index 000000000..72e07826d
--- /dev/null
+++ b/docs/examples/04d586a536061ec1045d0bb2dc3d1a5f.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/set.asciidoc:39
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="set_os",
+ description="sets the value of host.os.name from the field os",
+ processors=[
+ {
+ "set": {
+ "field": "host.os.name",
+ "value": "{{{os}}}"
+ }
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.ingest.simulate(
+ id="set_os",
+ docs=[
+ {
+ "_source": {
+ "os": "Ubuntu"
+ }
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/04d6ce0c903bd468afbecd3aa1c4a78a.asciidoc b/docs/examples/04d6ce0c903bd468afbecd3aa1c4a78a.asciidoc
new file mode 100644
index 000000000..1d0483c0f
--- /dev/null
+++ b/docs/examples/04d6ce0c903bd468afbecd3aa1c4a78a.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/put-pipeline.asciidoc:120
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline-id",
+ description="My optional pipeline description",
+ processors=[
+ {
+ "set": {
+ "description": "My optional processor description",
+ "field": "my-keyword-field",
+ "value": "foo"
+ }
+ }
+ ],
+ meta={
+ "reason": "set my-keyword-field to foo",
+ "serialization": {
+ "class": "MyPipeline",
+ "id": 10
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/04de2e3a9c00c2056b07bf9cf9e63a99.asciidoc b/docs/examples/04de2e3a9c00c2056b07bf9cf9e63a99.asciidoc
new file mode 100644
index 000000000..078edad78
--- /dev/null
+++ b/docs/examples/04de2e3a9c00c2056b07bf9cf9e63a99.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-google-vertex-ai.asciidoc:107
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="google_vertex_ai_embeddings",
+ inference_config={
+ "service": "googlevertexai",
+ "service_settings": {
+ "service_account_json": "",
+ "model_id": "",
+ "location": "",
+ "project_id": ""
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/04f5dd677c777bcb15d7d5fa63275fc8.asciidoc b/docs/examples/04f5dd677c777bcb15d7d5fa63275fc8.asciidoc
index 3ece42153..115f443da 100644
--- a/docs/examples/04f5dd677c777bcb15d7d5fa63275fc8.asciidoc
+++ b/docs/examples/04f5dd677c777bcb15d7d5fa63275fc8.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// cluster/health.asciidoc:42
[source, python]
@@ -7,4 +8,4 @@ resp = client.cluster.health(
timeout="50s",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/0502284d4685c478eb68761f979f4303.asciidoc b/docs/examples/0502284d4685c478eb68761f979f4303.asciidoc
new file mode 100644
index 000000000..7a6344c79
--- /dev/null
+++ b/docs/examples/0502284d4685c478eb68761f979f4303.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/evaluate-dfanalytics.asciidoc:315
+
+[source, python]
+----
+resp = client.ml.evaluate_data_frame(
+ index="house_price_predictions",
+ query={
+ "bool": {
+ "filter": [
+ {
+ "term": {
+ "ml.is_training": False
+ }
+ }
+ ]
+ }
+ },
+ evaluation={
+ "regression": {
+ "actual_field": "price",
+ "predicted_field": "ml.price_prediction",
+ "metrics": {
+ "r_squared": {},
+ "mse": {},
+ "msle": {
+ "offset": 10
+ },
+ "huber": {
+ "delta": 1.5
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/050b3947025fee403232b8e6e9112dab.asciidoc b/docs/examples/050b3947025fee403232b8e6e9112dab.asciidoc
new file mode 100644
index 000000000..bea3816e1
--- /dev/null
+++ b/docs/examples/050b3947025fee403232b8e6e9112dab.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:256
+
+[source, python]
+----
+resp = client.sql.query(
+ format="yaml",
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=5,
+)
+print(resp)
+----
diff --git a/docs/examples/05148cc541f447486d9daf15ab77292b.asciidoc b/docs/examples/05148cc541f447486d9daf15ab77292b.asciidoc
new file mode 100644
index 000000000..238f46aa7
--- /dev/null
+++ b/docs/examples/05148cc541f447486d9daf15ab77292b.asciidoc
@@ -0,0 +1,54 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/ilm.asciidoc:31
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="logs",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_primary_shard_size": "50gb"
+ }
+ }
+ },
+ "warm": {
+ "min_age": "30d",
+ "actions": {
+ "shrink": {
+ "number_of_shards": 1
+ },
+ "forcemerge": {
+ "max_num_segments": 1
+ }
+ }
+ },
+ "cold": {
+ "min_age": "60d",
+ "actions": {
+ "searchable_snapshot": {
+ "snapshot_repository": "found-snapshots"
+ }
+ }
+ },
+ "frozen": {
+ "min_age": "90d",
+ "actions": {
+ "searchable_snapshot": {
+ "snapshot_repository": "found-snapshots"
+ }
+ }
+ },
+ "delete": {
+ "min_age": "735d",
+ "actions": {
+ "delete": {}
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0518c673094fb18ecb491a3b78af4695.asciidoc b/docs/examples/0518c673094fb18ecb491a3b78af4695.asciidoc
new file mode 100644
index 000000000..780c32072
--- /dev/null
+++ b/docs/examples/0518c673094fb18ecb491a3b78af4695.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-allocate.asciidoc:89
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "warm": {
+ "actions": {
+ "allocate": {
+ "include": {
+ "box_type": "hot,warm"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/05284c8ea91769c09c8db47db8a6629a.asciidoc b/docs/examples/05284c8ea91769c09c8db47db8a6629a.asciidoc
new file mode 100644
index 000000000..03dfbf18d
--- /dev/null
+++ b/docs/examples/05284c8ea91769c09c8db47db8a6629a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/repositories.asciidoc:51
+
+[source, python]
+----
+resp = client.cat.repositories(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/053497b6960f80fd7b005b7c6d54358f.asciidoc b/docs/examples/053497b6960f80fd7b005b7c6d54358f.asciidoc
new file mode 100644
index 000000000..16ef7cbc7
--- /dev/null
+++ b/docs/examples/053497b6960f80fd7b005b7c6d54358f.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-delete.asciidoc:40
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "delete": {
+ "actions": {
+ "delete": {}
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/05500e77aef581d92f6c605f7a48f7df.asciidoc b/docs/examples/05500e77aef581d92f6c605f7a48f7df.asciidoc
index d3bb50fc5..6aaaf27c4 100644
--- a/docs/examples/05500e77aef581d92f6c605f7a48f7df.asciidoc
+++ b/docs/examples/05500e77aef581d92f6c605f7a48f7df.asciidoc
@@ -1,23 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:199
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "polygon",
"coordinates": [
[
- [1000, -1001],
- [1001, -1001],
- [1001, -1000],
- [1000, -1000],
- [1000, -1001],
+ [
+ 1000,
+ -1001
+ ],
+ [
+ 1001,
+ -1001
+ ],
+ [
+ 1001,
+ -1000
+ ],
+ [
+ 1000,
+ -1000
+ ],
+ [
+ 1000,
+ -1001
+ ]
]
- ],
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/059e04aaf093379401f665c33ac796dc.asciidoc b/docs/examples/059e04aaf093379401f665c33ac796dc.asciidoc
new file mode 100644
index 000000000..b1acea498
--- /dev/null
+++ b/docs/examples/059e04aaf093379401f665c33ac796dc.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keyword-marker-tokenfilter.asciidoc:163
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ {
+ "type": "keyword_marker",
+ "keywords": [
+ "jumping"
+ ]
+ },
+ "stemmer"
+ ],
+ text="fox running and jumping",
+ explain=True,
+ attributes="keyword",
+)
+print(resp)
+----
diff --git a/docs/examples/05a09078fe1016e900e445ad4039cf97.asciidoc b/docs/examples/05a09078fe1016e900e445ad4039cf97.asciidoc
new file mode 100644
index 000000000..800b53203
--- /dev/null
+++ b/docs/examples/05a09078fe1016e900e445ad4039cf97.asciidoc
@@ -0,0 +1,80 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/esql/esql-getting-started-enrich-policy.asciidoc:8
+
+[source, python]
+----
+resp = client.indices.create(
+ index="clientips",
+ mappings={
+ "properties": {
+ "client_ip": {
+ "type": "keyword"
+ },
+ "env": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="clientips",
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "client_ip": "172.21.0.5",
+ "env": "Development"
+ },
+ {
+ "index": {}
+ },
+ {
+ "client_ip": "172.21.2.113",
+ "env": "QA"
+ },
+ {
+ "index": {}
+ },
+ {
+ "client_ip": "172.21.2.162",
+ "env": "QA"
+ },
+ {
+ "index": {}
+ },
+ {
+ "client_ip": "172.21.3.15",
+ "env": "Production"
+ },
+ {
+ "index": {}
+ },
+ {
+ "client_ip": "172.21.3.16",
+ "env": "Production"
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.enrich.put_policy(
+ name="clientip_policy",
+ match={
+ "indices": "clientips",
+ "match_field": "client_ip",
+ "enrich_fields": [
+ "env"
+ ]
+ },
+)
+print(resp2)
+
+resp3 = client.enrich.execute_policy(
+ name="clientip_policy",
+ wait_for_completion=False,
+)
+print(resp3)
+----
diff --git a/docs/examples/05ba0fdd0215e313ecea8a2f8f5a43b4.asciidoc b/docs/examples/05ba0fdd0215e313ecea8a2f8f5a43b4.asciidoc
new file mode 100644
index 000000000..dde70e4ab
--- /dev/null
+++ b/docs/examples/05ba0fdd0215e313ecea8a2f8f5a43b4.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-a-data-stream.asciidoc:360
+
+[source, python]
+----
+resp = client.indices.get_data_stream(
+ name="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/05bee3adf46b9d6a2fef96c51bf958da.asciidoc b/docs/examples/05bee3adf46b9d6a2fef96c51bf958da.asciidoc
new file mode 100644
index 000000000..9827349c4
--- /dev/null
+++ b/docs/examples/05bee3adf46b9d6a2fef96c51bf958da.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/document-level-security.asciidoc:46
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="click_role",
+ indices=[
+ {
+ "names": [
+ "events-*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "query": {
+ "match": {
+ "category": "click"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/05f4a4b284f68f7fb13603d7cd854083.asciidoc b/docs/examples/05f4a4b284f68f7fb13603d7cd854083.asciidoc
new file mode 100644
index 000000000..1a8f1f517
--- /dev/null
+++ b/docs/examples/05f4a4b284f68f7fb13603d7cd854083.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/set-up-lifecycle-policy.asciidoc:332
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="logs-my_app-default",
+ settings={
+ "index": {
+ "lifecycle": {
+ "name": "new-lifecycle-policy"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/05f6049c677a156bdf9b83e71a3b87ed.asciidoc b/docs/examples/05f6049c677a156bdf9b83e71a3b87ed.asciidoc
new file mode 100644
index 000000000..b5222abb1
--- /dev/null
+++ b/docs/examples/05f6049c677a156bdf9b83e71a3b87ed.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/ssl.asciidoc:84
+
+[source, python]
+----
+resp = client.ssl.certificates()
+print(resp)
+----
diff --git a/docs/examples/0601b5cb5328c9ebff30f4be1b210f93.asciidoc b/docs/examples/0601b5cb5328c9ebff30f4be1b210f93.asciidoc
new file mode 100644
index 000000000..aac12b70e
--- /dev/null
+++ b/docs/examples/0601b5cb5328c9ebff30f4be1b210f93.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/get-snapshot-status-api.asciidoc:327
+
+[source, python]
+----
+resp = client.snapshot.status(
+ repository="my_repository",
+ snapshot="snapshot_2",
+)
+print(resp)
+----
diff --git a/docs/examples/060a56477e39f272fc5a9cfe47443cf1.asciidoc b/docs/examples/060a56477e39f272fc5a9cfe47443cf1.asciidoc
new file mode 100644
index 000000000..f7fe6adb4
--- /dev/null
+++ b/docs/examples/060a56477e39f272fc5a9cfe47443cf1.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/simplepattern-tokenizer.asciidoc:39
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "my_tokenizer"
+ }
+ },
+ "tokenizer": {
+ "my_tokenizer": {
+ "type": "simple_pattern",
+ "pattern": "[0123456789]{3}"
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="fd-786-335-514-x",
+)
+print(resp1)
+----
diff --git a/docs/examples/0620a10ff15a2bb3eb489afc24ff0131.asciidoc b/docs/examples/0620a10ff15a2bb3eb489afc24ff0131.asciidoc
new file mode 100644
index 000000000..c09677b04
--- /dev/null
+++ b/docs/examples/0620a10ff15a2bb3eb489afc24ff0131.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/common-options.asciidoc:342
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ size="surprise_me",
+)
+print(resp)
+----
diff --git a/docs/examples/06454a8e85e2d3479c90390bb955eb39.asciidoc b/docs/examples/06454a8e85e2d3479c90390bb955eb39.asciidoc
new file mode 100644
index 000000000..cc543366b
--- /dev/null
+++ b/docs/examples/06454a8e85e2d3479c90390bb955eb39.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/get-snapshot-api.asciidoc:583
+
+[source, python]
+----
+resp = client.snapshot.get(
+ repository="my_repository",
+ snapshot="snapshot*,-snapshot_3",
+ sort="name",
+)
+print(resp)
+----
diff --git a/docs/examples/066e0bdcdfa3b8afa5d1e5777f73fccb.asciidoc b/docs/examples/066e0bdcdfa3b8afa5d1e5777f73fccb.asciidoc
new file mode 100644
index 000000000..944e2ba95
--- /dev/null
+++ b/docs/examples/066e0bdcdfa3b8afa5d1e5777f73fccb.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/rollover-index.asciidoc:327
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="my-alias",
+ conditions={
+ "max_age": "7d",
+ "max_docs": 1000,
+ "max_primary_shard_size": "50gb",
+ "max_primary_shard_docs": "2000"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/069030e5f43d8f8ce3e3eca40205027e.asciidoc b/docs/examples/069030e5f43d8f8ce3e3eca40205027e.asciidoc
new file mode 100644
index 000000000..b923dec5b
--- /dev/null
+++ b/docs/examples/069030e5f43d8f8ce3e3eca40205027e.asciidoc
@@ -0,0 +1,58 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/properties.asciidoc:17
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "manager": {
+ "properties": {
+ "age": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "text"
+ }
+ }
+ },
+ "employees": {
+ "type": "nested",
+ "properties": {
+ "age": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "text"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "region": "US",
+ "manager": {
+ "name": "Alice White",
+ "age": 30
+ },
+ "employees": [
+ {
+ "name": "John Smith",
+ "age": 34
+ },
+ {
+ "name": "Peter Brown",
+ "age": 26
+ }
+ ]
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/06a761823a694850a6efe5d5bf61478c.asciidoc b/docs/examples/06a761823a694850a6efe5d5bf61478c.asciidoc
new file mode 100644
index 000000000..961e056b4
--- /dev/null
+++ b/docs/examples/06a761823a694850a6efe5d5bf61478c.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/match-enrich-policy-type-ex.asciidoc:44
+
+[source, python]
+----
+resp = client.enrich.put_policy(
+ name="users-policy",
+ match={
+ "indices": "users",
+ "match_field": "email",
+ "enrich_fields": [
+ "first_name",
+ "last_name",
+ "city",
+ "zip",
+ "state"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/06b5d3d56c4d4e3b61ae42ea26401c40.asciidoc b/docs/examples/06b5d3d56c4d4e3b61ae42ea26401c40.asciidoc
new file mode 100644
index 000000000..f4be82bcb
--- /dev/null
+++ b/docs/examples/06b5d3d56c4d4e3b61ae42ea26401c40.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// search/multi-search.asciidoc:10
+
+[source, python]
+----
+resp = client.msearch(
+ index="my-index-000001",
+ searches=[
+ {},
+ {
+ "query": {
+ "match": {
+ "message": "this is a test"
+ }
+ }
+ },
+ {
+ "index": "my-index-000002"
+ },
+ {
+ "query": {
+ "match_all": {}
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/06c0db0f42223761e32fa418066b275f.asciidoc b/docs/examples/06c0db0f42223761e32fa418066b275f.asciidoc
new file mode 100644
index 000000000..b0bea6daf
--- /dev/null
+++ b/docs/examples/06c0db0f42223761e32fa418066b275f.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/snapshot/corrupt-repository.asciidoc:97
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my-repo",
+ repository={
+ "type": "s3",
+ "settings": {
+ "bucket": "repo-bucket",
+ "client": "elastic-internal-71bcd3",
+ "base_path": "myrepo",
+ "readonly": True
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/06d65e3505dcb306977185e8545cf4a8.asciidoc b/docs/examples/06d65e3505dcb306977185e8545cf4a8.asciidoc
new file mode 100644
index 000000000..b133ad974
--- /dev/null
+++ b/docs/examples/06d65e3505dcb306977185e8545cf4a8.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/increase-cluster-shard-limit.asciidoc:172
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.total_shards_per_node": 400
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/070cf72783cfe534a04f2f64e4016052.asciidoc b/docs/examples/070cf72783cfe534a04f2f64e4016052.asciidoc
new file mode 100644
index 000000000..d4a3108eb
--- /dev/null
+++ b/docs/examples/070cf72783cfe534a04f2f64e4016052.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/subobjects.asciidoc:92
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "subobjects": False
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="metric_1",
+ document={
+ "time": "100ms",
+ "time.min": "10ms",
+ "time.max": "900ms"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/0718a0b4f4905a8c90c1ff93de557e56.asciidoc b/docs/examples/0718a0b4f4905a8c90c1ff93de557e56.asciidoc
new file mode 100644
index 000000000..754551427
--- /dev/null
+++ b/docs/examples/0718a0b4f4905a8c90c1ff93de557e56.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/extendedstats-aggregation.asciidoc:70
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size=0,
+ aggs={
+ "grades_stats": {
+ "extended_stats": {
+ "field": "grade",
+ "sigma": 3
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0721c8adec544d5ecea3fcc410e45feb.asciidoc b/docs/examples/0721c8adec544d5ecea3fcc410e45feb.asciidoc
new file mode 100644
index 000000000..84d5c2622
--- /dev/null
+++ b/docs/examples/0721c8adec544d5ecea3fcc410e45feb.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/activate-user-profile.asciidoc:98
+
+[source, python]
+----
+resp = client.security.activate_user_profile(
+ grant_type="password",
+ username="jacknich",
+ password="l0ng-r4nd0m-p@ssw0rd",
+)
+print(resp)
+----
diff --git a/docs/examples/0737ebaea33631f001fb3f4226948492.asciidoc b/docs/examples/0737ebaea33631f001fb3f4226948492.asciidoc
new file mode 100644
index 000000000..7f7af688a
--- /dev/null
+++ b/docs/examples/0737ebaea33631f001fb3f4226948492.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/geoip.asciidoc:235
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my_ip_locations",
+ mappings={
+ "properties": {
+ "geoip": {
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/073864d3f52f8f79aafdaa85a88ac46a.asciidoc b/docs/examples/073864d3f52f8f79aafdaa85a88ac46a.asciidoc
new file mode 100644
index 000000000..bb4580ebf
--- /dev/null
+++ b/docs/examples/073864d3f52f8f79aafdaa85a88ac46a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-cache.asciidoc:76
+
+[source, python]
+----
+resp = client.security.clear_cached_realms(
+ realms="*",
+)
+print(resp)
+----
diff --git a/docs/examples/0755471d7dce4785d2e7ed0c10182ea3.asciidoc b/docs/examples/0755471d7dce4785d2e7ed0c10182ea3.asciidoc
new file mode 100644
index 000000000..3e665950b
--- /dev/null
+++ b/docs/examples/0755471d7dce4785d2e7ed0c10182ea3.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/get-transform-stats.asciidoc:330
+
+[source, python]
+----
+resp = client.transform.get_transform_stats(
+ transform_id="ecommerce-customer-transform",
+)
+print(resp)
+----
diff --git a/docs/examples/07a5fdeb7805cec1d28ba288b28f5ff5.asciidoc b/docs/examples/07a5fdeb7805cec1d28ba288b28f5ff5.asciidoc
new file mode 100644
index 000000000..29406d787
--- /dev/null
+++ b/docs/examples/07a5fdeb7805cec1d28ba288b28f5ff5.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/stop-job.asciidoc:75
+
+[source, python]
+----
+resp = client.rollup.stop_job(
+ id="sensor",
+ wait_for_completion=True,
+ timeout="10s",
+)
+print(resp)
+----
diff --git a/docs/examples/07ba3eaa931f2cf110052e3544db51f8.asciidoc b/docs/examples/07ba3eaa931f2cf110052e3544db51f8.asciidoc
index b08a09b4c..dd35d3388 100644
--- a/docs/examples/07ba3eaa931f2cf110052e3544db51f8.asciidoc
+++ b/docs/examples/07ba3eaa931f2cf110052e3544db51f8.asciidoc
@@ -1,18 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:878
[source, python]
----
resp = client.reindex(
- body={
- "max_docs": 10,
- "source": {
- "index": "my-index-000001",
- "query": {
- "function_score": {"random_score": {}, "min_score": 0.9}
- },
- },
- "dest": {"index": "my-new-index-000001"},
+ max_docs=10,
+ source={
+ "index": "my-index-000001",
+ "query": {
+ "function_score": {
+ "random_score": {},
+ "min_score": 0.9
+ }
+ }
+ },
+ dest={
+ "index": "my-new-index-000001"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/07c07f6d497b1a3012aa4320f830e09e.asciidoc b/docs/examples/07c07f6d497b1a3012aa4320f830e09e.asciidoc
new file mode 100644
index 000000000..9e8d9d9d0
--- /dev/null
+++ b/docs/examples/07c07f6d497b1a3012aa4320f830e09e.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/post-forget-follower.asciidoc:133
+
+[source, python]
+----
+resp = client.ccr.forget_follower(
+ index="leader_index",
+ follower_cluster="follower_cluster",
+ follower_index="follower_index",
+ follower_index_uuid="vYpnaWPRQB6mNspmoCeYyA",
+ leader_remote_cluster="leader_cluster",
+)
+print(resp)
+----
diff --git a/docs/examples/07dadb9b0a774bd8e7f3527cf8a44afc.asciidoc b/docs/examples/07dadb9b0a774bd8e7f3527cf8a44afc.asciidoc
new file mode 100644
index 000000000..a2827083f
--- /dev/null
+++ b/docs/examples/07dadb9b0a774bd8e7f3527cf8a44afc.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/semantic-query.asciidoc:17
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "semantic": {
+ "field": "inference_field",
+ "query": "Best surfing places"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/07de76cb0e7f11c7533788faf8c093c3.asciidoc b/docs/examples/07de76cb0e7f11c7533788faf8c093c3.asciidoc
index 7c4ac788f..14b01bc80 100644
--- a/docs/examples/07de76cb0e7f11c7533788faf8c093c3.asciidoc
+++ b/docs/examples/07de76cb0e7f11c7533788faf8c093c3.asciidoc
@@ -1,17 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/flattened.asciidoc:205
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "title": {"type": "text"},
- "labels": {"type": "flattened"},
+ mappings={
+ "properties": {
+ "title": {
+ "type": "text"
+ },
+ "labels": {
+ "type": "flattened"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/07ec38b97601286ec106986a84e1e5f7.asciidoc b/docs/examples/07ec38b97601286ec106986a84e1e5f7.asciidoc
new file mode 100644
index 000000000..544088b05
--- /dev/null
+++ b/docs/examples/07ec38b97601286ec106986a84e1e5f7.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/terms-set-query.asciidoc:49
+
+[source, python]
+----
+resp = client.indices.create(
+ index="job-candidates",
+ mappings={
+ "properties": {
+ "name": {
+ "type": "keyword"
+ },
+ "programming_languages": {
+ "type": "keyword"
+ },
+ "required_matches": {
+ "type": "long"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/080c34d8151d02b760571e3a2899fa97.asciidoc b/docs/examples/080c34d8151d02b760571e3a2899fa97.asciidoc
new file mode 100644
index 000000000..f9dd1e72d
--- /dev/null
+++ b/docs/examples/080c34d8151d02b760571e3a2899fa97.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/pattern-capture-tokenfilter.asciidoc:91
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test",
+ settings={
+ "analysis": {
+ "filter": {
+ "email": {
+ "type": "pattern_capture",
+ "preserve_original": True,
+ "patterns": [
+ "([^@]+)",
+ "(\\p{L}+)",
+ "(\\d+)",
+ "@(.+)"
+ ]
+ }
+ },
+ "analyzer": {
+ "email": {
+ "tokenizer": "uax_url_email",
+ "filter": [
+ "email",
+ "lowercase",
+ "unique"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/083e514297c09e91211f0d168aef1b0b.asciidoc b/docs/examples/083e514297c09e91211f0d168aef1b0b.asciidoc
new file mode 100644
index 000000000..a80a40448
--- /dev/null
+++ b/docs/examples/083e514297c09e91211f0d168aef1b0b.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/bi-directional-disaster-recovery.asciidoc:256
+
+[source, python]
+----
+resp = client.update_by_query(
+ index="logs-generic-default",
+ query={
+ "match": {
+ "event.sequence": "97"
+ }
+ },
+ script={
+ "source": "ctx._source.event.original = params.new_event",
+ "lang": "painless",
+ "params": {
+ "new_event": "FOOBAR"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/086ec4c5d86bbf80fb80162e94037689.asciidoc b/docs/examples/086ec4c5d86bbf80fb80162e94037689.asciidoc
new file mode 100644
index 000000000..0a582ac0e
--- /dev/null
+++ b/docs/examples/086ec4c5d86bbf80fb80162e94037689.asciidoc
@@ -0,0 +1,49 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/weighted-tokens-query.asciidoc:21
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "weighted_tokens": {
+ "query_expansion_field": {
+ "tokens": {
+ "2161": 0.4679,
+ "2621": 0.307,
+ "2782": 0.1299,
+ "2851": 0.1056,
+ "3088": 0.3041,
+ "3376": 0.1038,
+ "3467": 0.4873,
+ "3684": 0.8958,
+ "4380": 0.334,
+ "4542": 0.4636,
+ "4633": 2.2805,
+ "4785": 1.2628,
+ "4860": 1.0655,
+ "5133": 1.0709,
+ "7139": 1.0016,
+ "7224": 0.2486,
+ "7387": 0.0985,
+ "7394": 0.0542,
+ "8915": 0.369,
+ "9156": 2.8947,
+ "10505": 0.2771,
+ "11464": 0.3996,
+ "13525": 0.0088,
+ "14178": 0.8161,
+ "16893": 0.1376,
+ "17851": 1.5348,
+ "19939": 0.6012
+ },
+ "pruning_config": {
+ "tokens_freq_ratio_threshold": 5,
+ "tokens_weight_threshold": 0.4,
+ "only_score_pruned_tokens": False
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0881397074d261ccc2db514daf116c31.asciidoc b/docs/examples/0881397074d261ccc2db514daf116c31.asciidoc
new file mode 100644
index 000000000..269216db0
--- /dev/null
+++ b/docs/examples/0881397074d261ccc2db514daf116c31.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:122
+
+[source, python]
+----
+resp = client.security.get_api_key(
+ id="VuaCfGcBCdbkQm-e5aOx",
+ with_limited_by=True,
+)
+print(resp)
+----
diff --git a/docs/examples/08a76b3f5a8394d8f9084113334a260a.asciidoc b/docs/examples/08a76b3f5a8394d8f9084113334a260a.asciidoc
new file mode 100644
index 000000000..391042f13
--- /dev/null
+++ b/docs/examples/08a76b3f5a8394d8f9084113334a260a.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/boxplot-aggregation.asciidoc:149
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_boxplot": {
+ "boxplot": {
+ "field": "load_time",
+ "compression": 200
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/08c9af9dd519c011deedd406f3061836.asciidoc b/docs/examples/08c9af9dd519c011deedd406f3061836.asciidoc
new file mode 100644
index 000000000..43eafcf42
--- /dev/null
+++ b/docs/examples/08c9af9dd519c011deedd406f3061836.asciidoc
@@ -0,0 +1,51 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/preview-datafeed.asciidoc:151
+
+[source, python]
+----
+resp = client.ml.preview_datafeed(
+ datafeed_config={
+ "indices": [
+ "kibana_sample_data_ecommerce"
+ ],
+ "query": {
+ "bool": {
+ "filter": [
+ {
+ "term": {
+ "_index": "kibana_sample_data_ecommerce"
+ }
+ }
+ ]
+ }
+ },
+ "scroll_size": 1000
+ },
+ job_config={
+ "description": "Find customers spending an unusually high amount in an hour",
+ "analysis_config": {
+ "bucket_span": "1h",
+ "detectors": [
+ {
+ "detector_description": "High total sales",
+ "function": "high_sum",
+ "field_name": "taxful_total_price",
+ "over_field_name": "customer_full_name.keyword"
+ }
+ ],
+ "influencers": [
+ "customer_full_name.keyword",
+ "category.keyword"
+ ]
+ },
+ "analysis_limits": {
+ "model_memory_limit": "10mb"
+ },
+ "data_description": {
+ "time_field": "order_date",
+ "time_format": "epoch_ms"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/08e08feb514b24006e13f258d617d873.asciidoc b/docs/examples/08e08feb514b24006e13f258d617d873.asciidoc
new file mode 100644
index 000000000..e72e593f0
--- /dev/null
+++ b/docs/examples/08e08feb514b24006e13f258d617d873.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:229
+
+[source, python]
+----
+resp = client.get_script(
+ id="calculate-score",
+)
+print(resp)
+----
diff --git a/docs/examples/08e79ca9fdcdfebb2c6a79e6837e649d.asciidoc b/docs/examples/08e79ca9fdcdfebb2c6a79e6837e649d.asciidoc
new file mode 100644
index 000000000..dcd90fb51
--- /dev/null
+++ b/docs/examples/08e79ca9fdcdfebb2c6a79e6837e649d.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/cardinality-aggregation.asciidoc:229
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "tag_cardinality": {
+ "cardinality": {
+ "field": "tag",
+ "missing": "N/A"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/08f20902821a4f7a73ce7b959c5bdbdc.asciidoc b/docs/examples/08f20902821a4f7a73ce7b959c5bdbdc.asciidoc
index aa8d21755..ccd8fab31 100644
--- a/docs/examples/08f20902821a4f7a73ce7b959c5bdbdc.asciidoc
+++ b/docs/examples/08f20902821a4f7a73ce7b959c5bdbdc.asciidoc
@@ -1,21 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/regexp-query.asciidoc:23
[source, python]
----
resp = client.search(
- body={
- "query": {
- "regexp": {
- "user.id": {
- "value": "k.*y",
- "flags": "ALL",
- "case_insensitive": True,
- "max_determinized_states": 10000,
- "rewrite": "constant_score_blended",
- }
+ query={
+ "regexp": {
+ "user.id": {
+ "value": "k.*y",
+ "flags": "ALL",
+ "case_insensitive": True,
+ "max_determinized_states": 10000,
+ "rewrite": "constant_score_blended"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/091200b658023db31dffc2f08a85a9cc.asciidoc b/docs/examples/091200b658023db31dffc2f08a85a9cc.asciidoc
new file mode 100644
index 000000000..bd13e2705
--- /dev/null
+++ b/docs/examples/091200b658023db31dffc2f08a85a9cc.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/total-shards-per-node.asciidoc:174
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my-index-000001",
+ settings={
+ "index": {
+ "routing.allocation.total_shards_per_node": -1
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0957bbd535f58c97b12ffba90813d64c.asciidoc b/docs/examples/0957bbd535f58c97b12ffba90813d64c.asciidoc
new file mode 100644
index 000000000..b508719c5
--- /dev/null
+++ b/docs/examples/0957bbd535f58c97b12ffba90813d64c.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:361
+
+[source, python]
+----
+resp = client.indices.create(
+ index="analyze_sample",
+ settings={
+ "index.analyze.max_token_count": 20000
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/095d60b2cfc5004c97efc49f27287262.asciidoc b/docs/examples/095d60b2cfc5004c97efc49f27287262.asciidoc
index 0ec05e171..4885def31 100644
--- a/docs/examples/095d60b2cfc5004c97efc49f27287262.asciidoc
+++ b/docs/examples/095d60b2cfc5004c97efc49f27287262.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:198
[source, python]
@@ -5,16 +6,14 @@
resp = client.search(
index="sales",
size="0",
- body={
- "aggs": {
- "sales_over_time": {
- "date_histogram": {
- "field": "date",
- "fixed_interval": "30d",
- }
+ aggs={
+ "sales_over_time": {
+ "date_histogram": {
+ "field": "date",
+ "fixed_interval": "30d"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/095e3f21941a9cc75f398389a075152d.asciidoc b/docs/examples/095e3f21941a9cc75f398389a075152d.asciidoc
index 223e062c7..01469ab8e 100644
--- a/docs/examples/095e3f21941a9cc75f398389a075152d.asciidoc
+++ b/docs/examples/095e3f21941a9cc75f398389a075152d.asciidoc
@@ -1,22 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/infer-trained-model.asciidoc:1043
[source, python]
----
resp = client.ml.infer_trained_model(
model_id="cross-encoder__ms-marco-tinybert-l-2-v2",
- body={
- "docs": [
- {
- "text_field": "Berlin has a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers."
- },
- {
- "text_field": "New York City is famous for the Metropolitan Museum of Art."
- },
- ],
- "inference_config": {
- "text_similarity": {"text": "How many people live in Berlin?"}
+ docs=[
+ {
+ "text_field": "Berlin has a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers."
},
+ {
+ "text_field": "New York City is famous for the Metropolitan Museum of Art."
+ }
+ ],
+ inference_config={
+ "text_similarity": {
+ "text": "How many people live in Berlin?"
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/09769561f082b50558fb7d8707719963.asciidoc b/docs/examples/09769561f082b50558fb7d8707719963.asciidoc
new file mode 100644
index 000000000..87f56806d
--- /dev/null
+++ b/docs/examples/09769561f082b50558fb7d8707719963.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/nodes-stats.asciidoc:2434
+
+[source, python]
+----
+resp = client.nodes.stats(
+ metric="ingest",
+ filter_path="nodes.*.ingest",
+)
+print(resp)
+----
diff --git a/docs/examples/099006ab11b52ea99693401dceee8bad.asciidoc b/docs/examples/099006ab11b52ea99693401dceee8bad.asciidoc
new file mode 100644
index 000000000..75518ba6e
--- /dev/null
+++ b/docs/examples/099006ab11b52ea99693401dceee8bad.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:215
+
+[source, python]
+----
+resp = client.put_script(
+ id="calculate-score",
+ script={
+ "lang": "painless",
+ "source": "Math.log(_score * 2) + params['my_modifier']"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/09944369863fd8666d5301d717317276.asciidoc b/docs/examples/09944369863fd8666d5301d717317276.asciidoc
new file mode 100644
index 000000000..49a7837ad
--- /dev/null
+++ b/docs/examples/09944369863fd8666d5301d717317276.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/condition-tokenfilter.asciidoc:22
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ {
+ "type": "condition",
+ "filter": [
+ "lowercase"
+ ],
+ "script": {
+ "source": "token.getTerm().length() < 5"
+ }
+ }
+ ],
+ text="THE QUICK BROWN FOX",
+)
+print(resp)
+----
diff --git a/docs/examples/09a44b619a99f6bf3f01bd5e258fd22d.asciidoc b/docs/examples/09a44b619a99f6bf3f01bd5e258fd22d.asciidoc
new file mode 100644
index 000000000..5c03718cf
--- /dev/null
+++ b/docs/examples/09a44b619a99f6bf3f01bd5e258fd22d.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/keyword-tokenizer.asciidoc:15
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="keyword",
+ text="New York",
+)
+print(resp)
+----
diff --git a/docs/examples/09a478fe32a7b7d814083ffa5297bcdf.asciidoc b/docs/examples/09a478fe32a7b7d814083ffa5297bcdf.asciidoc
new file mode 100644
index 000000000..5c1ef1cab
--- /dev/null
+++ b/docs/examples/09a478fe32a7b7d814083ffa5297bcdf.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/fuzzy-query.asciidoc:29
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "fuzzy": {
+ "user.id": {
+ "value": "ki"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/09bdf9a7e22733d668476724042a406c.asciidoc b/docs/examples/09bdf9a7e22733d668476724042a406c.asciidoc
new file mode 100644
index 000000000..38ca2dec2
--- /dev/null
+++ b/docs/examples/09bdf9a7e22733d668476724042a406c.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/ilm-tutorial.asciidoc:131
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="timeseries_template",
+ index_patterns=[
+ "timeseries"
+ ],
+ data_stream={},
+ template={
+ "settings": {
+ "number_of_shards": 1,
+ "number_of_replicas": 1,
+ "index.lifecycle.name": "timeseries_policy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/09cb1b18bf4033b4afafb25bd3dab12c.asciidoc b/docs/examples/09cb1b18bf4033b4afafb25bd3dab12c.asciidoc
new file mode 100644
index 000000000..6cc396207
--- /dev/null
+++ b/docs/examples/09cb1b18bf4033b4afafb25bd3dab12c.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/rule-query.asciidoc:64
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "rule": {
+ "match_criteria": {
+ "user_query": "pugs"
+ },
+ "ruleset_ids": [
+ "my-ruleset"
+ ],
+ "organic": {
+ "match": {
+ "description": "puggles"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/09ce0ec993c494ac01f01ef9815fcc4b.asciidoc b/docs/examples/09ce0ec993c494ac01f01ef9815fcc4b.asciidoc
new file mode 100644
index 000000000..0610af623
--- /dev/null
+++ b/docs/examples/09ce0ec993c494ac01f01ef9815fcc4b.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/grok-syntax.asciidoc:150
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my-index",
+ runtime={
+ "http.clientip": {
+ "type": "ip",
+ "script": "\n String clientip=grok('%{COMMONAPACHELOG}').extract(doc[\"message\"].value)?.clientip;\n if (clientip != null) emit(clientip);\n "
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/09d617863a103c82fb4101e6165ea7fe.asciidoc b/docs/examples/09d617863a103c82fb4101e6165ea7fe.asciidoc
index b4ddfee0e..05adb5368 100644
--- a/docs/examples/09d617863a103c82fb4101e6165ea7fe.asciidoc
+++ b/docs/examples/09d617863a103c82fb4101e6165ea7fe.asciidoc
@@ -1,9 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/match-all-query.asciidoc:11
[source, python]
----
resp = client.search(
- body={"query": {"match_all": {}}},
+ query={
+ "match_all": {}
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/09e6e06ba562f4b9bac59455e9151a80.asciidoc b/docs/examples/09e6e06ba562f4b9bac59455e9151a80.asciidoc
new file mode 100644
index 000000000..64f28519d
--- /dev/null
+++ b/docs/examples/09e6e06ba562f4b9bac59455e9151a80.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/evaluate-dfanalytics.asciidoc:517
+
+[source, python]
+----
+resp = client.ml.evaluate_data_frame(
+ index="animal_classification",
+ evaluation={
+ "classification": {
+ "actual_field": "animal_class",
+ "metrics": {
+ "auc_roc": {
+ "class_name": "dog"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0a3003fa5af850e415634b50b1029859.asciidoc b/docs/examples/0a3003fa5af850e415634b50b1029859.asciidoc
new file mode 100644
index 000000000..063193822
--- /dev/null
+++ b/docs/examples/0a3003fa5af850e415634b50b1029859.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/bi-directional-disaster-recovery.asciidoc:237
+
+[source, python]
+----
+resp = client.search(
+ index="logs-generic-default*",
+ filter_path="hits.hits._index",
+ query={
+ "match": {
+ "event.sequence": "97"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0a3186bf20b5359393406fc0cb433313.asciidoc b/docs/examples/0a3186bf20b5359393406fc0cb433313.asciidoc
new file mode 100644
index 000000000..e190e18e1
--- /dev/null
+++ b/docs/examples/0a3186bf20b5359393406fc0cb433313.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:433
+
+[source, python]
+----
+resp = client.sql.query(
+ format="json",
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=5,
+ columnar=True,
+)
+print(resp)
+----
diff --git a/docs/examples/0a46ac2968a574ce145f197f10d30152.asciidoc b/docs/examples/0a46ac2968a574ce145f197f10d30152.asciidoc
new file mode 100644
index 000000000..075bc299d
--- /dev/null
+++ b/docs/examples/0a46ac2968a574ce145f197f10d30152.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/getting-started.asciidoc:9
+
+[source, python]
+----
+resp = client.bulk(
+ index="library",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "Leviathan Wakes"
+ }
+ },
+ {
+ "name": "Leviathan Wakes",
+ "author": "James S.A. Corey",
+ "release_date": "2011-06-02",
+ "page_count": 561
+ },
+ {
+ "index": {
+ "_id": "Hyperion"
+ }
+ },
+ {
+ "name": "Hyperion",
+ "author": "Dan Simmons",
+ "release_date": "1989-05-26",
+ "page_count": 482
+ },
+ {
+ "index": {
+ "_id": "Dune"
+ }
+ },
+ {
+ "name": "Dune",
+ "author": "Frank Herbert",
+ "release_date": "1965-06-01",
+ "page_count": 604
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/0a46cc8fe93e372909660a63dc52ae3b.asciidoc b/docs/examples/0a46cc8fe93e372909660a63dc52ae3b.asciidoc
new file mode 100644
index 000000000..c08ace7f6
--- /dev/null
+++ b/docs/examples/0a46cc8fe93e372909660a63dc52ae3b.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/rollover-index.asciidoc:309
+
+[source, python]
+----
+resp = client.indices.create(
+ index="",
+ aliases={
+ "my-alias": {
+ "is_write_index": True
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0a650401134f07e40216f0d0d1a66a32.asciidoc b/docs/examples/0a650401134f07e40216f0d0d1a66a32.asciidoc
new file mode 100644
index 000000000..e9aa27856
--- /dev/null
+++ b/docs/examples/0a650401134f07e40216f0d0d1a66a32.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/allocation.asciidoc:119
+
+[source, python]
+----
+resp = client.cat.allocation(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/0a6d56a66a2652ac6de68f8bd544a175.asciidoc b/docs/examples/0a6d56a66a2652ac6de68f8bd544a175.asciidoc
new file mode 100644
index 000000000..abcfa1034
--- /dev/null
+++ b/docs/examples/0a6d56a66a2652ac6de68f8bd544a175.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/highlighting-multi-fields.asciidoc:115
+
+[source, python]
+----
+resp = client.search(
+ index="index1",
+ query={
+ "query_string": {
+ "query": "running with scissors",
+ "fields": [
+ "comment",
+ "comment.english"
+ ]
+ }
+ },
+ highlight={
+ "order": "score",
+ "fields": {
+ "comment": {
+ "matched_fields": [
+ "comment.english"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0a701bdc7b6786026f40c0be8ebfc753.asciidoc b/docs/examples/0a701bdc7b6786026f40c0be8ebfc753.asciidoc
new file mode 100644
index 000000000..f1d7d6dd2
--- /dev/null
+++ b/docs/examples/0a701bdc7b6786026f40c0be8ebfc753.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/ecommerce-tutorial.asciidoc:439
+
+[source, python]
+----
+resp = client.transform.preview_transform(
+ source={
+ "index": "kibana_sample_data_ecommerce",
+ "query": {
+ "bool": {
+ "filter": {
+ "term": {
+ "currency": "EUR"
+ }
+ }
+ }
+ }
+ },
+ latest={
+ "unique_key": [
+ "geoip.country_iso_code",
+ "geoip.region_name"
+ ],
+ "sort": "order_date"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0a758d9dec74d9e942cf41a06499234f.asciidoc b/docs/examples/0a758d9dec74d9e942cf41a06499234f.asciidoc
new file mode 100644
index 000000000..b44d34496
--- /dev/null
+++ b/docs/examples/0a758d9dec74d9e942cf41a06499234f.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:282
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "counter": 1,
+ "tags": [
+ "red"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0a84c5b7c0793be745b13eaf13e94422.asciidoc b/docs/examples/0a84c5b7c0793be745b13eaf13e94422.asciidoc
new file mode 100644
index 000000000..10cf80199
--- /dev/null
+++ b/docs/examples/0a84c5b7c0793be745b13eaf13e94422.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/total-shards-per-node.asciidoc:78
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my-index-000001",
+ settings={
+ "index": {
+ "routing.allocation.total_shards_per_node": "2"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0a9173f3b22716c78653976dc4799eae.asciidoc b/docs/examples/0a9173f3b22716c78653976dc4799eae.asciidoc
new file mode 100644
index 000000000..55bd95618
--- /dev/null
+++ b/docs/examples/0a9173f3b22716c78653976dc4799eae.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:131
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "product": {
+ "terms": {
+ "field": "product"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0ac295efdabd59e7b1f1a4577535d942.asciidoc b/docs/examples/0ac295efdabd59e7b1f1a4577535d942.asciidoc
new file mode 100644
index 000000000..276ee0b33
--- /dev/null
+++ b/docs/examples/0ac295efdabd59e7b1f1a4577535d942.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:161
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n sequence\n [ process where process.name == \"regsvr32.exe\" ]\n [ file where stringContains(file.name, \"scrobj.dll\") ]\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/0ac9e7dd7e4acba51888256326ed5ffe.asciidoc b/docs/examples/0ac9e7dd7e4acba51888256326ed5ffe.asciidoc
new file mode 100644
index 000000000..304693b81
--- /dev/null
+++ b/docs/examples/0ac9e7dd7e4acba51888256326ed5ffe.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-api.asciidoc:287
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ track_total_hits=True,
+ query={
+ "match": {
+ "user.id": "elkbee"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0ad86b582aff1235f37ccb2cc90adad5.asciidoc b/docs/examples/0ad86b582aff1235f37ccb2cc90adad5.asciidoc
new file mode 100644
index 000000000..9c3325c5f
--- /dev/null
+++ b/docs/examples/0ad86b582aff1235f37ccb2cc90adad5.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:151
+
+[source, python]
+----
+resp = client.indices.open(
+ index=".ds-my-data-stream-2099.03.07-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/0ad8edd10542ec2c4d5d8700d7e2ba97.asciidoc b/docs/examples/0ad8edd10542ec2c4d5d8700d7e2ba97.asciidoc
new file mode 100644
index 000000000..67f603109
--- /dev/null
+++ b/docs/examples/0ad8edd10542ec2c4d5d8700d7e2ba97.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-amazon-bedrock.asciidoc:144
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="amazon_bedrock_embeddings",
+ inference_config={
+ "service": "amazonbedrock",
+ "service_settings": {
+ "access_key": "",
+ "secret_key": "",
+ "region": "us-east-1",
+ "provider": "amazontitan",
+ "model": "amazon.titan-embed-text-v2:0"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0adbce828234ca221e3d03b184296407.asciidoc b/docs/examples/0adbce828234ca221e3d03b184296407.asciidoc
new file mode 100644
index 000000000..b8bef77ea
--- /dev/null
+++ b/docs/examples/0adbce828234ca221e3d03b184296407.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/common-script-uses.asciidoc:84
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my-index",
+ runtime={
+ "http.clientip": {
+ "type": "ip",
+ "script": "\n String clientip=grok('%{COMMONAPACHELOG}').extract(doc[\"message\"].value)?.clientip;\n if (clientip != null) emit(clientip); \n "
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0ade87c8cb0e3c188d2e3dce279d5cc2.asciidoc b/docs/examples/0ade87c8cb0e3c188d2e3dce279d5cc2.asciidoc
new file mode 100644
index 000000000..bf81f55e9
--- /dev/null
+++ b/docs/examples/0ade87c8cb0e3c188d2e3dce279d5cc2.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-filtering-api.asciidoc:115
+
+[source, python]
+----
+resp = client.connector.update_filtering(
+ connector_id="my-g-drive-connector",
+ rules=[
+ {
+ "field": "file_extension",
+ "id": "exclude-txt-files",
+ "order": 0,
+ "policy": "exclude",
+ "rule": "equals",
+ "value": "txt"
+ },
+ {
+ "field": "_",
+ "id": "DEFAULT",
+ "order": 1,
+ "policy": "include",
+ "rule": "regex",
+ "value": ".*"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/0aff04881be21eea45375ec4f4f50e66.asciidoc b/docs/examples/0aff04881be21eea45375ec4f4f50e66.asciidoc
new file mode 100644
index 000000000..c1a67eca1
--- /dev/null
+++ b/docs/examples/0aff04881be21eea45375ec4f4f50e66.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-api-keys.asciidoc:83
+
+[source, python]
+----
+resp = client.security.create_api_key(
+ name="my-api-key",
+)
+print(resp)
+----
diff --git a/docs/examples/0b1c5486f96bfa5db8db854c0178dbe5.asciidoc b/docs/examples/0b1c5486f96bfa5db8db854c0178dbe5.asciidoc
new file mode 100644
index 000000000..ee1d713b6
--- /dev/null
+++ b/docs/examples/0b1c5486f96bfa5db8db854c0178dbe5.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/cluster/remote-clusters-connect.asciidoc:44
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster": {
+ "remote": {
+ "cluster_one": {
+ "seeds": [
+ "127.0.0.1:{remote-interface-default-port}"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0b47b0bef81b9b5eecfb3775695bd6ad.asciidoc b/docs/examples/0b47b0bef81b9b5eecfb3775695bd6ad.asciidoc
new file mode 100644
index 000000000..e5a96397e
--- /dev/null
+++ b/docs/examples/0b47b0bef81b9b5eecfb3775695bd6ad.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// monitoring/production.asciidoc:94
+
+[source, python]
+----
+resp = client.security.put_user(
+ username="remote_monitor",
+ password="changeme",
+ roles=[
+ "remote_monitoring_agent"
+ ],
+ full_name="Internal Agent For Remote Monitoring",
+)
+print(resp)
+----
diff --git a/docs/examples/0b615ff4ef5a8847ee8109b2fd11619a.asciidoc b/docs/examples/0b615ff4ef5a8847ee8109b2fd11619a.asciidoc
new file mode 100644
index 000000000..573e75fe5
--- /dev/null
+++ b/docs/examples/0b615ff4ef5a8847ee8109b2fd11619a.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:238
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "script_score": {
+ "query": {
+ "match": {
+ "message": "some message"
+ }
+ },
+ "script": {
+ "id": "calculate-score",
+ "params": {
+ "my_modifier": 2
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0b913fb9e010d877c0be015519cfddc6.asciidoc b/docs/examples/0b913fb9e010d877c0be015519cfddc6.asciidoc
new file mode 100644
index 000000000..29e1fcdbe
--- /dev/null
+++ b/docs/examples/0b913fb9e010d877c0be015519cfddc6.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/index-mgmt.asciidoc:177
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ document={
+ "@timestamp": "2019-05-18T15:57:27.541Z",
+ "ip": "225.44.217.191",
+ "extension": "jpg",
+ "response": "200",
+ "geo": {
+ "coordinates": {
+ "lat": 38.53146222,
+ "lon": -121.7864906
+ }
+ },
+ "url": "https://media-for-the-masses.theacademyofperformingartsandscience.org/uploads/charles-fullerton.jpg"
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000002",
+ document={
+ "@timestamp": "2019-05-20T03:44:20.844Z",
+ "ip": "198.247.165.49",
+ "extension": "php",
+ "response": "200",
+ "geo": {
+ "coordinates": {
+ "lat": 37.13189556,
+ "lon": -76.4929875
+ }
+ },
+ "memory": 241720,
+ "url": "https://theacademyofperformingartsandscience.org/people/type:astronauts/name:laurel-b-clark/profile"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/0b987b4101e016653a32d7b092d47e4c.asciidoc b/docs/examples/0b987b4101e016653a32d7b092d47e4c.asciidoc
index a24c368ff..4a9446ebd 100644
--- a/docs/examples/0b987b4101e016653a32d7b092d47e4c.asciidoc
+++ b/docs/examples/0b987b4101e016653a32d7b092d47e4c.asciidoc
@@ -1,27 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/object.asciidoc:46
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "region": {"type": "keyword"},
- "manager": {
- "properties": {
- "age": {"type": "integer"},
- "name": {
- "properties": {
- "first": {"type": "text"},
- "last": {"type": "text"},
+ mappings={
+ "properties": {
+ "region": {
+ "type": "keyword"
+ },
+ "manager": {
+ "properties": {
+ "age": {
+ "type": "integer"
+ },
+ "name": {
+ "properties": {
+ "first": {
+ "type": "text"
+ },
+ "last": {
+ "type": "text"
}
- },
+ }
}
- },
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/0ba5acede9d43af424e85428e7d35420.asciidoc b/docs/examples/0ba5acede9d43af424e85428e7d35420.asciidoc
new file mode 100644
index 000000000..b1c6f894b
--- /dev/null
+++ b/docs/examples/0ba5acede9d43af424e85428e7d35420.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc:119
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="azure_openai_embeddings",
+ processors=[
+ {
+ "inference": {
+ "model_id": "azure_openai_embeddings",
+ "input_output": {
+ "input_field": "content",
+ "output_field": "content_embedding"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/0bcd380315ef4691b8c79df6ca53a85f.asciidoc b/docs/examples/0bcd380315ef4691b8c79df6ca53a85f.asciidoc
new file mode 100644
index 000000000..75c29429f
--- /dev/null
+++ b/docs/examples/0bcd380315ef4691b8c79df6ca53a85f.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:395
+
+[source, python]
+----
+resp = client.search(
+ sort=[
+ {
+ "price": {
+ "unmapped_type": "long"
+ }
+ }
+ ],
+ query={
+ "term": {
+ "product": "chocolate"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0bef1fdefeb2956d60d52d3f38397cad.asciidoc b/docs/examples/0bef1fdefeb2956d60d52d3f38397cad.asciidoc
new file mode 100644
index 000000000..8cedec16e
--- /dev/null
+++ b/docs/examples/0bef1fdefeb2956d60d52d3f38397cad.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/synthetic-source.asciidoc:17
+
+[source, python]
+----
+resp = client.indices.create(
+ index="idx",
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0c05c66cfe3a2169b1ec1aba77e26db2.asciidoc b/docs/examples/0c05c66cfe3a2169b1ec1aba77e26db2.asciidoc
new file mode 100644
index 000000000..1ea3e76db
--- /dev/null
+++ b/docs/examples/0c05c66cfe3a2169b1ec1aba77e26db2.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/rank-feature-query.asciidoc:274
+
+[source, python]
+----
+resp = client.search(
+ index="test",
+ query={
+ "rank_feature": {
+ "field": "pagerank",
+ "saturation": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0c2ca704a39dda8b3a7c5806ec6c6cf8.asciidoc b/docs/examples/0c2ca704a39dda8b3a7c5806ec6c6cf8.asciidoc
index cb5d4a15b..c2f9ea70e 100644
--- a/docs/examples/0c2ca704a39dda8b3a7c5806ec6c6cf8.asciidoc
+++ b/docs/examples/0c2ca704a39dda8b3a7c5806ec6c6cf8.asciidoc
@@ -1,17 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1379
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "runtime": {
- "http.client_ip": {
- "type": "ip",
- "script": "\n String clientip=grok('%{COMMONAPACHELOG}').extract(doc[\"message\"].value)?.clientip;\n if (clientip != null) emit(clientip); \n ",
- }
+ runtime={
+ "http.client_ip": {
+ "type": "ip",
+ "script": "\n String clientip=grok('%{COMMONAPACHELOG}').extract(doc[\"message\"].value)?.clientip;\n if (clientip != null) emit(clientip); \n "
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/0c2d9ac7e3f28d4d802e21cbbbcfeb34.asciidoc b/docs/examples/0c2d9ac7e3f28d4d802e21cbbbcfeb34.asciidoc
new file mode 100644
index 000000000..110616292
--- /dev/null
+++ b/docs/examples/0c2d9ac7e3f28d4d802e21cbbbcfeb34.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/recovery.asciidoc:113
+
+[source, python]
+----
+resp = client.cat.recovery(
+ v=True,
+ h="i,s,t,ty,st,shost,thost,f,fp,b,bp",
+)
+print(resp)
+----
diff --git a/docs/examples/0c464965126cc09e6812716a145991d4.asciidoc b/docs/examples/0c464965126cc09e6812716a145991d4.asciidoc
new file mode 100644
index 000000000..0f5465ce3
--- /dev/null
+++ b/docs/examples/0c464965126cc09e6812716a145991d4.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/nodes-info.asciidoc:301
+
+[source, python]
+----
+resp = client.nodes.info(
+ node_id="ingest",
+)
+print(resp)
+----
diff --git a/docs/examples/0c688eecf4ebdffdbe1deae0983c3ed8.asciidoc b/docs/examples/0c688eecf4ebdffdbe1deae0983c3ed8.asciidoc
new file mode 100644
index 000000000..ee4878aa9
--- /dev/null
+++ b/docs/examples/0c688eecf4ebdffdbe1deae0983c3ed8.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/cumulative-cardinality-aggregation.asciidoc:46
+
+[source, python]
+----
+resp = client.search(
+ index="user_hits",
+ size=0,
+ aggs={
+ "users_per_day": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "day"
+ },
+ "aggs": {
+ "distinct_users": {
+ "cardinality": {
+ "field": "user_id"
+ }
+ },
+ "total_new_users": {
+ "cumulative_cardinality": {
+ "buckets_path": "distinct_users"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0c6f9c9da75293fae69659ac1d6329de.asciidoc b/docs/examples/0c6f9c9da75293fae69659ac1d6329de.asciidoc
new file mode 100644
index 000000000..53ac89709
--- /dev/null
+++ b/docs/examples/0c6f9c9da75293fae69659ac1d6329de.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-tokens.asciidoc:175
+
+[source, python]
+----
+resp = client.security.invalidate_token(
+ refresh_token="vLBPvmAB6KvwvJZr27cS",
+)
+print(resp)
+----
diff --git a/docs/examples/0c6fc67c2dd1c1771cd866ce471d74e1.asciidoc b/docs/examples/0c6fc67c2dd1c1771cd866ce471d74e1.asciidoc
new file mode 100644
index 000000000..3852a2102
--- /dev/null
+++ b/docs/examples/0c6fc67c2dd1c1771cd866ce471d74e1.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-role-mappings.asciidoc:206
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="mapping4",
+ roles=[
+ "superuser"
+ ],
+ enabled=True,
+ rules={
+ "any": [
+ {
+ "field": {
+ "username": "esadmin"
+ }
+ },
+ {
+ "field": {
+ "groups": [
+ "cn=admins,dc=example,dc=com",
+ "cn=other,dc=example,dc=com"
+ ]
+ }
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0c7c40cd17985c3dd32aeaadbafc4fce.asciidoc b/docs/examples/0c7c40cd17985c3dd32aeaadbafc4fce.asciidoc
new file mode 100644
index 000000000..2a2e20cf0
--- /dev/null
+++ b/docs/examples/0c7c40cd17985c3dd32aeaadbafc4fce.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:926
+
+[source, python]
+----
+resp = client.render_search_template(
+ source={
+ "query": {
+ "match": {
+ "message": "{{^name_exists}}Hello World{{/name_exists}}"
+ }
+ }
+ },
+ params={
+ "name_exists": False
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0c892d328b73d38396aaef6d9cbcd36b.asciidoc b/docs/examples/0c892d328b73d38396aaef6d9cbcd36b.asciidoc
index 03bdd8bf3..fc37a12ca 100644
--- a/docs/examples/0c892d328b73d38396aaef6d9cbcd36b.asciidoc
+++ b/docs/examples/0c892d328b73d38396aaef6d9cbcd36b.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete.asciidoc:82
[source, python]
@@ -8,4 +9,4 @@ resp = client.delete(
routing="shard-1",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/0ca6aae1ab2f0be6127beea8a245374e.asciidoc b/docs/examples/0ca6aae1ab2f0be6127beea8a245374e.asciidoc
new file mode 100644
index 000000000..7505a8513
--- /dev/null
+++ b/docs/examples/0ca6aae1ab2f0be6127beea8a245374e.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-across-clusters.asciidoc:1004
+
+[source, python]
+----
+resp = client.async_search.submit(
+ index="my-index-000001,cluster*:my-index-000001,-cluster_three:*",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ source=[
+ "user.id",
+ "message",
+ "http.response.status_code"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/0cee58617e75f493c5049d77be1c49f3.asciidoc b/docs/examples/0cee58617e75f493c5049d77be1c49f3.asciidoc
new file mode 100644
index 000000000..d64344680
--- /dev/null
+++ b/docs/examples/0cee58617e75f493c5049d77be1c49f3.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/fuzzy-query.asciidoc:46
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "fuzzy": {
+ "user.id": {
+ "value": "ki",
+ "fuzziness": "AUTO",
+ "max_expansions": 50,
+ "prefix_length": 0,
+ "transpositions": True,
+ "rewrite": "constant_score_blended"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0cf29da4b9f0503bd1a79bdc883aadbc.asciidoc b/docs/examples/0cf29da4b9f0503bd1a79bdc883aadbc.asciidoc
new file mode 100644
index 000000000..d9190fc31
--- /dev/null
+++ b/docs/examples/0cf29da4b9f0503bd1a79bdc883aadbc.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/avg-aggregation.asciidoc:45
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size="0",
+ runtime_mappings={
+ "grade.corrected": {
+ "type": "double",
+ "script": {
+ "source": "emit(Math.min(100, doc['grade'].value * params.correction))",
+ "params": {
+ "correction": 1.2
+ }
+ }
+ }
+ },
+ aggs={
+ "avg_corrected_grade": {
+ "avg": {
+ "field": "grade.corrected"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0d0f7ece06f21e624d21b09804732f61.asciidoc b/docs/examples/0d0f7ece06f21e624d21b09804732f61.asciidoc
new file mode 100644
index 000000000..333c127ee
--- /dev/null
+++ b/docs/examples/0d0f7ece06f21e624d21b09804732f61.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/avg-aggregation.asciidoc:92
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size="0",
+ aggs={
+ "grade_avg": {
+ "avg": {
+ "field": "grade",
+ "missing": 10
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0d49474511b236bc89e768c8ee91adf1.asciidoc b/docs/examples/0d49474511b236bc89e768c8ee91adf1.asciidoc
new file mode 100644
index 000000000..3863e53ff
--- /dev/null
+++ b/docs/examples/0d49474511b236bc89e768c8ee91adf1.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/simple-query-string-query.asciidoc:24
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "simple_query_string": {
+ "query": "\"fried eggs\" +(eggplant | potato) -frittata",
+ "fields": [
+ "title^5",
+ "body"
+ ],
+ "default_operator": "and"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0d54ddad2bf6f76aa5c35f53ba77748a.asciidoc b/docs/examples/0d54ddad2bf6f76aa5c35f53ba77748a.asciidoc
new file mode 100644
index 000000000..db0a85675
--- /dev/null
+++ b/docs/examples/0d54ddad2bf6f76aa5c35f53ba77748a.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/porterstem-tokenfilter.asciidoc:28
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "porter_stem"
+ ],
+ text="the foxes jumping quickly",
+)
+print(resp)
+----
diff --git a/docs/examples/0d59af9dc556dc526b9394051efa800a.asciidoc b/docs/examples/0d59af9dc556dc526b9394051efa800a.asciidoc
new file mode 100644
index 000000000..d07d9c0d7
--- /dev/null
+++ b/docs/examples/0d59af9dc556dc526b9394051efa800a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/ignore-missing-component-templates.asciidoc:91
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="logs-foo-bar",
+)
+print(resp)
+----
diff --git a/docs/examples/0d8063b484a18f8672fb5ed8712c5c97.asciidoc b/docs/examples/0d8063b484a18f8672fb5ed8712c5c97.asciidoc
new file mode 100644
index 000000000..dd88587e1
--- /dev/null
+++ b/docs/examples/0d8063b484a18f8672fb5ed8712c5c97.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template.asciidoc:296
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="template_1",
+ index_patterns=[
+ "foo",
+ "bar"
+ ],
+ template={
+ "settings": {
+ "number_of_shards": 3
+ }
+ },
+ meta={
+ "description": "set number of shards to three",
+ "serialization": {
+ "class": "MyIndexTemplate",
+ "id": 17
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0d94d76b7f00d0459d1f8c962c144dcd.asciidoc b/docs/examples/0d94d76b7f00d0459d1f8c962c144dcd.asciidoc
new file mode 100644
index 000000000..916b6c7dd
--- /dev/null
+++ b/docs/examples/0d94d76b7f00d0459d1f8c962c144dcd.asciidoc
@@ -0,0 +1,47 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-role-mappings.asciidoc:308
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="mapping8",
+ roles=[
+ "superuser"
+ ],
+ enabled=True,
+ rules={
+ "all": [
+ {
+ "any": [
+ {
+ "field": {
+ "dn": "*,ou=admin,dc=example,dc=com"
+ }
+ },
+ {
+ "field": {
+ "username": [
+ "es-admin",
+ "es-system"
+ ]
+ }
+ }
+ ]
+ },
+ {
+ "field": {
+ "groups": "cn=people,dc=example,dc=com"
+ }
+ },
+ {
+ "except": {
+ "field": {
+ "metadata.terminated_date": None
+ }
+ }
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0da477cb8a7883539ce3ae7ac1e9c5cb.asciidoc b/docs/examples/0da477cb8a7883539ce3ae7ac1e9c5cb.asciidoc
new file mode 100644
index 000000000..58af547f4
--- /dev/null
+++ b/docs/examples/0da477cb8a7883539ce3ae7ac1e9c5cb.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/histogram-aggregation.asciidoc:89
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "prices": {
+ "histogram": {
+ "field": "price",
+ "interval": 50,
+ "min_doc_count": 1
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0da747e9d98bae157d3520ff1b489ad4.asciidoc b/docs/examples/0da747e9d98bae157d3520ff1b489ad4.asciidoc
new file mode 100644
index 000000000..259041fa3
--- /dev/null
+++ b/docs/examples/0da747e9d98bae157d3520ff1b489ad4.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/repository-s3.asciidoc:41
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_s3_repository",
+ repository={
+ "type": "s3",
+ "settings": {
+ "bucket": "my-bucket",
+ "client": "my-alternate-client"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0db06c3cba57cf442ac7fab89966e1e1.asciidoc b/docs/examples/0db06c3cba57cf442ac7fab89966e1e1.asciidoc
index 63dbade85..f5ce355fd 100644
--- a/docs/examples/0db06c3cba57cf442ac7fab89966e1e1.asciidoc
+++ b/docs/examples/0db06c3cba57cf442ac7fab89966e1e1.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/parent-join.asciidoc:76
[source, python]
@@ -5,24 +6,24 @@
resp = client.index(
index="my-index-000001",
id="1",
- refresh="true",
- body={
+ refresh=True,
+ document={
"my_id": "1",
"text": "This is a question",
- "my_join_field": "question",
+ "my_join_field": "question"
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="2",
- refresh="true",
- body={
+ refresh=True,
+ document={
"my_id": "2",
"text": "This is another question",
- "my_join_field": "question",
+ "my_join_field": "question"
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/0dd30ffe2f900dde86cc9bb601d5e68e.asciidoc b/docs/examples/0dd30ffe2f900dde86cc9bb601d5e68e.asciidoc
new file mode 100644
index 000000000..bffcc9942
--- /dev/null
+++ b/docs/examples/0dd30ffe2f900dde86cc9bb601d5e68e.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/nodes.asciidoc:378
+
+[source, python]
+----
+resp = client.cat.nodes(
+ v=True,
+ h="id,ip,port,v,m",
+)
+print(resp)
+----
diff --git a/docs/examples/0ddf705317d9c5095b4a1419a2e3bace.asciidoc b/docs/examples/0ddf705317d9c5095b4a1419a2e3bace.asciidoc
new file mode 100644
index 000000000..24bf20afd
--- /dev/null
+++ b/docs/examples/0ddf705317d9c5095b4a1419a2e3bace.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-app-privileges.asciidoc:95
+
+[source, python]
+----
+resp = client.security.get_privileges()
+print(resp)
+----
diff --git a/docs/examples/0dfa9733c94bc43c6f14c7b6984c98fb.asciidoc b/docs/examples/0dfa9733c94bc43c6f14c7b6984c98fb.asciidoc
new file mode 100644
index 000000000..41ae4d4dd
--- /dev/null
+++ b/docs/examples/0dfa9733c94bc43c6f14c7b6984c98fb.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/component-templates.asciidoc:107
+
+[source, python]
+----
+resp = client.cat.component_templates(
+ name="my-template-*",
+ v=True,
+ s="name",
+)
+print(resp)
+----
diff --git a/docs/examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc b/docs/examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc
new file mode 100644
index 000000000..fd7eec55f
--- /dev/null
+++ b/docs/examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// search-application/apis/search-application-render-query.asciidoc:114
+
+[source, python]
+----
+resp = client.search_application.render_query(
+ name="my-app",
+ body={
+ "params": {
+ "query_string": "my first query",
+ "text_fields": [
+ {
+ "name": "title",
+ "boost": 5
+ },
+ {
+ "name": "description",
+ "boost": 1
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0e0d8f652d7d29371b5ea7c7544385eb.asciidoc b/docs/examples/0e0d8f652d7d29371b5ea7c7544385eb.asciidoc
new file mode 100644
index 000000000..ffaec157b
--- /dev/null
+++ b/docs/examples/0e0d8f652d7d29371b5ea7c7544385eb.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-search.asciidoc:473
+
+[source, python]
+----
+resp = client.search(
+ index="amazon-bedrock-embeddings",
+ knn={
+ "field": "content_embedding",
+ "query_vector_builder": {
+ "text_embedding": {
+ "model_id": "amazon_bedrock_embeddings",
+ "model_text": "Calculate fuel cost"
+ }
+ },
+ "k": 10,
+ "num_candidates": 100
+ },
+ source=[
+ "id",
+ "content"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/0e118857b815b62118a30c042f079db1.asciidoc b/docs/examples/0e118857b815b62118a30c042f079db1.asciidoc
index d3f5d720d..113a0a901 100644
--- a/docs/examples/0e118857b815b62118a30c042f079db1.asciidoc
+++ b/docs/examples/0e118857b815b62118a30c042f079db1.asciidoc
@@ -1,17 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:262
[source, python]
----
resp = client.search(
- body={
- "query": {
- "multi_match": {
- "query": "quick brown f",
- "type": "phrase_prefix",
- "fields": ["subject", "message"],
- }
+ query={
+ "multi_match": {
+ "query": "quick brown f",
+ "type": "phrase_prefix",
+ "fields": [
+ "subject",
+ "message"
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/0e3abd15dde97a2334621190c4ad4f96.asciidoc b/docs/examples/0e3abd15dde97a2334621190c4ad4f96.asciidoc
new file mode 100644
index 000000000..11980d875
--- /dev/null
+++ b/docs/examples/0e3abd15dde97a2334621190c4ad4f96.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc:171
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="mistral_embeddings",
+ processors=[
+ {
+ "inference": {
+ "model_id": "mistral_embeddings",
+ "input_output": {
+ "input_field": "content",
+ "output_field": "content_embedding"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/0e3b4a48a3450cd99c95ec46d4701b58.asciidoc b/docs/examples/0e3b4a48a3450cd99c95ec46d4701b58.asciidoc
index 9548ad10c..11cd5e6c7 100644
--- a/docs/examples/0e3b4a48a3450cd99c95ec46d4701b58.asciidoc
+++ b/docs/examples/0e3b4a48a3450cd99c95ec46d4701b58.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/filter-aggregation.asciidoc:167
[source, python]
@@ -6,18 +7,36 @@ resp = client.search(
index="sales",
size="0",
filter_path="aggregations",
- body={
- "aggs": {
- "hats": {
- "filter": {"term": {"type": "hat"}},
- "aggs": {"avg_price": {"avg": {"field": "price"}}},
+ aggs={
+ "hats": {
+ "filter": {
+ "term": {
+ "type": "hat"
+ }
},
- "t_shirts": {
- "filter": {"term": {"type": "t-shirt"}},
- "aggs": {"avg_price": {"avg": {"field": "price"}}},
+ "aggs": {
+ "avg_price": {
+ "avg": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "t_shirts": {
+ "filter": {
+ "term": {
+ "type": "t-shirt"
+ }
},
+ "aggs": {
+ "avg_price": {
+ "avg": {
+ "field": "price"
+ }
+ }
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc b/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc
index dfd50fe7a..e59605478 100644
--- a/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc
+++ b/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc
@@ -1,4 +1,5 @@
-// ml/trained-models/apis/start-trained-model-deployment.asciidoc:200
+// This file is autogenerated, DO NOT EDIT
+// ml/trained-models/apis/start-trained-model-deployment.asciidoc:173
[source, python]
----
@@ -7,4 +8,4 @@ resp = client.ml.start_trained_model_deployment(
deployment_id="my_model_for_ingest",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc b/docs/examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc
index 97c6ae00b..07bbf1dbd 100644
--- a/docs/examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc
+++ b/docs/examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc
@@ -1,24 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/numeric.asciidoc:287
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {
- "f": {"type": "scaled_float", "scaling_factor": 0.01}
- },
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "f": {
+ "type": "scaled_float",
+ "scaling_factor": 0.01
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"f": 123},
+ document={
+ "f": 123
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/0e71a18d1aac61720cdc6b3f91fe643f.asciidoc b/docs/examples/0e71a18d1aac61720cdc6b3f91fe643f.asciidoc
new file mode 100644
index 000000000..51907cae9
--- /dev/null
+++ b/docs/examples/0e71a18d1aac61720cdc6b3f91fe643f.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/simple-query-string-query.asciidoc:153
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "simple_query_string": {
+ "fields": [
+ "content"
+ ],
+ "query": "foo bar -baz"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0e83f140237d75469a428ff403564bb5.asciidoc b/docs/examples/0e83f140237d75469a428ff403564bb5.asciidoc
new file mode 100644
index 000000000..32d3f186a
--- /dev/null
+++ b/docs/examples/0e83f140237d75469a428ff403564bb5.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/cluster/disk_allocator.asciidoc:162
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.disk.watermark.low": "100gb",
+ "cluster.routing.allocation.disk.watermark.high": "50gb",
+ "cluster.routing.allocation.disk.watermark.flood_stage": "10gb",
+ "cluster.info.update.interval": "1m"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0e84bb54b8a9a5387f252eeffeb1098e.asciidoc b/docs/examples/0e84bb54b8a9a5387f252eeffeb1098e.asciidoc
new file mode 100644
index 000000000..d4c8f8a01
--- /dev/null
+++ b/docs/examples/0e84bb54b8a9a5387f252eeffeb1098e.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/getting-started.asciidoc:84
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="log_error_watch",
+ trigger={
+ "schedule": {
+ "interval": "10s"
+ }
+ },
+ input={
+ "search": {
+ "request": {
+ "indices": [
+ "logs"
+ ],
+ "body": {
+ "query": {
+ "match": {
+ "message": "error"
+ }
+ }
+ }
+ }
+ }
+ },
+ condition={
+ "compare": {
+ "ctx.payload.hits.total": {
+ "gt": 0
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0ea146b178561bc8b9002bed8a35641f.asciidoc b/docs/examples/0ea146b178561bc8b9002bed8a35641f.asciidoc
new file mode 100644
index 000000000..ffc82f814
--- /dev/null
+++ b/docs/examples/0ea146b178561bc8b9002bed8a35641f.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/apis/get-autoscaling-policy.asciidoc:68
+
+[source, python]
+----
+resp = client.autoscaling.get_autoscaling_policy(
+ name="my_autoscaling_policy",
+)
+print(resp)
+----
diff --git a/docs/examples/0ea2167ce7c87d311b20c4f8c698a8d0.asciidoc b/docs/examples/0ea2167ce7c87d311b20c4f8c698a8d0.asciidoc
new file mode 100644
index 000000000..c1e1b6a99
--- /dev/null
+++ b/docs/examples/0ea2167ce7c87d311b20c4f8c698a8d0.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// search/point-in-time-api.asciidoc:152
+
+[source, python]
+----
+resp = client.search(
+ slice={
+ "id": 0,
+ "max": 2
+ },
+ query={
+ "match": {
+ "message": "foo"
+ }
+ },
+ pit={
+ "id": "46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA=="
+ },
+)
+print(resp)
+
+resp1 = client.search(
+ slice={
+ "id": 1,
+ "max": 2
+ },
+ pit={
+ "id": "46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA=="
+ },
+ query={
+ "match": {
+ "message": "foo"
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/0eae571e9e1c40a40cb4b1c9530a8987.asciidoc b/docs/examples/0eae571e9e1c40a40cb4b1c9530a8987.asciidoc
new file mode 100644
index 000000000..3741e5dca
--- /dev/null
+++ b/docs/examples/0eae571e9e1c40a40cb4b1c9530a8987.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/apis/migrate-to-data-tiers.asciidoc:154
+
+[source, python]
+----
+resp = client.ilm.migrate_to_data_tiers(
+ legacy_template_to_delete="global-template",
+ node_attribute="custom_attribute_name",
+)
+print(resp)
+----
diff --git a/docs/examples/0eb2c1284a9829224913a860190580d8.asciidoc b/docs/examples/0eb2c1284a9829224913a860190580d8.asciidoc
new file mode 100644
index 000000000..c9da65a2c
--- /dev/null
+++ b/docs/examples/0eb2c1284a9829224913a860190580d8.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/fingerprint-tokenfilter.asciidoc:76
+
+[source, python]
+----
+resp = client.indices.create(
+ index="fingerprint_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_fingerprint": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "fingerprint"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0ec2178fb0103862b47cc20bc5885972.asciidoc b/docs/examples/0ec2178fb0103862b47cc20bc5885972.asciidoc
new file mode 100644
index 000000000..6085690e0
--- /dev/null
+++ b/docs/examples/0ec2178fb0103862b47cc20bc5885972.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/register-fs-repo.asciidoc:127
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_fs_backup",
+ repository={
+ "type": "fs",
+ "settings": {
+ "location": "my_fs_backup_location",
+ "readonly": True
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0eccea755bd4f6dd47579a9022690546.asciidoc b/docs/examples/0eccea755bd4f6dd47579a9022690546.asciidoc
index f3ad93003..d5e443e7e 100644
--- a/docs/examples/0eccea755bd4f6dd47579a9022690546.asciidoc
+++ b/docs/examples/0eccea755bd4f6dd47579a9022690546.asciidoc
@@ -1,20 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// modules/cluster/remote-clusters-migration.asciidoc:132
[source, python]
----
resp = client.cluster.put_settings(
- body={
- "persistent": {
- "cluster": {
- "remote": {
- "my_remote": {
- "mode": "proxy",
- "proxy_address": "my.remote.cluster.com:9443",
- }
+ persistent={
+ "cluster": {
+ "remote": {
+ "my_remote": {
+ "mode": "proxy",
+ "proxy_address": "my.remote.cluster.com:9443"
}
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/0f2e5e006b663a88ee99b130ab1b4844.asciidoc b/docs/examples/0f2e5e006b663a88ee99b130ab1b4844.asciidoc
new file mode 100644
index 000000000..c32fb4f97
--- /dev/null
+++ b/docs/examples/0f2e5e006b663a88ee99b130ab1b4844.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:570
+
+[source, python]
+----
+resp = client.search(
+ sort=[
+ {
+ "_geo_distance": {
+ "pin.location": [
+ [
+ -70,
+ 40
+ ],
+ [
+ -71,
+ 42
+ ]
+ ],
+ "order": "asc",
+ "unit": "km"
+ }
+ }
+ ],
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0f3a78296825d507dda6771f7ceb9d61.asciidoc b/docs/examples/0f3a78296825d507dda6771f7ceb9d61.asciidoc
new file mode 100644
index 000000000..5b8d54c80
--- /dev/null
+++ b/docs/examples/0f3a78296825d507dda6771f7ceb9d61.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/cluster/allocation_filtering.asciidoc:22
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.exclude._ip": "10.0.0.1"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0f4583c56cfe5bd59eeb35bfba02957c.asciidoc b/docs/examples/0f4583c56cfe5bd59eeb35bfba02957c.asciidoc
new file mode 100644
index 000000000..b69dcbe47
--- /dev/null
+++ b/docs/examples/0f4583c56cfe5bd59eeb35bfba02957c.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// search/rank-eval.asciidoc:312
+
+[source, python]
+----
+resp = client.rank_eval(
+ index="my-index-000001",
+ requests=[
+ {
+ "id": "JFK query",
+ "request": {
+ "query": {
+ "match_all": {}
+ }
+ },
+ "ratings": []
+ }
+ ],
+ metric={
+ "recall": {
+ "k": 20,
+ "relevant_rating_threshold": 1
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0f547926ebf092e19fc5fb433e9ac8c1.asciidoc b/docs/examples/0f547926ebf092e19fc5fb433e9ac8c1.asciidoc
new file mode 100644
index 000000000..8325b3802
--- /dev/null
+++ b/docs/examples/0f547926ebf092e19fc5fb433e9ac8c1.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/porterstem-tokenfilter.asciidoc:97
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "lowercase",
+ "porter_stem"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0f7aa40ad26d59a9268630b980a3d594.asciidoc b/docs/examples/0f7aa40ad26d59a9268630b980a3d594.asciidoc
new file mode 100644
index 000000000..1efc4dc25
--- /dev/null
+++ b/docs/examples/0f7aa40ad26d59a9268630b980a3d594.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/simulate-template.asciidoc:55
+
+[source, python]
+----
+resp = client.indices.simulate_template(
+ name="template_1",
+)
+print(resp)
+----
diff --git a/docs/examples/0fa220ee3fb267020382f74aa70eb1e9.asciidoc b/docs/examples/0fa220ee3fb267020382f74aa70eb1e9.asciidoc
new file mode 100644
index 000000000..c9dab1646
--- /dev/null
+++ b/docs/examples/0fa220ee3fb267020382f74aa70eb1e9.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/state.asciidoc:151
+
+[source, python]
+----
+resp = client.cluster.state(
+ metric="_all",
+ index="foo,bar",
+)
+print(resp)
+----
diff --git a/docs/examples/0fb472645116d58ddef89ca976d15a01.asciidoc b/docs/examples/0fb472645116d58ddef89ca976d15a01.asciidoc
index a48488b5b..c12ee037a 100644
--- a/docs/examples/0fb472645116d58ddef89ca976d15a01.asciidoc
+++ b/docs/examples/0fb472645116d58ddef89ca976d15a01.asciidoc
@@ -1,48 +1,73 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:471
[source, python]
----
resp = client.bulk(
index="my-index-000001",
- refresh="true",
- body=[
- {"index": {}},
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
{
"@timestamp": 1516729294000,
"model_number": "QVKC92Q",
- "measures": {"voltage": 5.2},
+ "measures": {
+ "voltage": 5.2
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": 1516642894000,
"model_number": "QVKC92Q",
- "measures": {"voltage": 5.8},
+ "measures": {
+ "voltage": 5.8
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": 1516556494000,
"model_number": "QVKC92Q",
- "measures": {"voltage": 5.1},
+ "measures": {
+ "voltage": 5.1
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": 1516470094000,
"model_number": "QVKC92Q",
- "measures": {"voltage": 5.6},
+ "measures": {
+ "voltage": 5.6
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": 1516383694000,
"model_number": "HG537PU",
- "measures": {"voltage": 4.2},
+ "measures": {
+ "voltage": 4.2
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": 1516297294000,
"model_number": "HG537PU",
- "measures": {"voltage": 4},
- },
+ "measures": {
+ "voltage": 4
+ }
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/0fb7705ddbf1fc2b65d2de2e00fe5769.asciidoc b/docs/examples/0fb7705ddbf1fc2b65d2de2e00fe5769.asciidoc
new file mode 100644
index 000000000..e351212f5
--- /dev/null
+++ b/docs/examples/0fb7705ddbf1fc2b65d2de2e00fe5769.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/scripted-metric-aggregation.asciidoc:59
+
+[source, python]
+----
+resp = client.search(
+ index="ledger",
+ size="0",
+ aggs={
+ "profit": {
+ "scripted_metric": {
+ "init_script": {
+ "id": "my_init_script"
+ },
+ "map_script": {
+ "id": "my_map_script"
+ },
+ "combine_script": {
+ "id": "my_combine_script"
+ },
+ "params": {
+ "field": "amount"
+ },
+ "reduce_script": {
+ "id": "my_reduce_script"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0fbca60a487f5f22a4d51d73b2434cc4.asciidoc b/docs/examples/0fbca60a487f5f22a4d51d73b2434cc4.asciidoc
new file mode 100644
index 000000000..fcc8ec4b6
--- /dev/null
+++ b/docs/examples/0fbca60a487f5f22a4d51d73b2434cc4.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-mapping.asciidoc:37
+
+[source, python]
+----
+resp = client.indices.create(
+ index="elser-embeddings",
+ mappings={
+ "properties": {
+ "content_embedding": {
+ "type": "sparse_vector"
+ },
+ "content": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0fc4b589df5388da784c6d981e769e31.asciidoc b/docs/examples/0fc4b589df5388da784c6d981e769e31.asciidoc
new file mode 100644
index 000000000..938f9a3ec
--- /dev/null
+++ b/docs/examples/0fc4b589df5388da784c6d981e769e31.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template-v1.asciidoc:149
+
+[source, python]
+----
+resp = client.indices.put_template(
+ name="template_1",
+ index_patterns=[
+ "te*"
+ ],
+ settings={
+ "number_of_shards": 1
+ },
+ aliases={
+ "alias1": {},
+ "alias2": {
+ "filter": {
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
+ "routing": "shard-1"
+ },
+ "{index}-alias": {}
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0fd08e14ad651827be53897a6bdaf0b8.asciidoc b/docs/examples/0fd08e14ad651827be53897a6bdaf0b8.asciidoc
new file mode 100644
index 000000000..071b2767a
--- /dev/null
+++ b/docs/examples/0fd08e14ad651827be53897a6bdaf0b8.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/match-bool-prefix-query.asciidoc:13
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match_bool_prefix": {
+ "message": "quick brown f"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/0fe74ccd098c742619805a7c0bd0fae6.asciidoc b/docs/examples/0fe74ccd098c742619805a7c0bd0fae6.asciidoc
new file mode 100644
index 000000000..1d1721228
--- /dev/null
+++ b/docs/examples/0fe74ccd098c742619805a7c0bd0fae6.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/schedule-now-transform.asciidoc:52
+
+[source, python]
+----
+resp = client.transform.schedule_now_transform(
+ transform_id="ecommerce_transform",
+)
+print(resp)
+----
diff --git a/docs/examples/100d4e33158069f3caa32e8bfa0eb3d0.asciidoc b/docs/examples/100d4e33158069f3caa32e8bfa0eb3d0.asciidoc
index 0054253c7..89fed721d 100644
--- a/docs/examples/100d4e33158069f3caa32e8bfa0eb3d0.asciidoc
+++ b/docs/examples/100d4e33158069f3caa32e8bfa0eb3d0.asciidoc
@@ -1,15 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:175
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic": "runtime",
- "properties": {"@timestamp": {"type": "date"}},
+ mappings={
+ "dynamic": "runtime",
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/102c7de25d13c87cf28839ada9f63c95.asciidoc b/docs/examples/102c7de25d13c87cf28839ada9f63c95.asciidoc
new file mode 100644
index 000000000..7886e07a9
--- /dev/null
+++ b/docs/examples/102c7de25d13c87cf28839ada9f63c95.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:213
+
+[source, python]
+----
+resp = client.index(
+ index="index",
+ id="1",
+ document={
+ "my_date": "2016-05-11T16:30:55.328Z"
+ },
+)
+print(resp)
+
+resp1 = client.search(
+ index="index",
+ query={
+ "constant_score": {
+ "filter": {
+ "range": {
+ "my_date": {
+ "gte": "now-1h",
+ "lte": "now"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/103296e16b4233926ad1f07360385606.asciidoc b/docs/examples/103296e16b4233926ad1f07360385606.asciidoc
new file mode 100644
index 000000000..8becee40d
--- /dev/null
+++ b/docs/examples/103296e16b4233926ad1f07360385606.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1793
+
+[source, python]
+----
+resp = client.indices.create(
+ index="turkish_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "turkish_stop": {
+ "type": "stop",
+ "stopwords": "_turkish_"
+ },
+ "turkish_lowercase": {
+ "type": "lowercase",
+ "language": "turkish"
+ },
+ "turkish_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "örnek"
+ ]
+ },
+ "turkish_stemmer": {
+ "type": "stemmer",
+ "language": "turkish"
+ }
+ },
+ "analyzer": {
+ "rebuilt_turkish": {
+ "tokenizer": "standard",
+ "filter": [
+ "apostrophe",
+ "turkish_lowercase",
+ "turkish_stop",
+ "turkish_keywords",
+ "turkish_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/10535507a9735fcf06600444b9067d4c.asciidoc b/docs/examples/10535507a9735fcf06600444b9067d4c.asciidoc
index 55a00b8fa..475eb922f 100644
--- a/docs/examples/10535507a9735fcf06600444b9067d4c.asciidoc
+++ b/docs/examples/10535507a9735fcf06600444b9067d4c.asciidoc
@@ -1,33 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/text.asciidoc:184
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {
- "text": {
- "type": "text",
- "fields": {"raw": {"type": "keyword"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "text": {
+ "type": "text",
+ "fields": {
+ "raw": {
+ "type": "keyword"
+ }
}
- },
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={
+ document={
"text": [
"the quick brown fox",
"the quick brown fox",
- "jumped over the lazy dog",
+ "jumped over the lazy dog"
]
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/1070e59ba144cdf309fd9b2591612b95.asciidoc b/docs/examples/1070e59ba144cdf309fd9b2591612b95.asciidoc
new file mode 100644
index 000000000..19f844b65
--- /dev/null
+++ b/docs/examples/1070e59ba144cdf309fd9b2591612b95.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/refresh.asciidoc:98
+
+[source, python]
+----
+resp = client.index(
+ index="test",
+ id="3",
+ document={
+ "test": "test"
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="test",
+ id="4",
+ refresh=False,
+ document={
+ "test": "test"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/10796a4efa3c2a5e9e50b6bdeb08bbb9.asciidoc b/docs/examples/10796a4efa3c2a5e9e50b6bdeb08bbb9.asciidoc
new file mode 100644
index 000000000..0b6368d46
--- /dev/null
+++ b/docs/examples/10796a4efa3c2a5e9e50b6bdeb08bbb9.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/update-desired-nodes.asciidoc:74
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_internal/desired_nodes/Ywkh3INLQcuPT49f6kcppA/100",
+ headers={"Content-Type": "application/json"},
+ body={
+ "nodes": [
+ {
+ "settings": {
+ "node.name": "instance-000187",
+ "node.external_id": "instance-000187",
+ "node.roles": [
+ "data_hot",
+ "master"
+ ],
+ "node.attr.data": "hot",
+ "node.attr.logical_availability_zone": "zone-0"
+ },
+ "processors": 8,
+ "memory": "58gb",
+ "storage": "2tb"
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/109db8ff7b715aca98de8ef1ab7e44ab.asciidoc b/docs/examples/109db8ff7b715aca98de8ef1ab7e44ab.asciidoc
new file mode 100644
index 000000000..0c41f9430
--- /dev/null
+++ b/docs/examples/109db8ff7b715aca98de8ef1ab7e44ab.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/post-resume-follow.asciidoc:37
+
+[source, python]
+----
+resp = client.ccr.resume_follow(
+ index="",
+)
+print(resp)
+----
diff --git a/docs/examples/10a16abe990288253ea25a1b1712fe3d.asciidoc b/docs/examples/10a16abe990288253ea25a1b1712fe3d.asciidoc
new file mode 100644
index 000000000..eca31df98
--- /dev/null
+++ b/docs/examples/10a16abe990288253ea25a1b1712fe3d.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-user.asciidoc:232
+
+[source, python]
+----
+resp = client.perform_request(
+ "POST",
+ "/_security/_query/user",
+ params={
+ "with_profile_uid": "true"
+ },
+ headers={"Content-Type": "application/json"},
+ body={
+ "query": {
+ "prefix": {
+ "roles": "other"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/10b924bf6298aa6157ed00ce12f8edc1.asciidoc b/docs/examples/10b924bf6298aa6157ed00ce12f8edc1.asciidoc
new file mode 100644
index 000000000..0d05f28bd
--- /dev/null
+++ b/docs/examples/10b924bf6298aa6157ed00ce12f8edc1.asciidoc
@@ -0,0 +1,47 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/execute-watch.asciidoc:363
+
+[source, python]
+----
+resp = client.watcher.execute_watch(
+ ignore_condition=True,
+ watch={
+ "trigger": {
+ "schedule": {
+ "interval": "10s"
+ }
+ },
+ "input": {
+ "search": {
+ "request": {
+ "indices": [
+ "logs"
+ ],
+ "body": {
+ "query": {
+ "match": {
+ "message": "error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "condition": {
+ "compare": {
+ "ctx.payload.hits.total": {
+ "gt": 0
+ }
+ }
+ },
+ "actions": {
+ "log_error": {
+ "logging": {
+ "text": "Found {{ctx.payload.hits.total}} errors in the logs"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/10d8b17e73d31dcd907de67327ed78a2.asciidoc b/docs/examples/10d8b17e73d31dcd907de67327ed78a2.asciidoc
new file mode 100644
index 000000000..acc0d4eb3
--- /dev/null
+++ b/docs/examples/10d8b17e73d31dcd907de67327ed78a2.asciidoc
@@ -0,0 +1,51 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:578
+
+[source, python]
+----
+resp = client.indices.create(
+ index="dutch_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "dutch_stop": {
+ "type": "stop",
+ "stopwords": "_dutch_"
+ },
+ "dutch_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "voorbeeld"
+ ]
+ },
+ "dutch_stemmer": {
+ "type": "stemmer",
+ "language": "dutch"
+ },
+ "dutch_override": {
+ "type": "stemmer_override",
+ "rules": [
+ "fiets=>fiets",
+ "bromfiets=>bromfiets",
+ "ei=>eier",
+ "kind=>kinder"
+ ]
+ }
+ },
+ "analyzer": {
+ "rebuilt_dutch": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "dutch_stop",
+ "dutch_keywords",
+ "dutch_override",
+ "dutch_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/10d9da8a3b7061479be908c8c5c76cfb.asciidoc b/docs/examples/10d9da8a3b7061479be908c8c5c76cfb.asciidoc
new file mode 100644
index 000000000..c1ee092f8
--- /dev/null
+++ b/docs/examples/10d9da8a3b7061479be908c8c5c76cfb.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:217
+
+[source, python]
+----
+resp = client.security.get_api_key(
+ realm_name="native1",
+)
+print(resp)
+----
diff --git a/docs/examples/10de9fd4a38755020a07c4ec964d44c9.asciidoc b/docs/examples/10de9fd4a38755020a07c4ec964d44c9.asciidoc
new file mode 100644
index 000000000..59228f58f
--- /dev/null
+++ b/docs/examples/10de9fd4a38755020a07c4ec964d44c9.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/oidc-guide.asciidoc:431
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="oidc-example",
+ roles=[
+ "example_role"
+ ],
+ enabled=True,
+ rules={
+ "field": {
+ "realm.name": "oidc1"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/10e4c1f246ada8c6b500d8ea6c1e335f.asciidoc b/docs/examples/10e4c1f246ada8c6b500d8ea6c1e335f.asciidoc
new file mode 100644
index 000000000..7b0c9c4ed
--- /dev/null
+++ b/docs/examples/10e4c1f246ada8c6b500d8ea6c1e335f.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/shingle-tokenfilter.asciidoc:298
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_shingle": {
+ "tokenizer": "standard",
+ "filter": [
+ "shingle"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/10f0c8fed98455c460c374b50ffbb204.asciidoc b/docs/examples/10f0c8fed98455c460c374b50ffbb204.asciidoc
new file mode 100644
index 000000000..0d27bf65c
--- /dev/null
+++ b/docs/examples/10f0c8fed98455c460c374b50ffbb204.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-migrate-data-stream-from-ilm-to-dsl.asciidoc:299
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="dsl-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/10f7a2c0a952ba3bc3d20b7d5f310f41.asciidoc b/docs/examples/10f7a2c0a952ba3bc3d20b7d5f310f41.asciidoc
new file mode 100644
index 000000000..076157426
--- /dev/null
+++ b/docs/examples/10f7a2c0a952ba3bc3d20b7d5f310f41.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// search-application/apis/list-search-applications.asciidoc:94
+
+[source, python]
+----
+resp = client.search_application.list()
+print(resp)
+----
diff --git a/docs/examples/111c31db1fd29baeaa9964eafaea6789.asciidoc b/docs/examples/111c31db1fd29baeaa9964eafaea6789.asciidoc
new file mode 100644
index 000000000..388694415
--- /dev/null
+++ b/docs/examples/111c31db1fd29baeaa9964eafaea6789.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/run-as-privilege.asciidoc:184
+
+[source, python]
+----
+resp = client.security.put_user(
+ username="analyst_user",
+ refresh=True,
+ password="l0nger-r4nd0mer-p@ssw0rd",
+ roles=[
+ "my_analyst_role"
+ ],
+ full_name="Monday Jaffe",
+ metadata={
+ "innovation": 8
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/111c69ca94162c1523b799a5c14723dd.asciidoc b/docs/examples/111c69ca94162c1523b799a5c14723dd.asciidoc
index c33c7e0a9..2469f6b63 100644
--- a/docs/examples/111c69ca94162c1523b799a5c14723dd.asciidoc
+++ b/docs/examples/111c69ca94162c1523b799a5c14723dd.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/term-query.asciidoc:118
[source, python]
@@ -5,7 +6,9 @@
resp = client.index(
index="my-index-000001",
id="1",
- body={"full_text": "Quick Brown Foxes!"},
+ document={
+ "full_text": "Quick Brown Foxes!"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/113ac8466084ee6ac4ed272e342dc468.asciidoc b/docs/examples/113ac8466084ee6ac4ed272e342dc468.asciidoc
new file mode 100644
index 000000000..2a96d4dfe
--- /dev/null
+++ b/docs/examples/113ac8466084ee6ac4ed272e342dc468.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-reindex.asciidoc:161
+
+[source, python]
+----
+resp = client.reindex(
+ wait_for_completion=False,
+ source={
+ "index": "test-data",
+ "size": 50
+ },
+ dest={
+ "index": "mistral-embeddings",
+ "pipeline": "mistral_embeddings"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1147a02afa087278e51fa365fb9e06b7.asciidoc b/docs/examples/1147a02afa087278e51fa365fb9e06b7.asciidoc
index 7118af7e4..6f2b83e31 100644
--- a/docs/examples/1147a02afa087278e51fa365fb9e06b7.asciidoc
+++ b/docs/examples/1147a02afa087278e51fa365fb9e06b7.asciidoc
@@ -1,9 +1,10 @@
-// api-conventions.asciidoc:344
+// This file is autogenerated, DO NOT EDIT
+// api-conventions.asciidoc:345
[source, python]
----
resp = client.search(
- body={"size": "1000"},
+ size="1000",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/114d470e752efa9672ca68d7290fada8.asciidoc b/docs/examples/114d470e752efa9672ca68d7290fada8.asciidoc
new file mode 100644
index 000000000..5c3bcaac2
--- /dev/null
+++ b/docs/examples/114d470e752efa9672ca68d7290fada8.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/add-alias.asciidoc:10
+
+[source, python]
+----
+resp = client.indices.put_alias(
+ index="my-data-stream",
+ name="my-alias",
+)
+print(resp)
+----
diff --git a/docs/examples/1153bd92ca18356db927054958cd95c6.asciidoc b/docs/examples/1153bd92ca18356db927054958cd95c6.asciidoc
index c909089d6..7554fd8ca 100644
--- a/docs/examples/1153bd92ca18356db927054958cd95c6.asciidoc
+++ b/docs/examples/1153bd92ca18356db927054958cd95c6.asciidoc
@@ -1,20 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/function-score-query.asciidoc:269
[source, python]
----
resp = client.search(
- body={
- "query": {
- "function_score": {
- "field_value_factor": {
- "field": "my-int",
- "factor": 1.2,
- "modifier": "sqrt",
- "missing": 1,
- }
+ query={
+ "function_score": {
+ "field_value_factor": {
+ "field": "my-int",
+ "factor": 1.2,
+ "modifier": "sqrt",
+ "missing": 1
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/115529722ba30b0b0d51a7ff87e59198.asciidoc b/docs/examples/115529722ba30b0b0d51a7ff87e59198.asciidoc
new file mode 100644
index 000000000..f80eab225
--- /dev/null
+++ b/docs/examples/115529722ba30b0b0d51a7ff87e59198.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-roles.asciidoc:58
+
+[source, python]
+----
+resp = client.security.get_role(
+ name="my_admin_role",
+)
+print(resp)
+----
diff --git a/docs/examples/118f249a3b26c33416f641b33f2b74f8.asciidoc b/docs/examples/118f249a3b26c33416f641b33f2b74f8.asciidoc
new file mode 100644
index 000000000..d4d28e2f2
--- /dev/null
+++ b/docs/examples/118f249a3b26c33416f641b33f2b74f8.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/pattern-tokenizer.asciidoc:128
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "my_tokenizer"
+ }
+ },
+ "tokenizer": {
+ "my_tokenizer": {
+ "type": "pattern",
+ "pattern": ","
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="comma,separated,values",
+)
+print(resp1)
+----
diff --git a/docs/examples/11c395d1649733bcab853fe31ec393b2.asciidoc b/docs/examples/11c395d1649733bcab853fe31ec393b2.asciidoc
new file mode 100644
index 000000000..0d33f1a71
--- /dev/null
+++ b/docs/examples/11c395d1649733bcab853fe31ec393b2.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// licensing/get-license.asciidoc:56
+
+[source, python]
+----
+resp = client.license.get()
+print(resp)
+----
diff --git a/docs/examples/11c43c4aa5435f8a99dcc0d1f03c648f.asciidoc b/docs/examples/11c43c4aa5435f8a99dcc0d1f03c648f.asciidoc
new file mode 100644
index 000000000..e9e152279
--- /dev/null
+++ b/docs/examples/11c43c4aa5435f8a99dcc0d1f03c648f.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/max-aggregation.asciidoc:99
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ aggs={
+ "grade_max": {
+ "max": {
+ "field": "grade",
+ "missing": 10
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/11d9043d3050a7175069dec7e0adc963.asciidoc b/docs/examples/11d9043d3050a7175069dec7e0adc963.asciidoc
new file mode 100644
index 000000000..5d68ce582
--- /dev/null
+++ b/docs/examples/11d9043d3050a7175069dec7e0adc963.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/regexp-syntax.asciidoc:50
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "my_field": "a\\b"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/11e772ff5dbb73408ae30a1a367a0d9b.asciidoc b/docs/examples/11e772ff5dbb73408ae30a1a367a0d9b.asciidoc
new file mode 100644
index 000000000..a3009b49d
--- /dev/null
+++ b/docs/examples/11e772ff5dbb73408ae30a1a367a0d9b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/delete-pipeline.asciidoc:91
+
+[source, python]
+----
+resp = client.ingest.delete_pipeline(
+ id="*",
+)
+print(resp)
+----
diff --git a/docs/examples/11e8d6e14686efabb8634b6522c05cb5.asciidoc b/docs/examples/11e8d6e14686efabb8634b6522c05cb5.asciidoc
new file mode 100644
index 000000000..9e854328d
--- /dev/null
+++ b/docs/examples/11e8d6e14686efabb8634b6522c05cb5.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:455
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ highlight={
+ "pre_tags": [
+ "",
+ ""
+ ],
+ "post_tags": [
+ "",
+ ""
+ ],
+ "fields": {
+ "body": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1233be1d4c9c7ca54126f1a0693b26de.asciidoc b/docs/examples/1233be1d4c9c7ca54126f1a0693b26de.asciidoc
index 081d2f47e..5e3a7109e 100644
--- a/docs/examples/1233be1d4c9c7ca54126f1a0693b26de.asciidoc
+++ b/docs/examples/1233be1d4c9c7ca54126f1a0693b26de.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/parent-join.asciidoc:104
[source, python]
@@ -6,25 +7,31 @@ resp = client.index(
index="my-index-000001",
id="3",
routing="1",
- refresh="true",
- body={
+ refresh=True,
+ document={
"my_id": "3",
"text": "This is an answer",
- "my_join_field": {"name": "answer", "parent": "1"},
+ "my_join_field": {
+ "name": "answer",
+ "parent": "1"
+ }
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="4",
routing="1",
- refresh="true",
- body={
+ refresh=True,
+ document={
"my_id": "4",
"text": "This is another answer",
- "my_join_field": {"name": "answer", "parent": "1"},
+ "my_join_field": {
+ "name": "answer",
+ "parent": "1"
+ }
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/123693835b3b85b9a2fa6fd1d3ad89c7.asciidoc b/docs/examples/123693835b3b85b9a2fa6fd1d3ad89c7.asciidoc
new file mode 100644
index 000000000..c459dc208
--- /dev/null
+++ b/docs/examples/123693835b3b85b9a2fa6fd1d3ad89c7.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/routing-field.asciidoc:20
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ routing="user1",
+ refresh=True,
+ document={
+ "title": "This is a document"
+ },
+)
+print(resp)
+
+resp1 = client.get(
+ index="my-index-000001",
+ id="1",
+ routing="user1",
+)
+print(resp1)
+----
diff --git a/docs/examples/12433d2b637d002e8d5c9a1adce69d3b.asciidoc b/docs/examples/12433d2b637d002e8d5c9a1adce69d3b.asciidoc
index c405fd754..210b477f5 100644
--- a/docs/examples/12433d2b637d002e8d5c9a1adce69d3b.asciidoc
+++ b/docs/examples/12433d2b637d002e8d5c9a1adce69d3b.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:100
[source, python]
@@ -6,4 +7,4 @@ resp = client.indices.create(
index="publications",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1252fa45847edba5ec2b2f33da70ec5b.asciidoc b/docs/examples/1252fa45847edba5ec2b2f33da70ec5b.asciidoc
new file mode 100644
index 000000000..ae507cec4
--- /dev/null
+++ b/docs/examples/1252fa45847edba5ec2b2f33da70ec5b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/common-options.asciidoc:125
+
+[source, python]
+----
+resp = client.cluster.state(
+ filter_path="routing_table.indices.**.state",
+)
+print(resp)
+----
diff --git a/docs/examples/1259a9c151730e42de35bb2d1ba700c6.asciidoc b/docs/examples/1259a9c151730e42de35bb2d1ba700c6.asciidoc
index 2e9c38db7..b9f36704e 100644
--- a/docs/examples/1259a9c151730e42de35bb2d1ba700c6.asciidoc
+++ b/docs/examples/1259a9c151730e42de35bb2d1ba700c6.asciidoc
@@ -1,9 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
// indices/get-mapping.asciidoc:70
[source, python]
----
resp = client.indices.get_mapping(
- index=["my-index-000001", "my-index-000002"],
+ index="my-index-000001,my-index-000002",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/128283698535116931dca9d16a16dca2.asciidoc b/docs/examples/128283698535116931dca9d16a16dca2.asciidoc
new file mode 100644
index 000000000..70028cd42
--- /dev/null
+++ b/docs/examples/128283698535116931dca9d16a16dca2.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-roles.asciidoc:93
+
+[source, python]
+----
+resp = client.security.get_role()
+print(resp)
+----
diff --git a/docs/examples/1295f51b9e5d4ba9987b02478146b50b.asciidoc b/docs/examples/1295f51b9e5d4ba9987b02478146b50b.asciidoc
new file mode 100644
index 000000000..8f63108f6
--- /dev/null
+++ b/docs/examples/1295f51b9e5d4ba9987b02478146b50b.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/high-jvm-memory-pressure.asciidoc:70
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ settings={
+ "index.max_result_window": 5000
+ },
+)
+print(resp)
+
+resp1 = client.cluster.put_settings(
+ persistent={
+ "search.max_buckets": 20000,
+ "search.allow_expensive_queries": False
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/12cb446446211f95f651e196a1f059b4.asciidoc b/docs/examples/12cb446446211f95f651e196a1f059b4.asciidoc
new file mode 100644
index 000000000..6ac131a10
--- /dev/null
+++ b/docs/examples/12cb446446211f95f651e196a1f059b4.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:302
+
+[source, python]
+----
+resp = client.snapshot.create(
+ repository="my_repository",
+ snapshot="my_snapshot",
+ wait_for_completion=True,
+)
+print(resp)
+----
diff --git a/docs/examples/12d5ff4b8d3d832b32a7e7e2a520d0bb.asciidoc b/docs/examples/12d5ff4b8d3d832b32a7e7e2a520d0bb.asciidoc
new file mode 100644
index 000000000..8b8fe870b
--- /dev/null
+++ b/docs/examples/12d5ff4b8d3d832b32a7e7e2a520d0bb.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-calendar-event.asciidoc:156
+
+[source, python]
+----
+resp = client.ml.get_calendar_events(
+ calendar_id="planned-outages",
+ start="1635638400000",
+ end="1635724800000",
+)
+print(resp)
+----
diff --git a/docs/examples/12ec704d62ffedcb03787e6aba69d382.asciidoc b/docs/examples/12ec704d62ffedcb03787e6aba69d382.asciidoc
new file mode 100644
index 000000000..9140f950c
--- /dev/null
+++ b/docs/examples/12ec704d62ffedcb03787e6aba69d382.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/shingle-tokenfilter.asciidoc:374
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ {
+ "type": "stop",
+ "stopwords": [
+ "a"
+ ]
+ },
+ {
+ "type": "shingle",
+ "filler_token": "+"
+ }
+ ],
+ text="fox jumps a lazy dog",
+)
+print(resp)
+----
diff --git a/docs/examples/12facf3617a41551ce2f0c4d005cb1c7.asciidoc b/docs/examples/12facf3617a41551ce2f0c4d005cb1c7.asciidoc
new file mode 100644
index 000000000..492421842
--- /dev/null
+++ b/docs/examples/12facf3617a41551ce2f0c4d005cb1c7.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:82
+
+[source, python]
+----
+resp = client.indices.create(
+ index="movies",
+ mappings={
+ "properties": {
+ "name_and_plot": {
+ "type": "text"
+ },
+ "name": {
+ "type": "text",
+ "copy_to": "name_and_plot"
+ },
+ "plot": {
+ "type": "text",
+ "copy_to": "name_and_plot"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1302e24b0476e0e9af7a2c890edf9f62.asciidoc b/docs/examples/1302e24b0476e0e9af7a2c890edf9f62.asciidoc
new file mode 100644
index 000000000..c59f87b19
--- /dev/null
+++ b/docs/examples/1302e24b0476e0e9af7a2c890edf9f62.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-api.asciidoc:406
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ track_total_hits=False,
+ query={
+ "match": {
+ "user.id": "elkbee"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1313c540fef7e7c18a066f07789673fc.asciidoc b/docs/examples/1313c540fef7e7c18a066f07789673fc.asciidoc
new file mode 100644
index 000000000..0ecbcec9e
--- /dev/null
+++ b/docs/examples/1313c540fef7e7c18a066f07789673fc.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:673
+
+[source, python]
+----
+resp = client.sql.get_async(
+ id="FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=",
+ keep_alive="5d",
+ wait_for_completion_timeout="2s",
+ format="json",
+)
+print(resp)
+----
diff --git a/docs/examples/132ea3d5a0ffb6b5203e356e8329f679.asciidoc b/docs/examples/132ea3d5a0ffb6b5203e356e8329f679.asciidoc
new file mode 100644
index 000000000..256b7fa0f
--- /dev/null
+++ b/docs/examples/132ea3d5a0ffb6b5203e356e8329f679.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:315
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "date": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "1d"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/134384b8c63cfbd8d762fb01757bb3f9.asciidoc b/docs/examples/134384b8c63cfbd8d762fb01757bb3f9.asciidoc
new file mode 100644
index 000000000..ef8d5d6ba
--- /dev/null
+++ b/docs/examples/134384b8c63cfbd8d762fb01757bb3f9.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/types/constant-keyword.asciidoc:40
+
+[source, python]
+----
+resp = client.index(
+ index="logs-debug",
+ document={
+ "date": "2019-12-12",
+ "message": "Starting up Elasticsearch",
+ "level": "debug"
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="logs-debug",
+ document={
+ "date": "2019-12-12",
+ "message": "Starting up Elasticsearch"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/135819da3a4bde684357c57a49ad8e85.asciidoc b/docs/examples/135819da3a4bde684357c57a49ad8e85.asciidoc
new file mode 100644
index 000000000..90a789649
--- /dev/null
+++ b/docs/examples/135819da3a4bde684357c57a49ad8e85.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// migration/apis/deprecation.asciidoc:61
+
+[source, python]
+----
+resp = client.migration.deprecations()
+print(resp)
+----
diff --git a/docs/examples/13670d1534125831c2059eebd86d840c.asciidoc b/docs/examples/13670d1534125831c2059eebd86d840c.asciidoc
new file mode 100644
index 000000000..fe1dd7dea
--- /dev/null
+++ b/docs/examples/13670d1534125831c2059eebd86d840c.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:283
+
+[source, python]
+----
+resp = client.indices.create(
+ index="brazilian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "brazilian_stop": {
+ "type": "stop",
+ "stopwords": "_brazilian_"
+ },
+ "brazilian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "exemplo"
+ ]
+ },
+ "brazilian_stemmer": {
+ "type": "stemmer",
+ "language": "brazilian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_brazilian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "brazilian_stop",
+ "brazilian_keywords",
+ "brazilian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/136ae86b8d497dda799cf1cb583df929.asciidoc b/docs/examples/136ae86b8d497dda799cf1cb583df929.asciidoc
new file mode 100644
index 000000000..fbcdd4845
--- /dev/null
+++ b/docs/examples/136ae86b8d497dda799cf1cb583df929.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-field-mapping.asciidoc:74
+
+[source, python]
+----
+resp = client.indices.create(
+ index="publications",
+ mappings={
+ "properties": {
+ "id": {
+ "type": "text"
+ },
+ "title": {
+ "type": "text"
+ },
+ "abstract": {
+ "type": "text"
+ },
+ "author": {
+ "properties": {
+ "id": {
+ "type": "text"
+ },
+ "name": {
+ "type": "text"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/137709a0a0dc38d6094291c9fc75b804.asciidoc b/docs/examples/137709a0a0dc38d6094291c9fc75b804.asciidoc
index 517757c87..3219eef08 100644
--- a/docs/examples/137709a0a0dc38d6094291c9fc75b804.asciidoc
+++ b/docs/examples/137709a0a0dc38d6094291c9fc75b804.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:342
[source, python]
@@ -5,7 +6,12 @@
resp = client.index(
index="my-index-000001",
id="1",
- body={"counter": 1, "tags": ["production"]},
+ document={
+ "counter": 1,
+ "tags": [
+ "production"
+ ]
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/137c62a4443bdd7d5b95a15022a9dc30.asciidoc b/docs/examples/137c62a4443bdd7d5b95a15022a9dc30.asciidoc
new file mode 100644
index 000000000..2bb7664ce
--- /dev/null
+++ b/docs/examples/137c62a4443bdd7d5b95a15022a9dc30.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:86
+
+[source, python]
+----
+resp = client.indices.create(
+ index="arabic_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "arabic_stop": {
+ "type": "stop",
+ "stopwords": "_arabic_"
+ },
+ "arabic_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "مثال"
+ ]
+ },
+ "arabic_stemmer": {
+ "type": "stemmer",
+ "language": "arabic"
+ }
+ },
+ "analyzer": {
+ "rebuilt_arabic": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "decimal_digit",
+ "arabic_stop",
+ "arabic_normalization",
+ "arabic_keywords",
+ "arabic_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/138f7703c47ddf63633fdf5ca9bc7fa4.asciidoc b/docs/examples/138f7703c47ddf63633fdf5ca9bc7fa4.asciidoc
index 830c3662b..7790b2fca 100644
--- a/docs/examples/138f7703c47ddf63633fdf5ca9bc7fa4.asciidoc
+++ b/docs/examples/138f7703c47ddf63633fdf5ca9bc7fa4.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:385
[source, python]
@@ -6,7 +7,12 @@ resp = client.index(
index="my-index-000001",
id="2",
routing="user1",
- body={"counter": 1, "tags": ["env2"]},
+ document={
+ "counter": 1,
+ "tags": [
+ "env2"
+ ]
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/13917f7cfb6a382c293275ff71134ec4.asciidoc b/docs/examples/13917f7cfb6a382c293275ff71134ec4.asciidoc
new file mode 100644
index 000000000..c3ef92dfb
--- /dev/null
+++ b/docs/examples/13917f7cfb6a382c293275ff71134ec4.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:947
+
+[source, python]
+----
+resp = client.render_search_template(
+ source={
+ "query": {
+ "match": {
+ "message": "Hello {{#name_exists}}{{query_string}}{{/name_exists}}{{^name_exists}}World{{/name_exists}}"
+ }
+ }
+ },
+ params={
+ "query_string": "Kimchy",
+ "name_exists": True
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/13b02da42d3afe7f0b649e1c98ac9549.asciidoc b/docs/examples/13b02da42d3afe7f0b649e1c98ac9549.asciidoc
new file mode 100644
index 000000000..a9b0826c7
--- /dev/null
+++ b/docs/examples/13b02da42d3afe7f0b649e1c98ac9549.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keep-types-tokenfilter.asciidoc:185
+
+[source, python]
+----
+resp = client.indices.create(
+ index="keep_types_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "filter": [
+ "extract_alpha"
+ ]
+ }
+ },
+ "filter": {
+ "extract_alpha": {
+ "type": "keep_types",
+ "types": [
+ ""
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/13cc51ca3a783cdbb1f1d353eaedbf23.asciidoc b/docs/examples/13cc51ca3a783cdbb1f1d353eaedbf23.asciidoc
new file mode 100644
index 000000000..ef7891f87
--- /dev/null
+++ b/docs/examples/13cc51ca3a783cdbb1f1d353eaedbf23.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// security/troubleshooting.asciidoc:114
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "logger.org.elasticsearch.xpack.security.authc": "debug"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/13d90ba227131aefbf4fcfd5992e662a.asciidoc b/docs/examples/13d90ba227131aefbf4fcfd5992e662a.asciidoc
index 893daa14a..4a7ac32aa 100644
--- a/docs/examples/13d90ba227131aefbf4fcfd5992e662a.asciidoc
+++ b/docs/examples/13d90ba227131aefbf4fcfd5992e662a.asciidoc
@@ -1,38 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/bool-query.asciidoc:156
[source, python]
----
resp = client.search(
- body={
- "query": {
- "bool": {
- "should": [
- {
- "match": {
- "name.first": {
- "query": "shay",
- "_name": "first",
- }
+ query={
+ "bool": {
+ "should": [
+ {
+ "match": {
+ "name.first": {
+ "query": "shay",
+ "_name": "first"
}
- },
- {
- "match": {
- "name.last": {
- "query": "banon",
- "_name": "last",
- }
- }
- },
- ],
- "filter": {
- "terms": {
- "name.last": ["banon", "kimchy"],
- "_name": "test",
}
},
+ {
+ "match": {
+ "name.last": {
+ "query": "banon",
+ "_name": "last"
+ }
+ }
+ }
+ ],
+ "filter": {
+ "terms": {
+ "name.last": [
+ "banon",
+ "kimchy"
+ ],
+ "_name": "test"
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/13df08eefc9ba98e311793bbca74133b.asciidoc b/docs/examples/13df08eefc9ba98e311793bbca74133b.asciidoc
new file mode 100644
index 000000000..4a3854b00
--- /dev/null
+++ b/docs/examples/13df08eefc9ba98e311793bbca74133b.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-user-profile.asciidoc:109
+
+[source, python]
+----
+resp = client.security.get_user_profile(
+ uid="u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0",
+ data="app1.key1",
+)
+print(resp)
+----
diff --git a/docs/examples/13e3fefbf55f672926aa389d76fc8bea.asciidoc b/docs/examples/13e3fefbf55f672926aa389d76fc8bea.asciidoc
new file mode 100644
index 000000000..6cfcc1d20
--- /dev/null
+++ b/docs/examples/13e3fefbf55f672926aa389d76fc8bea.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// security/securing-communications/change-passwords-native-users.asciidoc:42
+
+[source, python]
+----
+resp = client.security.change_password(
+ username="user1",
+ password="new-test-password",
+)
+print(resp)
+----
diff --git a/docs/examples/13ebcb01ebf1b5d2b5c52739db47e30c.asciidoc b/docs/examples/13ebcb01ebf1b5d2b5c52739db47e30c.asciidoc
new file mode 100644
index 000000000..88ec7cb6a
--- /dev/null
+++ b/docs/examples/13ebcb01ebf1b5d2b5c52739db47e30c.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/recovery.asciidoc:193
+
+[source, python]
+----
+resp = client.indices.recovery(
+ index="index1,index2",
+ human=True,
+)
+print(resp)
+----
diff --git a/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc b/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc
index c323d4b7d..fa54e865d 100644
--- a/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc
+++ b/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// inference/post-inference.asciidoc:201
[source, python]
@@ -5,9 +6,7 @@
resp = client.inference.inference(
task_type="sparse_embedding",
inference_id="my-elser-model",
- body={
- "input": "The sky above the port was the color of television tuned to a dead channel."
- },
+ input="The sky above the port was the color of television tuned to a dead channel.",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1420a22aa817c7a996baaed0ad366d6f.asciidoc b/docs/examples/1420a22aa817c7a996baaed0ad366d6f.asciidoc
new file mode 100644
index 000000000..e6437237a
--- /dev/null
+++ b/docs/examples/1420a22aa817c7a996baaed0ad366d6f.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/semantic-query.asciidoc:143
+
+[source, python]
+----
+resp = client.search(
+ index="test-index",
+ query={
+ "nested": {
+ "path": "inference_field.inference.chunks",
+ "query": {
+ "sparse_vector": {
+ "field": "inference_field.inference.chunks.embeddings",
+ "inference_id": "my-inference-id",
+ "query": "mountain lake"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/14254a0e725044faedf9370ead76f6ce.asciidoc b/docs/examples/14254a0e725044faedf9370ead76f6ce.asciidoc
new file mode 100644
index 000000000..e6a6e559c
--- /dev/null
+++ b/docs/examples/14254a0e725044faedf9370ead76f6ce.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-api.asciidoc:465
+
+[source, python]
+----
+resp = client.search(
+ q="user.id:elkbee",
+ size="0",
+ terminate_after="1",
+)
+print(resp)
+----
diff --git a/docs/examples/142de21c40e84e2e2d8d832e5b3b36db.asciidoc b/docs/examples/142de21c40e84e2e2d8d832e5b3b36db.asciidoc
new file mode 100644
index 000000000..004fb60a8
--- /dev/null
+++ b/docs/examples/142de21c40e84e2e2d8d832e5b3b36db.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/migrate-to-data-tiers-routing-guide.asciidoc:175
+
+[source, python]
+----
+resp = client.ilm.migrate_to_data_tiers()
+print(resp)
+----
diff --git a/docs/examples/1445ca2e813ed1c25504107b4b11760e.asciidoc b/docs/examples/1445ca2e813ed1c25504107b4b11760e.asciidoc
new file mode 100644
index 000000000..ae508343c
--- /dev/null
+++ b/docs/examples/1445ca2e813ed1c25504107b4b11760e.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/getting-started.asciidoc:205
+
+[source, python]
+----
+resp = client.ccr.follow(
+ index="server-metrics-follower",
+ wait_for_active_shards="1",
+ remote_cluster="leader",
+ leader_index="server-metrics",
+)
+print(resp)
+----
diff --git a/docs/examples/1452829804551d2d6acedd4e73b29637.asciidoc b/docs/examples/1452829804551d2d6acedd4e73b29637.asciidoc
new file mode 100644
index 000000000..a5d8ae41a
--- /dev/null
+++ b/docs/examples/1452829804551d2d6acedd4e73b29637.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/ignore-missing-component-templates.asciidoc:62
+
+[source, python]
+----
+resp = client.indices.create_data_stream(
+ name="logs-foo-bar",
+)
+print(resp)
+----
diff --git a/docs/examples/146bd22fd0e7be2345619e8f11d3a4cb.asciidoc b/docs/examples/146bd22fd0e7be2345619e8f11d3a4cb.asciidoc
new file mode 100644
index 000000000..e1ecfa48c
--- /dev/null
+++ b/docs/examples/146bd22fd0e7be2345619e8f11d3a4cb.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/hotspotting.asciidoc:247
+
+[source, python]
+----
+resp = client.cat.tasks(
+ v=True,
+ s="time:desc",
+ h="type,action,running_time,node,cancellable",
+)
+print(resp)
+----
diff --git a/docs/examples/147d341cb212dcc015c129a9c5dcf9c9.asciidoc b/docs/examples/147d341cb212dcc015c129a9c5dcf9c9.asciidoc
index 18e2e1d8a..b4f01a0ca 100644
--- a/docs/examples/147d341cb212dcc015c129a9c5dcf9c9.asciidoc
+++ b/docs/examples/147d341cb212dcc015c129a9c5dcf9c9.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/put-trained-models-aliases.asciidoc:82
[source, python]
@@ -7,4 +8,4 @@ resp = client.ml.put_trained_model_alias(
model_alias="flight_delay_model",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/148edc235fcfbc263561f87f5533e688.asciidoc b/docs/examples/148edc235fcfbc263561f87f5533e688.asciidoc
new file mode 100644
index 000000000..8b97c4933
--- /dev/null
+++ b/docs/examples/148edc235fcfbc263561f87f5533e688.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:196
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "percolate": {
+ "field": "query",
+ "documents": [
+ {
+ "message": "bonsai tree"
+ },
+ {
+ "message": "new tree"
+ },
+ {
+ "message": "the office"
+ },
+ {
+ "message": "office tree"
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/14936b96cfb8ff999a833f615ba75495.asciidoc b/docs/examples/14936b96cfb8ff999a833f615ba75495.asciidoc
new file mode 100644
index 000000000..cecbb0ba3
--- /dev/null
+++ b/docs/examples/14936b96cfb8ff999a833f615ba75495.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:518
+
+[source, python]
+----
+resp = client.search(
+ index="bicycles,other_cycles",
+ query={
+ "bool": {
+ "must": {
+ "match": {
+ "description": "dutch"
+ }
+ },
+ "filter": {
+ "term": {
+ "cycle_type": "bicycle"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/149a0eea54cdf6ea3052af6dba2d2a63.asciidoc b/docs/examples/149a0eea54cdf6ea3052af6dba2d2a63.asciidoc
new file mode 100644
index 000000000..990fb0cb2
--- /dev/null
+++ b/docs/examples/149a0eea54cdf6ea3052af6dba2d2a63.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-set-priority.asciidoc:29
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "warm": {
+ "actions": {
+ "set_priority": {
+ "priority": 50
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/14a1db30e13eb1d03cfd9710ca847ebb.asciidoc b/docs/examples/14a1db30e13eb1d03cfd9710ca847ebb.asciidoc
new file mode 100644
index 000000000..3d8bd3fc7
--- /dev/null
+++ b/docs/examples/14a1db30e13eb1d03cfd9710ca847ebb.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-manage-new-data-stream.asciidoc:65
+
+[source, python]
+----
+resp = client.bulk(
+ index="my-data-stream",
+ operations=[
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2099-05-06T16:21:15.000Z",
+ "message": "192.0.2.42 - - [06/May/2099:16:21:15 +0000] \"GET /images/bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2099-05-06T16:25:42.000Z",
+ "message": "192.0.2.255 - - [06/May/2099:16:25:42 +0000] \"GET /favicon.ico HTTP/1.0\" 200 3638"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/14a33c364873c2f930ca83d0a3005389.asciidoc b/docs/examples/14a33c364873c2f930ca83d0a3005389.asciidoc
new file mode 100644
index 000000000..4adbc677c
--- /dev/null
+++ b/docs/examples/14a33c364873c2f930ca83d0a3005389.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/disk-usage-exceeded.asciidoc:34
+
+[source, python]
+----
+resp = client.cluster.allocation_explain(
+ index="my-index",
+ shard=0,
+ primary=False,
+)
+print(resp)
+----
diff --git a/docs/examples/14a49c13c399840e64c00b487aa820c9.asciidoc b/docs/examples/14a49c13c399840e64c00b487aa820c9.asciidoc
index 0cbdc76c0..733cdfc77 100644
--- a/docs/examples/14a49c13c399840e64c00b487aa820c9.asciidoc
+++ b/docs/examples/14a49c13c399840e64c00b487aa820c9.asciidoc
@@ -1,24 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/date_nanos.asciidoc:160
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"date": {"type": "date_nanos"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "date": {
+ "type": "date_nanos"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={
- "date": ["2015-01-01T12:10:30.000Z", "2014-01-01T12:10:30.000Z"]
+ document={
+ "date": [
+ "2015-01-01T12:10:30.000Z",
+ "2014-01-01T12:10:30.000Z"
+ ]
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/14af7e2899e64f231068bded6aaf9ec5.asciidoc b/docs/examples/14af7e2899e64f231068bded6aaf9ec5.asciidoc
new file mode 100644
index 000000000..3b3fc3305
--- /dev/null
+++ b/docs/examples/14af7e2899e64f231068bded6aaf9ec5.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/dynamic.asciidoc:27
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="2",
+ document={
+ "username": "marywhite",
+ "email": "mary@white.com",
+ "name": {
+ "first": "Mary",
+ "middle": "Alice",
+ "last": "White"
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.get_mapping(
+ index="my-index-000001",
+)
+print(resp1)
+----
diff --git a/docs/examples/14afe65afee3d43f27aaaa5b37f26a31.asciidoc b/docs/examples/14afe65afee3d43f27aaaa5b37f26a31.asciidoc
index b766a5b55..aa8d3a08b 100644
--- a/docs/examples/14afe65afee3d43f27aaaa5b37f26a31.asciidoc
+++ b/docs/examples/14afe65afee3d43f27aaaa5b37f26a31.asciidoc
@@ -1,15 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:165
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "Point",
- "coordinates": [-77.03653, 38.897676],
+ "coordinates": [
+ -77.03653,
+ 38.897676
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/14b81f96297952970b78a3216e059596.asciidoc b/docs/examples/14b81f96297952970b78a3216e059596.asciidoc
new file mode 100644
index 000000000..11c9b50c0
--- /dev/null
+++ b/docs/examples/14b81f96297952970b78a3216e059596.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/async-search.asciidoc:153
+
+[source, python]
+----
+resp = client.async_search.get(
+ id="FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=",
+)
+print(resp)
+----
diff --git a/docs/examples/14f124294a4a0e3a657d1468c36161cd.asciidoc b/docs/examples/14f124294a4a0e3a657d1468c36161cd.asciidoc
index 58e6b33e9..b7dae756b 100644
--- a/docs/examples/14f124294a4a0e3a657d1468c36161cd.asciidoc
+++ b/docs/examples/14f124294a4a0e3a657d1468c36161cd.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/aggregate-metric-double.asciidoc:205
[source, python]
----
resp = client.search(
index="stats-index",
- body={"query": {"term": {"agg_metric": {"value": 702.3}}}},
+ query={
+ "term": {
+ "agg_metric": {
+ "value": 702.3
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/14f2dab0583c5a9fcc39931d33194872.asciidoc b/docs/examples/14f2dab0583c5a9fcc39931d33194872.asciidoc
new file mode 100644
index 000000000..02193c365
--- /dev/null
+++ b/docs/examples/14f2dab0583c5a9fcc39931d33194872.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/examples.asciidoc:296
+
+[source, python]
+----
+resp = client.search(
+ index="sample_weblogs_by_clientip",
+)
+print(resp)
+----
diff --git a/docs/examples/150b5fee5678bf8cdf0932da73eada80.asciidoc b/docs/examples/150b5fee5678bf8cdf0932da73eada80.asciidoc
new file mode 100644
index 000000000..aae9630af
--- /dev/null
+++ b/docs/examples/150b5fee5678bf8cdf0932da73eada80.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/nodes-stats.asciidoc:2402
+
+[source, python]
+----
+resp = client.nodes.stats(
+ metric="indices",
+ index_metric="fielddata",
+ fields="field1,field2",
+)
+print(resp)
+
+resp1 = client.nodes.stats(
+ metric="indices",
+ index_metric="fielddata",
+ level="indices",
+ fields="field1,field2",
+)
+print(resp1)
+
+resp2 = client.nodes.stats(
+ metric="indices",
+ index_metric="fielddata",
+ level="shards",
+ fields="field1,field2",
+)
+print(resp2)
+
+resp3 = client.nodes.stats(
+ metric="indices",
+ index_metric="fielddata",
+ fields="field*",
+)
+print(resp3)
+----
diff --git a/docs/examples/151d2b11807ec684b0c01aa89189a801.asciidoc b/docs/examples/151d2b11807ec684b0c01aa89189a801.asciidoc
index 5525b0d14..b0926a099 100644
--- a/docs/examples/151d2b11807ec684b0c01aa89189a801.asciidoc
+++ b/docs/examples/151d2b11807ec684b0c01aa89189a801.asciidoc
@@ -1,17 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:474
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {
- "fields": ["title", "content"],
- "query": "this that thus",
- "minimum_should_match": 2,
- }
+ query={
+ "query_string": {
+ "fields": [
+ "title",
+ "content"
+ ],
+ "query": "this that thus",
+ "minimum_should_match": 2
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/154d703732daf5c5fcd0122e6a50213f.asciidoc b/docs/examples/154d703732daf5c5fcd0122e6a50213f.asciidoc
index 256264c02..3240c6938 100644
--- a/docs/examples/154d703732daf5c5fcd0122e6a50213f.asciidoc
+++ b/docs/examples/154d703732daf5c5fcd0122e6a50213f.asciidoc
@@ -1,15 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:339
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "runtime": {
- "measures.start": {"type": "long"},
- "measures.end": {"type": "long"},
+ runtime={
+ "measures.start": {
+ "type": "long"
+ },
+ "measures.end": {
+ "type": "long"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/156bc64c94f9f3334fbce25165d2286a.asciidoc b/docs/examples/156bc64c94f9f3334fbce25165d2286a.asciidoc
index a1d92ede7..99a107dbf 100644
--- a/docs/examples/156bc64c94f9f3334fbce25165d2286a.asciidoc
+++ b/docs/examples/156bc64c94f9f3334fbce25165d2286a.asciidoc
@@ -1,15 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/index-sorting.asciidoc:15
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "settings": {
- "index": {"sort.field": "date", "sort.order": "desc"}
- },
- "mappings": {"properties": {"date": {"type": "date"}}},
+ settings={
+ "index": {
+ "sort.field": "date",
+ "sort.order": "desc"
+ }
+ },
+ mappings={
+ "properties": {
+ "date": {
+ "type": "date"
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1570976f7807b88dc8a046b833be057b.asciidoc b/docs/examples/1570976f7807b88dc8a046b833be057b.asciidoc
new file mode 100644
index 000000000..b5ec59379
--- /dev/null
+++ b/docs/examples/1570976f7807b88dc8a046b833be057b.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/hotspotting.asciidoc:28
+
+[source, python]
+----
+resp = client.cat.nodes(
+ v=True,
+ s="master,name",
+ h="name,master,node.role,heap.percent,disk.used_percent,cpu",
+)
+print(resp)
+----
diff --git a/docs/examples/1572696b97822d3332be51700e09672f.asciidoc b/docs/examples/1572696b97822d3332be51700e09672f.asciidoc
index cc4b2fe28..5ce2152dd 100644
--- a/docs/examples/1572696b97822d3332be51700e09672f.asciidoc
+++ b/docs/examples/1572696b97822d3332be51700e09672f.asciidoc
@@ -1,20 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/range.asciidoc:130
[source, python]
----
resp = client.search(
index="range_index",
- body={
- "query": {
- "range": {
- "time_frame": {
- "gte": "2015-10-31",
- "lte": "2015-11-01",
- "relation": "within",
- }
+ query={
+ "range": {
+ "time_frame": {
+ "gte": "2015-10-31",
+ "lte": "2015-11-01",
+ "relation": "within"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1598a0fec6b1ca78cadbaba65f465196.asciidoc b/docs/examples/1598a0fec6b1ca78cadbaba65f465196.asciidoc
new file mode 100644
index 000000000..e5a8cd532
--- /dev/null
+++ b/docs/examples/1598a0fec6b1ca78cadbaba65f465196.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/pattern-tokenizer.asciidoc:216
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "my_tokenizer"
+ }
+ },
+ "tokenizer": {
+ "my_tokenizer": {
+ "type": "pattern",
+ "pattern": "\"((?:\\\\\"|[^\"]|\\\\\")+)\"",
+ "group": 1
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="\"value\", \"value with embedded \\\" quote\"",
+)
+print(resp1)
+----
diff --git a/docs/examples/15a34bfe0ef8ef6333c8c7b55c011e5d.asciidoc b/docs/examples/15a34bfe0ef8ef6333c8c7b55c011e5d.asciidoc
new file mode 100644
index 000000000..d6f040464
--- /dev/null
+++ b/docs/examples/15a34bfe0ef8ef6333c8c7b55c011e5d.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:269
+
+[source, python]
+----
+resp = client.indices.analyze(
+ filter=[
+ "lowercase"
+ ],
+ text="BaR",
+)
+print(resp)
+----
diff --git a/docs/examples/15c76cc8a038f686395053a240262929.asciidoc b/docs/examples/15c76cc8a038f686395053a240262929.asciidoc
new file mode 100644
index 000000000..b76cca409
--- /dev/null
+++ b/docs/examples/15c76cc8a038f686395053a240262929.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/classic-tokenfilter.asciidoc:132
+
+[source, python]
+----
+resp = client.indices.create(
+ index="classic_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "classic_analyzer": {
+ "tokenizer": "classic",
+ "filter": [
+ "classic"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/15d4be58359542775f4aff88e6d8adb5.asciidoc b/docs/examples/15d4be58359542775f4aff88e6d8adb5.asciidoc
new file mode 100644
index 000000000..ec64c6a9e
--- /dev/null
+++ b/docs/examples/15d4be58359542775f4aff88e6d8adb5.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:135
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ id="my-pipeline",
+ docs=[
+ {
+ "_source": {
+ "my-keyword-field": "FOO"
+ }
+ },
+ {
+ "_source": {
+ "my-keyword-field": "BAR"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/15d948d593d2624ac5e2b155052048f0.asciidoc b/docs/examples/15d948d593d2624ac5e2b155052048f0.asciidoc
new file mode 100644
index 000000000..5ba49b982
--- /dev/null
+++ b/docs/examples/15d948d593d2624ac5e2b155052048f0.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/remove-duplicates-tokenfilter.asciidoc:24
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "keyword_repeat",
+ "stemmer"
+ ],
+ text="jumping dog",
+)
+print(resp)
+----
diff --git a/docs/examples/15e90b82827c8512670820cf856a9c71.asciidoc b/docs/examples/15e90b82827c8512670820cf856a9c71.asciidoc
new file mode 100644
index 000000000..49dcc1813
--- /dev/null
+++ b/docs/examples/15e90b82827c8512670820cf856a9c71.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/date-index-name.asciidoc:23
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="monthlyindex",
+ description="monthly date-time index naming",
+ processors=[
+ {
+ "date_index_name": {
+ "field": "date1",
+ "index_name_prefix": "my-index-",
+ "date_rounding": "M"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/1605be45a5711d1929d6ad2d1ae0f797.asciidoc b/docs/examples/1605be45a5711d1929d6ad2d1ae0f797.asciidoc
index 12e2cffb8..6901ba980 100644
--- a/docs/examples/1605be45a5711d1929d6ad2d1ae0f797.asciidoc
+++ b/docs/examples/1605be45a5711d1929d6ad2d1ae0f797.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// modules/discovery/voting.asciidoc:26
[source, python]
@@ -6,4 +7,4 @@ resp = client.cluster.state(
filter_path="metadata.cluster_coordination.last_committed_config",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/160986f49758f4e8345d183a842f6351.asciidoc b/docs/examples/160986f49758f4e8345d183a842f6351.asciidoc
new file mode 100644
index 000000000..7b460b136
--- /dev/null
+++ b/docs/examples/160986f49758f4e8345d183a842f6351.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/attachment.asciidoc:165
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="cbor-attachment",
+ description="Extract attachment information",
+ processors=[
+ {
+ "attachment": {
+ "field": "data",
+ "remove_binary": False
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/160de80948e0c7db49b1c311848a66a2.asciidoc b/docs/examples/160de80948e0c7db49b1c311848a66a2.asciidoc
new file mode 100644
index 000000000..982757957
--- /dev/null
+++ b/docs/examples/160de80948e0c7db49b1c311848a66a2.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/getting-started.asciidoc:161
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="log_error_watch",
+ trigger={
+ "schedule": {
+ "interval": "10s"
+ }
+ },
+ input={
+ "search": {
+ "request": {
+ "indices": [
+ "logs"
+ ],
+ "body": {
+ "query": {
+ "match": {
+ "message": "error"
+ }
+ }
+ }
+ }
+ }
+ },
+ condition={
+ "compare": {
+ "ctx.payload.hits.total": {
+ "gt": 0
+ }
+ }
+ },
+ actions={
+ "log_error": {
+ "logging": {
+ "text": "Found {{ctx.payload.hits.total}} errors in the logs"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/160f39a50847bad0be4be1529a95e4ce.asciidoc b/docs/examples/160f39a50847bad0be4be1529a95e4ce.asciidoc
new file mode 100644
index 000000000..c0ce995f3
--- /dev/null
+++ b/docs/examples/160f39a50847bad0be4be1529a95e4ce.asciidoc
@@ -0,0 +1,65 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1140
+
+[source, python]
+----
+resp = client.indices.create(
+ index="irish_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "irish_hyphenation": {
+ "type": "stop",
+ "stopwords": [
+ "h",
+ "n",
+ "t"
+ ],
+ "ignore_case": True
+ },
+ "irish_elision": {
+ "type": "elision",
+ "articles": [
+ "d",
+ "m",
+ "b"
+ ],
+ "articles_case": True
+ },
+ "irish_stop": {
+ "type": "stop",
+ "stopwords": "_irish_"
+ },
+ "irish_lowercase": {
+ "type": "lowercase",
+ "language": "irish"
+ },
+ "irish_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "sampla"
+ ]
+ },
+ "irish_stemmer": {
+ "type": "stemmer",
+ "language": "irish"
+ }
+ },
+ "analyzer": {
+ "rebuilt_irish": {
+ "tokenizer": "standard",
+ "filter": [
+ "irish_hyphenation",
+ "irish_elision",
+ "irish_lowercase",
+ "irish_stop",
+ "irish_keywords",
+ "irish_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/16239fe9f0b0dcfd5ea64c08c6fed21d.asciidoc b/docs/examples/16239fe9f0b0dcfd5ea64c08c6fed21d.asciidoc
new file mode 100644
index 000000000..0d1768845
--- /dev/null
+++ b/docs/examples/16239fe9f0b0dcfd5ea64c08c6fed21d.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/reverse-nested-aggregation.asciidoc:22
+
+[source, python]
+----
+resp = client.indices.create(
+ index="issues",
+ mappings={
+ "properties": {
+ "tags": {
+ "type": "keyword"
+ },
+ "comments": {
+ "type": "nested",
+ "properties": {
+ "username": {
+ "type": "keyword"
+ },
+ "comment": {
+ "type": "text"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/162b5b693b713f0bfab1209d59443c46.asciidoc b/docs/examples/162b5b693b713f0bfab1209d59443c46.asciidoc
index e8fea70d6..2f6bf0c47 100644
--- a/docs/examples/162b5b693b713f0bfab1209d59443c46.asciidoc
+++ b/docs/examples/162b5b693b713f0bfab1209d59443c46.asciidoc
@@ -1,13 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/bool-query.asciidoc:130
[source, python]
----
resp = client.search(
- body={
- "query": {
- "constant_score": {"filter": {"term": {"status": "active"}}}
+ query={
+ "constant_score": {
+ "filter": {
+ "term": {
+ "status": "active"
+ }
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/16351d99d0608789d04a0bb11a537098.asciidoc b/docs/examples/16351d99d0608789d04a0bb11a537098.asciidoc
new file mode 100644
index 000000000..258b8a694
--- /dev/null
+++ b/docs/examples/16351d99d0608789d04a0bb11a537098.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/edgengram-tokenfilter.asciidoc:143
+
+[source, python]
+----
+resp = client.indices.create(
+ index="edge_ngram_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_edge_ngram": {
+ "tokenizer": "standard",
+ "filter": [
+ "edge_ngram"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1637ef51d673b35cc8894ee80cd61c87.asciidoc b/docs/examples/1637ef51d673b35cc8894ee80cd61c87.asciidoc
new file mode 100644
index 000000000..cb4a24a1a
--- /dev/null
+++ b/docs/examples/1637ef51d673b35cc8894ee80cd61c87.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/cpu-usage.asciidoc:14
+
+[source, python]
+----
+resp = client.cat.nodes(
+ v=True,
+ s="cpu:desc",
+)
+print(resp)
+----
diff --git a/docs/examples/1648dd31d0fef01e7504ebeb687f4f30.asciidoc b/docs/examples/1648dd31d0fef01e7504ebeb687f4f30.asciidoc
new file mode 100644
index 000000000..4e880cc03
--- /dev/null
+++ b/docs/examples/1648dd31d0fef01e7504ebeb687f4f30.asciidoc
@@ -0,0 +1,57 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/rank-feature-query.asciidoc:92
+
+[source, python]
+----
+resp = client.index(
+ index="test",
+ id="1",
+ refresh=True,
+ document={
+ "url": "https://en.wikipedia.org/wiki/2016_Summer_Olympics",
+ "content": "Rio 2016",
+ "pagerank": 50.3,
+ "url_length": 42,
+ "topics": {
+ "sports": 50,
+ "brazil": 30
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="test",
+ id="2",
+ refresh=True,
+ document={
+ "url": "https://en.wikipedia.org/wiki/2016_Brazilian_Grand_Prix",
+ "content": "Formula One motor race held on 13 November 2016",
+ "pagerank": 50.3,
+ "url_length": 47,
+ "topics": {
+ "sports": 35,
+ "formula one": 65,
+ "brazil": 20
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="test",
+ id="3",
+ refresh=True,
+ document={
+ "url": "https://en.wikipedia.org/wiki/Deadpool_(film)",
+ "content": "Deadpool is a 2016 American superhero film",
+ "pagerank": 50.3,
+ "url_length": 37,
+ "topics": {
+ "movies": 60,
+ "super hero": 65
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/16535685833419f0033545ffce4fdf00.asciidoc b/docs/examples/16535685833419f0033545ffce4fdf00.asciidoc
new file mode 100644
index 000000000..f24a07b56
--- /dev/null
+++ b/docs/examples/16535685833419f0033545ffce4fdf00.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/highlighting-multi-fields.asciidoc:372
+
+[source, python]
+----
+resp = client.search(
+ index="index2",
+ query={
+ "query_string": {
+ "query": "running with scissors",
+ "fields": [
+ "comment",
+ "comment.english"
+ ]
+ }
+ },
+ highlight={
+ "order": "score",
+ "fields": {
+ "comment.english": {
+ "type": "fvh",
+ "matched_fields": [
+ "comment"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1659420311d907d9fc024b96f4150216.asciidoc b/docs/examples/1659420311d907d9fc024b96f4150216.asciidoc
new file mode 100644
index 000000000..479452277
--- /dev/null
+++ b/docs/examples/1659420311d907d9fc024b96f4150216.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/length-tokenfilter.asciidoc:27
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ {
+ "type": "length",
+ "min": 0,
+ "max": 4
+ }
+ ],
+ text="the quick brown fox jumps over the lazy dog",
+)
+print(resp)
+----
diff --git a/docs/examples/16634cfa7916cf4e8048a1d70e6240f2.asciidoc b/docs/examples/16634cfa7916cf4e8048a1d70e6240f2.asciidoc
new file mode 100644
index 000000000..4cd3c344a
--- /dev/null
+++ b/docs/examples/16634cfa7916cf4e8048a1d70e6240f2.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-client.asciidoc:427
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my-example-app",
+ search_application={
+ "indices": [
+ "example-index"
+ ],
+ "template": {
+ "script": {
+ "lang": "mustache",
+ "source": "\n {\n \"query\": {\n \"bool\": {\n \"must\": [\n {{#query}}\n \n {{/query}}\n ],\n \"filter\": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n \"_source\": {\n \"includes\": [\"title\", \"plot\"]\n },\n \"highlight\": {\n \"fields\": {\n \"title\": { \"fragment_size\": 0 },\n \"plot\": { \"fragment_size\": 200 }\n }\n },\n \"aggs\": {{#toJson}}_es_aggs{{/toJson}},\n \"from\": {{from}},\n \"size\": {{size}},\n \"sort\": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ",
+ "params": {
+ "query": "",
+ "_es_filters": {},
+ "_es_aggs": {},
+ "_es_sort_fields": {},
+ "size": 10,
+ "from": 0
+ },
+ "dictionary": {}
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/166bcfc6d5d39defec7ad6aa44d0914b.asciidoc b/docs/examples/166bcfc6d5d39defec7ad6aa44d0914b.asciidoc
new file mode 100644
index 000000000..e6e17b4a9
--- /dev/null
+++ b/docs/examples/166bcfc6d5d39defec7ad6aa44d0914b.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/tasks.asciidoc:74
+
+[source, python]
+----
+resp = client.tasks.list()
+print(resp)
+
+resp1 = client.tasks.list(
+ nodes="nodeId1,nodeId2",
+)
+print(resp1)
+
+resp2 = client.tasks.list(
+ nodes="nodeId1,nodeId2",
+ actions="cluster:*",
+)
+print(resp2)
+----
diff --git a/docs/examples/16985e5b17d2da0955a14fbe02e8dfca.asciidoc b/docs/examples/16985e5b17d2da0955a14fbe02e8dfca.asciidoc
new file mode 100644
index 000000000..896661d47
--- /dev/null
+++ b/docs/examples/16985e5b17d2da0955a14fbe02e8dfca.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/termvectors.asciidoc:237
+
+[source, python]
+----
+resp = client.termvectors(
+ index="my-index-000001",
+ id="1",
+ fields=[
+ "text"
+ ],
+ offsets=True,
+ payloads=True,
+ positions=True,
+ term_statistics=True,
+ field_statistics=True,
+)
+print(resp)
+----
diff --git a/docs/examples/169b39bb889ecd47541bed3e48725488.asciidoc b/docs/examples/169b39bb889ecd47541bed3e48725488.asciidoc
index 148c52898..5e3316a3d 100644
--- a/docs/examples/169b39bb889ecd47541bed3e48725488.asciidoc
+++ b/docs/examples/169b39bb889ecd47541bed3e48725488.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/flattened.asciidoc:73
[source, python]
----
resp = client.search(
index="bug_reports",
- body={"query": {"term": {"labels": "urgent"}}},
+ query={
+ "term": {
+ "labels": "urgent"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/170c8a3fb81a4e93cd3034a3b5a43ac9.asciidoc b/docs/examples/170c8a3fb81a4e93cd3034a3b5a43ac9.asciidoc
new file mode 100644
index 000000000..5a4155b43
--- /dev/null
+++ b/docs/examples/170c8a3fb81a4e93cd3034a3b5a43ac9.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-shape-query.asciidoc:280
+
+[source, python]
+----
+resp = client.index(
+ index="test",
+ id="1",
+ document={
+ "location": {
+ "coordinates": [
+ [
+ 46.25,
+ 20.14
+ ],
+ [
+ 47.49,
+ 19.04
+ ]
+ ],
+ "type": "multipoint"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/172155ca4bf6dfcbd489453f50739396.asciidoc b/docs/examples/172155ca4bf6dfcbd489453f50739396.asciidoc
new file mode 100644
index 000000000..dcf168990
--- /dev/null
+++ b/docs/examples/172155ca4bf6dfcbd489453f50739396.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/get-snapshot-api.asciidoc:402
+
+[source, python]
+----
+resp = client.snapshot.get(
+ repository="my_repository",
+ snapshot="snapshot*",
+ size="2",
+ sort="name",
+)
+print(resp)
+----
diff --git a/docs/examples/17266cee5eaaddf08e5534bf580a1910.asciidoc b/docs/examples/17266cee5eaaddf08e5534bf580a1910.asciidoc
new file mode 100644
index 000000000..3cc4afa13
--- /dev/null
+++ b/docs/examples/17266cee5eaaddf08e5534bf580a1910.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/stats.asciidoc:84
+
+[source, python]
+----
+resp = client.watcher.stats()
+print(resp)
+----
diff --git a/docs/examples/172b18e435c400bed85227624de3acfd.asciidoc b/docs/examples/172b18e435c400bed85227624de3acfd.asciidoc
new file mode 100644
index 000000000..c813a2ed9
--- /dev/null
+++ b/docs/examples/172b18e435c400bed85227624de3acfd.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/run-as-privilege.asciidoc:143
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="my_analyst_role",
+ refresh=True,
+ cluster=[
+ "monitor"
+ ],
+ indices=[
+ {
+ "names": [
+ "index1",
+ "index2"
+ ],
+ "privileges": [
+ "manage"
+ ]
+ }
+ ],
+ applications=[
+ {
+ "application": "myapp",
+ "privileges": [
+ "read"
+ ],
+ "resources": [
+ "*"
+ ]
+ }
+ ],
+ metadata={
+ "version": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/172d150e56a225155a62c7b18bf8da67.asciidoc b/docs/examples/172d150e56a225155a62c7b18bf8da67.asciidoc
new file mode 100644
index 000000000..d844039f6
--- /dev/null
+++ b/docs/examples/172d150e56a225155a62c7b18bf8da67.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:502
+
+[source, python]
+----
+resp = client.sql.query(
+ format="txt",
+ query="SELECT YEAR(release_date) AS year FROM library WHERE page_count > 300 AND author = 'Frank Herbert' GROUP BY year HAVING COUNT(*) > 0",
+)
+print(resp)
+----
diff --git a/docs/examples/1736545c8b5674f6d311f3277eb387f1.asciidoc b/docs/examples/1736545c8b5674f6d311f3277eb387f1.asciidoc
new file mode 100644
index 000000000..8f797780e
--- /dev/null
+++ b/docs/examples/1736545c8b5674f6d311f3277eb387f1.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-manage-existing-data-stream.asciidoc:30
+
+[source, python]
+----
+resp = client.indices.put_data_lifecycle(
+ name="my-data-stream",
+ data_retention="30d",
+)
+print(resp)
+----
diff --git a/docs/examples/173b190078621415a80e851eaf794e8a.asciidoc b/docs/examples/173b190078621415a80e851eaf794e8a.asciidoc
new file mode 100644
index 000000000..83f0471df
--- /dev/null
+++ b/docs/examples/173b190078621415a80e851eaf794e8a.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/standard-analyzer.asciidoc:154
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_english_analyzer": {
+ "type": "standard",
+ "max_token_length": 5,
+ "stopwords": "_english_"
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_english_analyzer",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp1)
+----
diff --git a/docs/examples/1745ac9e6d22a2ffe7ac381f9ba238f9.asciidoc b/docs/examples/1745ac9e6d22a2ffe7ac381f9ba238f9.asciidoc
new file mode 100644
index 000000000..3b131eced
--- /dev/null
+++ b/docs/examples/1745ac9e6d22a2ffe7ac381f9ba238f9.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/high-cpu-usage.asciidoc:26
+
+[source, python]
+----
+resp = client.nodes.hot_threads(
+ node_id="my-node,my-other-node",
+)
+print(resp)
+----
diff --git a/docs/examples/17566e23c191f1004a2719f2c4242307.asciidoc b/docs/examples/17566e23c191f1004a2719f2c4242307.asciidoc
new file mode 100644
index 000000000..0c0a031e1
--- /dev/null
+++ b/docs/examples/17566e23c191f1004a2719f2c4242307.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/apis/get-autoscaling-capacity.asciidoc:262
+
+[source, python]
+----
+resp = client.autoscaling.get_autoscaling_capacity()
+print(resp)
+----
diff --git a/docs/examples/178be73b74ba9f297429e32267084ac7.asciidoc b/docs/examples/178be73b74ba9f297429e32267084ac7.asciidoc
new file mode 100644
index 000000000..9566e4a6c
--- /dev/null
+++ b/docs/examples/178be73b74ba9f297429e32267084ac7.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-or-query.asciidoc:10
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_or": {
+ "clauses": [
+ {
+ "span_term": {
+ "field": "value1"
+ }
+ },
+ {
+ "span_term": {
+ "field": "value2"
+ }
+ },
+ {
+ "span_term": {
+ "field": "value3"
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/178c920d5e8ec0071f77290fa059802c.asciidoc b/docs/examples/178c920d5e8ec0071f77290fa059802c.asciidoc
index db26795dd..b95beb841 100644
--- a/docs/examples/178c920d5e8ec0071f77290fa059802c.asciidoc
+++ b/docs/examples/178c920d5e8ec0071f77290fa059802c.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// indices/update-settings.asciidoc:132
[source, python]
----
resp = client.indices.put_settings(
index="my-index-000001",
- body={"index": {"refresh_interval": "1s"}},
+ settings={
+ "index": {
+ "refresh_interval": "1s"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/179f0a3e84ff4bbac18787a018eabf89.asciidoc b/docs/examples/179f0a3e84ff4bbac18787a018eabf89.asciidoc
index f23df10f7..e92913dcd 100644
--- a/docs/examples/179f0a3e84ff4bbac18787a018eabf89.asciidoc
+++ b/docs/examples/179f0a3e84ff4bbac18787a018eabf89.asciidoc
@@ -1,18 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:482
[source, python]
----
resp = client.search(
- body={
- "query": {
- "multi_match": {
- "query": "Jon",
- "type": "cross_fields",
- "analyzer": "standard",
- "fields": ["first", "last", "*.edge"],
- }
+ query={
+ "multi_match": {
+ "query": "Jon",
+ "type": "cross_fields",
+ "analyzer": "standard",
+ "fields": [
+ "first",
+ "last",
+ "*.edge"
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/17a1e308761afd3282f13d44d7be008a.asciidoc b/docs/examples/17a1e308761afd3282f13d44d7be008a.asciidoc
new file mode 100644
index 000000000..ee6770cd1
--- /dev/null
+++ b/docs/examples/17a1e308761afd3282f13d44d7be008a.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:687
+
+[source, python]
+----
+resp = client.indices.create(
+ index="example",
+ mappings={
+ "properties": {
+ "comment": {
+ "type": "text",
+ "term_vector": "with_positions_offsets"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/17c2b0a6b0305804ff3b7fd3b4a68df3.asciidoc b/docs/examples/17c2b0a6b0305804ff3b7fd3b4a68df3.asciidoc
new file mode 100644
index 000000000..06dbd0899
--- /dev/null
+++ b/docs/examples/17c2b0a6b0305804ff3b7fd3b4a68df3.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/simulate-pipeline.asciidoc:217
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "description": "_description",
+ "processors": [
+ {
+ "set": {
+ "field": "field2",
+ "value": "_value"
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_index": "index",
+ "_id": "id",
+ "_source": {
+ "foo": "bar"
+ }
+ },
+ {
+ "_index": "index",
+ "_id": "id",
+ "_source": {
+ "foo": "rab"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/17dd67a66c49f7eb618dd17430e48dfa.asciidoc b/docs/examples/17dd67a66c49f7eb618dd17430e48dfa.asciidoc
new file mode 100644
index 000000000..226c9a336
--- /dev/null
+++ b/docs/examples/17dd67a66c49f7eb618dd17430e48dfa.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:239
+
+[source, python]
+----
+resp = client.search(
+ index="index",
+ query={
+ "constant_score": {
+ "filter": {
+ "range": {
+ "my_date": {
+ "gte": "now-1h/m",
+ "lte": "now/m"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/17e6f3fac556f08a78f7a876e71acb89.asciidoc b/docs/examples/17e6f3fac556f08a78f7a876e71acb89.asciidoc
index 12eaf3252..24af928fb 100644
--- a/docs/examples/17e6f3fac556f08a78f7a876e71acb89.asciidoc
+++ b/docs/examples/17e6f3fac556f08a78f7a876e71acb89.asciidoc
@@ -1,12 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/allocation/delayed.asciidoc:40
[source, python]
----
resp = client.indices.put_settings(
index="_all",
- body={
- "settings": {"index.unassigned.node_left.delayed_timeout": "5m"}
+ settings={
+ "settings": {
+ "index.unassigned.node_left.delayed_timeout": "5m"
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/17f8a8990b0166befa3bc2b10fd28134.asciidoc b/docs/examples/17f8a8990b0166befa3bc2b10fd28134.asciidoc
index 19f6bb503..19b06fcbd 100644
--- a/docs/examples/17f8a8990b0166befa3bc2b10fd28134.asciidoc
+++ b/docs/examples/17f8a8990b0166befa3bc2b10fd28134.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:40
[source, python]
@@ -5,7 +6,13 @@
resp = client.index(
index="my-index-000001",
id="match_value",
- body={"query": {"match": {"field": "value"}}},
+ document={
+ "query": {
+ "match": {
+ "field": "value"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/17fb298fb1e47f7d946a772d68f4e2df.asciidoc b/docs/examples/17fb298fb1e47f7d946a772d68f4e2df.asciidoc
new file mode 100644
index 000000000..d8ee4a5db
--- /dev/null
+++ b/docs/examples/17fb298fb1e47f7d946a772d68f4e2df.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:246
+
+[source, python]
+----
+resp = client.delete_by_query(
+ index="my-data-stream",
+ query={
+ "match": {
+ "user.id": "vlb44hny"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/182df084f028479ecbe8d7648ddad892.asciidoc b/docs/examples/182df084f028479ecbe8d7648ddad892.asciidoc
new file mode 100644
index 000000000..7a7bde5c4
--- /dev/null
+++ b/docs/examples/182df084f028479ecbe8d7648ddad892.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/apis/get-status.asciidoc:60
+
+[source, python]
+----
+resp = client.ilm.get_status()
+print(resp)
+----
diff --git a/docs/examples/186a7143d50e8c3ee01094e1a9ff0c0c.asciidoc b/docs/examples/186a7143d50e8c3ee01094e1a9ff0c0c.asciidoc
new file mode 100644
index 000000000..c98ba8c2a
--- /dev/null
+++ b/docs/examples/186a7143d50e8c3ee01094e1a9ff0c0c.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:659
+
+[source, python]
+----
+resp = client.indices.create(
+ index="passage_vectors",
+ mappings={
+ "properties": {
+ "full_text": {
+ "type": "text"
+ },
+ "creation_time": {
+ "type": "date"
+ },
+ "paragraph": {
+ "type": "nested",
+ "properties": {
+ "vector": {
+ "type": "dense_vector",
+ "dims": 2,
+ "index_options": {
+ "type": "hnsw"
+ }
+ },
+ "text": {
+ "type": "text",
+ "index": False
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/187733e50c60350f3f75921bea3b72c2.asciidoc b/docs/examples/187733e50c60350f3f75921bea3b72c2.asciidoc
new file mode 100644
index 000000000..301522fec
--- /dev/null
+++ b/docs/examples/187733e50c60350f3f75921bea3b72c2.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:613
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ scroll="1m",
+ slice={
+ "field": "@timestamp",
+ "id": 0,
+ "max": 10
+ },
+ query={
+ "match": {
+ "message": "foo"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/187e8786e0a90f1f6278cf89b670de0a.asciidoc b/docs/examples/187e8786e0a90f1f6278cf89b670de0a.asciidoc
new file mode 100644
index 000000000..179d1dc5f
--- /dev/null
+++ b/docs/examples/187e8786e0a90f1f6278cf89b670de0a.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:891
+
+[source, python]
+----
+resp = client.indices.create(
+ index="german_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "german_stop": {
+ "type": "stop",
+ "stopwords": "_german_"
+ },
+ "german_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "Beispiel"
+ ]
+ },
+ "german_stemmer": {
+ "type": "stemmer",
+ "language": "light_german"
+ }
+ },
+ "analyzer": {
+ "rebuilt_german": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "german_stop",
+ "german_keywords",
+ "german_normalization",
+ "german_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/188e6208cccb13027a5c1c95440841ee.asciidoc b/docs/examples/188e6208cccb13027a5c1c95440841ee.asciidoc
new file mode 100644
index 000000000..fe803b895
--- /dev/null
+++ b/docs/examples/188e6208cccb13027a5c1c95440841ee.asciidoc
@@ -0,0 +1,61 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/filters-aggregation.asciidoc:13
+
+[source, python]
+----
+resp = client.bulk(
+ index="logs",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "body": "warning: page could not be rendered"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "body": "authentication error"
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "body": "warning: connection timed out"
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.search(
+ index="logs",
+ size=0,
+ aggs={
+ "messages": {
+ "filters": {
+ "filters": {
+ "errors": {
+ "match": {
+ "body": "error"
+ }
+ },
+ "warnings": {
+ "match": {
+ "body": "warning"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/189f0cd1ee2485cf11a2968f01d54e5b.asciidoc b/docs/examples/189f0cd1ee2485cf11a2968f01d54e5b.asciidoc
new file mode 100644
index 000000000..1b3b52c94
--- /dev/null
+++ b/docs/examples/189f0cd1ee2485cf11a2968f01d54e5b.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/derivative-aggregation.asciidoc:235
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "sales_deriv": {
+ "derivative": {
+ "buckets_path": "sales",
+ "unit": "day"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/18ddb7e7a4bcafd449df956e828ed7a8.asciidoc b/docs/examples/18ddb7e7a4bcafd449df956e828ed7a8.asciidoc
index 1cbef68b5..34fce2eb6 100644
--- a/docs/examples/18ddb7e7a4bcafd449df956e828ed7a8.asciidoc
+++ b/docs/examples/18ddb7e7a4bcafd449df956e828ed7a8.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:546
[source, python]
@@ -6,4 +7,4 @@ resp = client.tasks.cancel(
task_id="r1A2WoRbTwKZ516z6NEs5A:36619",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/18de6782bd18f4a9baec2feec8c02a8b.asciidoc b/docs/examples/18de6782bd18f4a9baec2feec8c02a8b.asciidoc
new file mode 100644
index 000000000..999873e69
--- /dev/null
+++ b/docs/examples/18de6782bd18f4a9baec2feec8c02a8b.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// migration/migrate_8_0/migrate_to_java_time.asciidoc:268
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000002",
+ mappings={
+ "properties": {
+ "datetime": {
+ "type": "date",
+ "format": "uuuu/MM/dd HH:mm:ss||uuuu/MM/dd||epoch_millis"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/190a21e32db2125ddaea0f634e126a84.asciidoc b/docs/examples/190a21e32db2125ddaea0f634e126a84.asciidoc
new file mode 100644
index 000000000..be5b2b5c9
--- /dev/null
+++ b/docs/examples/190a21e32db2125ddaea0f634e126a84.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/clone-index.asciidoc:91
+
+[source, python]
+----
+resp = client.indices.clone(
+ index="my_source_index",
+ target="my_target_index",
+)
+print(resp)
+----
diff --git a/docs/examples/19174d872fd1e43cbfb7a96a33d13c96.asciidoc b/docs/examples/19174d872fd1e43cbfb7a96a33d13c96.asciidoc
new file mode 100644
index 000000000..d71f0f0f9
--- /dev/null
+++ b/docs/examples/19174d872fd1e43cbfb7a96a33d13c96.asciidoc
@@ -0,0 +1,82 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/cartesian-centroid-aggregation.asciidoc:183
+
+[source, python]
+----
+resp = client.indices.create(
+ index="places",
+ mappings={
+ "properties": {
+ "geometry": {
+ "type": "shape"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="places",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "name": "NEMO Science Museum",
+ "geometry": "POINT(491.2350 5237.4081)"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "name": "Sportpark De Weeren",
+ "geometry": {
+ "type": "Polygon",
+ "coordinates": [
+ [
+ [
+ 496.5305328369141,
+ 5239.347642069457
+ ],
+ [
+ 496.6979026794433,
+ 5239.172175893484
+ ],
+ [
+ 496.9425201416015,
+ 5239.238958618537
+ ],
+ [
+ 496.7944622039794,
+ 5239.420969150824
+ ],
+ [
+ 496.5305328369141,
+ 5239.347642069457
+ ]
+ ]
+ ]
+ }
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="places",
+ size="0",
+ aggs={
+ "centroid": {
+ "cartesian_centroid": {
+ "field": "geometry"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/192fa1f6f51dfb640e9e15bb5cd7eebc.asciidoc b/docs/examples/192fa1f6f51dfb640e9e15bb5cd7eebc.asciidoc
new file mode 100644
index 000000000..e33ee65ec
--- /dev/null
+++ b/docs/examples/192fa1f6f51dfb640e9e15bb5cd7eebc.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/error-handling.asciidoc:144
+
+[source, python]
+----
+resp = client.ilm.retry(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/193234bb5dc6451fd15b584fbefd2446.asciidoc b/docs/examples/193234bb5dc6451fd15b584fbefd2446.asciidoc
new file mode 100644
index 000000000..c07a31d71
--- /dev/null
+++ b/docs/examples/193234bb5dc6451fd15b584fbefd2446.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/role-templates.asciidoc:16
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="example1",
+ indices=[
+ {
+ "names": [
+ "my-index-000001"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "query": {
+ "template": {
+ "source": {
+ "term": {
+ "acl.username": "{{_user.username}}"
+ }
+ }
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/193d86b6cc34e12c2be806d27816a35c.asciidoc b/docs/examples/193d86b6cc34e12c2be806d27816a35c.asciidoc
new file mode 100644
index 000000000..581af4629
--- /dev/null
+++ b/docs/examples/193d86b6cc34e12c2be806d27816a35c.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:363
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my_search_application",
+ params={
+ "size": 5,
+ "query_string": "mountain climbing",
+ "text_fields": [
+ {
+ "name": "title",
+ "boost": 10
+ },
+ {
+ "name": "description",
+ "boost": 2
+ },
+ {
+ "name": "state",
+ "boost": 1
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/194bbac15e709174ac85b681f3a3d137.asciidoc b/docs/examples/194bbac15e709174ac85b681f3a3d137.asciidoc
new file mode 100644
index 000000000..e1a1a265e
--- /dev/null
+++ b/docs/examples/194bbac15e709174ac85b681f3a3d137.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template.asciidoc:186
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="template_1",
+ index_patterns=[
+ "template*"
+ ],
+ template={
+ "settings": {
+ "number_of_shards": 1
+ },
+ "aliases": {
+ "alias1": {},
+ "alias2": {
+ "filter": {
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
+ "routing": "shard-1"
+ },
+ "{index}-alias": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/196aed02b11def364bab84e455c1a073.asciidoc b/docs/examples/196aed02b11def364bab84e455c1a073.asciidoc
new file mode 100644
index 000000000..4b37db9ca
--- /dev/null
+++ b/docs/examples/196aed02b11def364bab84e455c1a073.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template.asciidoc:324
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="template_1",
+ index_patterns=[
+ "logs-*"
+ ],
+ data_stream={},
+)
+print(resp)
+----
diff --git a/docs/examples/199f5165d876267080046c907e93483f.asciidoc b/docs/examples/199f5165d876267080046c907e93483f.asciidoc
new file mode 100644
index 000000000..3108c165e
--- /dev/null
+++ b/docs/examples/199f5165d876267080046c907e93483f.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:153
+
+[source, python]
+----
+resp = client.indices.analyze(
+ index="my-index-000001",
+ field="my-field",
+ text="this is a test",
+)
+print(resp)
+----
diff --git a/docs/examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc b/docs/examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc
new file mode 100644
index 000000000..43da2db77
--- /dev/null
+++ b/docs/examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/simulate-ingest.asciidoc:201
+
+[source, python]
+----
+resp = client.simulate.ingest(
+ body={
+ "docs": [
+ {
+ "_index": "my-index",
+ "_id": "123",
+ "_source": {
+ "foo": "bar"
+ }
+ },
+ {
+ "_index": "my-index",
+ "_id": "456",
+ "_source": {
+ "foo": "rab"
+ }
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/19d60e4890cc57151d596326484d9076.asciidoc b/docs/examples/19d60e4890cc57151d596326484d9076.asciidoc
new file mode 100644
index 000000000..62e24dbbd
--- /dev/null
+++ b/docs/examples/19d60e4890cc57151d596326484d9076.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/delete-geoip-database.asciidoc:10
+
+[source, python]
+----
+resp = client.perform_request(
+ "DELETE",
+ "/_ingest/geoip/database/my-database-id",
+)
+print(resp)
+----
diff --git a/docs/examples/19ee488226d357d1576e7d3ae7a4693f.asciidoc b/docs/examples/19ee488226d357d1576e7d3ae7a4693f.asciidoc
new file mode 100644
index 000000000..1fb4dcb49
--- /dev/null
+++ b/docs/examples/19ee488226d357d1576e7d3ae7a4693f.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/keyword-analyzer.asciidoc:14
+
+[source, python]
+----
+resp = client.indices.analyze(
+ analyzer="keyword",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc b/docs/examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc
index 64edf1156..3846208d6 100644
--- a/docs/examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc
+++ b/docs/examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc
@@ -1,19 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/semantic-text.asciidoc:22
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "inference_field": {
- "type": "semantic_text",
- "inference_id": "my-elser-endpoint",
- }
+ mappings={
+ "properties": {
+ "inference_field": {
+ "type": "semantic_text",
+ "inference_id": "my-elser-endpoint"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1a1f3421717ff744ed83232729289bb0.asciidoc b/docs/examples/1a1f3421717ff744ed83232729289bb0.asciidoc
new file mode 100644
index 000000000..03648bd41
--- /dev/null
+++ b/docs/examples/1a1f3421717ff744ed83232729289bb0.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// slm/apis/slm-delete.asciidoc:65
+
+[source, python]
+----
+resp = client.slm.delete_lifecycle(
+ policy_id="daily-snapshots",
+)
+print(resp)
+----
diff --git a/docs/examples/1a2890b90f3699fc2a4f27f94b145be9.asciidoc b/docs/examples/1a2890b90f3699fc2a4f27f94b145be9.asciidoc
new file mode 100644
index 000000000..6cf129da8
--- /dev/null
+++ b/docs/examples/1a2890b90f3699fc2a4f27f94b145be9.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:487
+
+[source, python]
+----
+resp = client.slm.put_lifecycle(
+ policy_id="nightly-cluster-state-snapshots",
+ schedule="0 30 2 * * ?",
+ name="",
+ repository="my_secure_repository",
+ config={
+ "include_global_state": True,
+ "indices": "-*"
+ },
+ retention={
+ "expire_after": "30d",
+ "min_count": 5,
+ "max_count": 50
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1a3897cfb4f974c09d0d847baac8aa6d.asciidoc b/docs/examples/1a3897cfb4f974c09d0d847baac8aa6d.asciidoc
new file mode 100644
index 000000000..8fdcf6d8a
--- /dev/null
+++ b/docs/examples/1a3897cfb4f974c09d0d847baac8aa6d.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/hotspotting.asciidoc:190
+
+[source, python]
+----
+resp = client.indices.stats(
+ level="shards",
+ human=True,
+ expand_wildcards="all",
+ filter_path="indices.*.total.indexing.index_total",
+)
+print(resp)
+----
diff --git a/docs/examples/1a3a4b8a4bfee4ab84ddd13d8835f560.asciidoc b/docs/examples/1a3a4b8a4bfee4ab84ddd13d8835f560.asciidoc
new file mode 100644
index 000000000..94c618bb8
--- /dev/null
+++ b/docs/examples/1a3a4b8a4bfee4ab84ddd13d8835f560.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/start-dfanalytics.asciidoc:82
+
+[source, python]
+----
+resp = client.ml.start_data_frame_analytics(
+ id="loganalytics",
+)
+print(resp)
+----
diff --git a/docs/examples/1a4f8beb6847678880ca113ee6fb75ca.asciidoc b/docs/examples/1a4f8beb6847678880ca113ee6fb75ca.asciidoc
new file mode 100644
index 000000000..7dd0959ad
--- /dev/null
+++ b/docs/examples/1a4f8beb6847678880ca113ee6fb75ca.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/completion-suggest.asciidoc:362
+
+[source, python]
+----
+resp = client.search(
+ index="music",
+ pretty=True,
+ suggest={
+ "song-suggest": {
+ "regex": "n[ever|i]r",
+ "completion": {
+ "field": "suggest"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1a56df055b94466ca76818e0858752c6.asciidoc b/docs/examples/1a56df055b94466ca76818e0858752c6.asciidoc
new file mode 100644
index 000000000..e45764af1
--- /dev/null
+++ b/docs/examples/1a56df055b94466ca76818e0858752c6.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-task.asciidoc:89
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="openai_embeddings",
+ inference_config={
+ "service": "openai",
+ "service_settings": {
+ "api_key": "",
+ "model_id": "text-embedding-ada-002"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1a6dbe5df488c4a16e2f1101ba8a25d9.asciidoc b/docs/examples/1a6dbe5df488c4a16e2f1101ba8a25d9.asciidoc
new file mode 100644
index 000000000..279ac949b
--- /dev/null
+++ b/docs/examples/1a6dbe5df488c4a16e2f1101ba8a25d9.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/pattern-tokenizer.asciidoc:32
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="pattern",
+ text="The foo_bar_size's default is 5.",
+)
+print(resp)
+----
diff --git a/docs/examples/1a81fe0186369838531e116e85aa4ccd.asciidoc b/docs/examples/1a81fe0186369838531e116e85aa4ccd.asciidoc
new file mode 100644
index 000000000..23f41c0dc
--- /dev/null
+++ b/docs/examples/1a81fe0186369838531e116e85aa4ccd.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/filter-search-results.asciidoc:29
+
+[source, python]
+----
+resp = client.indices.create(
+ index="shirts",
+ mappings={
+ "properties": {
+ "brand": {
+ "type": "keyword"
+ },
+ "color": {
+ "type": "keyword"
+ },
+ "model": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="shirts",
+ id="1",
+ refresh=True,
+ document={
+ "brand": "gucci",
+ "color": "red",
+ "model": "slim"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/1a8d92e93481c432a91f7c213099800a.asciidoc b/docs/examples/1a8d92e93481c432a91f7c213099800a.asciidoc
new file mode 100644
index 000000000..8f5bbf405
--- /dev/null
+++ b/docs/examples/1a8d92e93481c432a91f7c213099800a.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-api-key.asciidoc:290
+
+[source, python]
+----
+resp = client.security.query_api_keys()
+print(resp)
+----
diff --git a/docs/examples/1a9e03ce0355872a7db27fedc783fbec.asciidoc b/docs/examples/1a9e03ce0355872a7db27fedc783fbec.asciidoc
new file mode 100644
index 000000000..e0431da95
--- /dev/null
+++ b/docs/examples/1a9e03ce0355872a7db27fedc783fbec.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-google-vertex-ai.asciidoc:125
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="rerank",
+ inference_id="google_vertex_ai_rerank",
+ inference_config={
+ "service": "googlevertexai",
+ "service_settings": {
+ "service_account_json": "",
+ "project_id": ""
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1a9efb56adb2cd84faa9825a129381b9.asciidoc b/docs/examples/1a9efb56adb2cd84faa9825a129381b9.asciidoc
new file mode 100644
index 000000000..590880dfc
--- /dev/null
+++ b/docs/examples/1a9efb56adb2cd84faa9825a129381b9.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/rollup-search.asciidoc:213
+
+[source, python]
+----
+resp = client.rollup.rollup_search(
+ index="sensor-1,sensor_rollup",
+ size=0,
+ aggregations={
+ "max_temperature": {
+ "max": {
+ "field": "temperature"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1aa91d3d48140d6367b6cabca8737b8f.asciidoc b/docs/examples/1aa91d3d48140d6367b6cabca8737b8f.asciidoc
index 7bc426db3..fc3519cf1 100644
--- a/docs/examples/1aa91d3d48140d6367b6cabca8737b8f.asciidoc
+++ b/docs/examples/1aa91d3d48140d6367b6cabca8737b8f.asciidoc
@@ -1,16 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
// docs/bulk.asciidoc:632
[source, python]
----
resp = client.bulk(
- body=[
- {"update": {"_id": "5", "_index": "index1"}},
- {"doc": {"my_field": "foo"}},
- {"update": {"_id": "6", "_index": "index1"}},
- {"doc": {"my_field": "foo"}},
- {"create": {"_id": "7", "_index": "index1"}},
- {"my_field": "foo"},
+ operations=[
+ {
+ "update": {
+ "_id": "5",
+ "_index": "index1"
+ }
+ },
+ {
+ "doc": {
+ "my_field": "foo"
+ }
+ },
+ {
+ "update": {
+ "_id": "6",
+ "_index": "index1"
+ }
+ },
+ {
+ "doc": {
+ "my_field": "foo"
+ }
+ },
+ {
+ "create": {
+ "_id": "7",
+ "_index": "index1"
+ }
+ },
+ {
+ "my_field": "foo"
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1aa96eeaf63fc967e166d1a2fcdccccc.asciidoc b/docs/examples/1aa96eeaf63fc967e166d1a2fcdccccc.asciidoc
new file mode 100644
index 000000000..f2acde7ac
--- /dev/null
+++ b/docs/examples/1aa96eeaf63fc967e166d1a2fcdccccc.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/subobjects.asciidoc:130
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000002",
+ mappings={
+ "properties": {
+ "metrics": {
+ "subobjects": False,
+ "properties": {
+ "time": {
+ "type": "object",
+ "properties": {
+ "min": {
+ "type": "long"
+ },
+ "max": {
+ "type": "long"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.get_mapping(
+ index="my-index-000002",
+)
+print(resp1)
+----
diff --git a/docs/examples/1adee74383e5594e45c937177d75aa2a.asciidoc b/docs/examples/1adee74383e5594e45c937177d75aa2a.asciidoc
index 0a34971f4..ad944e86b 100644
--- a/docs/examples/1adee74383e5594e45c937177d75aa2a.asciidoc
+++ b/docs/examples/1adee74383e5594e45c937177d75aa2a.asciidoc
@@ -1,10 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/unsigned_long.asciidoc:93
[source, python]
----
resp = client.search(
index="my_index",
- body={"query": {"match_all": {}}, "sort": {"my_counter": "desc"}},
+ query={
+ "match_all": {}
+ },
+ sort={
+ "my_counter": "desc"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1af9742c71ce0587cd49a73ec7fc1f6c.asciidoc b/docs/examples/1af9742c71ce0587cd49a73ec7fc1f6c.asciidoc
new file mode 100644
index 000000000..669023540
--- /dev/null
+++ b/docs/examples/1af9742c71ce0587cd49a73ec7fc1f6c.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/trainedmodel.asciidoc:118
+
+[source, python]
+----
+resp = client.cat.ml_trained_models(
+ h="c,o,l,ct,v",
+ v="ture",
+)
+print(resp)
+----
diff --git a/docs/examples/1b076ceb1ead9f6897c2f351f0e45f74.asciidoc b/docs/examples/1b076ceb1ead9f6897c2f351f0e45f74.asciidoc
new file mode 100644
index 000000000..937867c30
--- /dev/null
+++ b/docs/examples/1b076ceb1ead9f6897c2f351f0e45f74.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-api-keys.asciidoc:220
+
+[source, python]
+----
+resp = client.security.create_api_key(
+ name="my-restricted-api-key",
+ role_descriptors={
+ "my-restricted-role-descriptor": {
+ "indices": [
+ {
+ "names": [
+ "my-search-app"
+ ],
+ "privileges": [
+ "read"
+ ]
+ }
+ ],
+ "restriction": {
+ "workflows": [
+ "search_application_query"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1b0b29e5cd7550c648d0892378e93804.asciidoc b/docs/examples/1b0b29e5cd7550c648d0892378e93804.asciidoc
new file mode 100644
index 000000000..f5f77f18a
--- /dev/null
+++ b/docs/examples/1b0b29e5cd7550c648d0892378e93804.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/delete-calendar-job.asciidoc:36
+
+[source, python]
+----
+resp = client.ml.delete_calendar_job(
+ calendar_id="planned-outages",
+ job_id="total-requests",
+)
+print(resp)
+----
diff --git a/docs/examples/1b0dc9d076bbb58c6a2953ef4323d2fc.asciidoc b/docs/examples/1b0dc9d076bbb58c6a2953ef4323d2fc.asciidoc
new file mode 100644
index 000000000..b6018227b
--- /dev/null
+++ b/docs/examples/1b0dc9d076bbb58c6a2953ef4323d2fc.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/ack-watch.asciidoc:190
+
+[source, python]
+----
+resp = client.watcher.ack_watch(
+ watch_id="my_watch",
+ action_id="test_index",
+)
+print(resp)
+
+resp1 = client.watcher.get_watch(
+ id="my_watch",
+)
+print(resp1)
+----
diff --git a/docs/examples/1b0f40959a7a4d124372f2bd3f7eac85.asciidoc b/docs/examples/1b0f40959a7a4d124372f2bd3f7eac85.asciidoc
new file mode 100644
index 000000000..925f3adf2
--- /dev/null
+++ b/docs/examples/1b0f40959a7a4d124372f2bd3f7eac85.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/fingerprint-tokenfilter.asciidoc:117
+
+[source, python]
+----
+resp = client.indices.create(
+ index="custom_fingerprint_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "fingerprint_plus_concat"
+ ]
+ }
+ },
+ "filter": {
+ "fingerprint_plus_concat": {
+ "type": "fingerprint",
+ "max_output_size": 100,
+ "separator": "+"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1b2ab75d3c8064fac6ecc63104396c02.asciidoc b/docs/examples/1b2ab75d3c8064fac6ecc63104396c02.asciidoc
new file mode 100644
index 000000000..f06ba7169
--- /dev/null
+++ b/docs/examples/1b2ab75d3c8064fac6ecc63104396c02.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/put-calendar-job.asciidoc:36
+
+[source, python]
+----
+resp = client.ml.put_calendar_job(
+ calendar_id="planned-outages",
+ job_id="total-requests",
+)
+print(resp)
+----
diff --git a/docs/examples/1b3762712c14a19e8c2956b4f530d327.asciidoc b/docs/examples/1b3762712c14a19e8c2956b4f530d327.asciidoc
new file mode 100644
index 000000000..9756e7301
--- /dev/null
+++ b/docs/examples/1b3762712c14a19e8c2956b4f530d327.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/put-follow.asciidoc:108
+
+[source, python]
+----
+resp = client.ccr.follow(
+ index="follower_index",
+ wait_for_active_shards="1",
+ remote_cluster="remote_cluster",
+ leader_index="leader_index",
+ settings={
+ "index.number_of_replicas": 0
+ },
+ max_read_request_operation_count=1024,
+ max_outstanding_read_requests=16,
+ max_read_request_size="1024k",
+ max_write_request_operation_count=32768,
+ max_write_request_size="16k",
+ max_outstanding_write_requests=8,
+ max_write_buffer_count=512,
+ max_write_buffer_size="512k",
+ max_retry_delay="10s",
+ read_poll_timeout="30s",
+)
+print(resp)
+----
diff --git a/docs/examples/1b37e2237c9e3aaf84d56cc5c0bdb9ec.asciidoc b/docs/examples/1b37e2237c9e3aaf84d56cc5c0bdb9ec.asciidoc
new file mode 100644
index 000000000..827fafa03
--- /dev/null
+++ b/docs/examples/1b37e2237c9e3aaf84d56cc5c0bdb9ec.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/error-handling.asciidoc:15
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="shrink-index",
+ policy={
+ "phases": {
+ "warm": {
+ "min_age": "5d",
+ "actions": {
+ "shrink": {
+ "number_of_shards": 4
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1b47d988b218ee595430ec91eba91d80.asciidoc b/docs/examples/1b47d988b218ee595430ec91eba91d80.asciidoc
new file mode 100644
index 000000000..edc093da9
--- /dev/null
+++ b/docs/examples/1b47d988b218ee595430ec91eba91d80.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/ignore-missing-component-templates.asciidoc:47
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="logs-foo",
+ index_patterns=[
+ "logs-foo-*"
+ ],
+ data_stream={},
+ composed_of=[
+ "logs-foo_component1",
+ "logs-foo_component2"
+ ],
+ ignore_missing_component_templates=[
+ "logs-foo_component2"
+ ],
+ priority=500,
+)
+print(resp)
+----
diff --git a/docs/examples/1b5c8d6e61930a308008b5b1ace2aa07.asciidoc b/docs/examples/1b5c8d6e61930a308008b5b1ace2aa07.asciidoc
new file mode 100644
index 000000000..7734b6420
--- /dev/null
+++ b/docs/examples/1b5c8d6e61930a308008b5b1ace2aa07.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/properties.asciidoc:74
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "manager.name": "Alice White"
+ }
+ },
+ aggs={
+ "Employees": {
+ "nested": {
+ "path": "employees"
+ },
+ "aggs": {
+ "Employee Ages": {
+ "histogram": {
+ "field": "employees.age",
+ "interval": 5
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1b98b60d8e558fcccf9c550bdbf5b5c9.asciidoc b/docs/examples/1b98b60d8e558fcccf9c550bdbf5b5c9.asciidoc
new file mode 100644
index 000000000..da3219485
--- /dev/null
+++ b/docs/examples/1b98b60d8e558fcccf9c550bdbf5b5c9.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/role-templates.asciidoc:75
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="example3",
+ indices=[
+ {
+ "names": [
+ "my-index-000001"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "query": {
+ "template": {
+ "source": "{ \"terms\": { \"group.statuses\": {{#toJson}}_user.metadata.statuses{{/toJson}} }}"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/1ba7afe23a26fe9ac7856d8c5bc1059d.asciidoc b/docs/examples/1ba7afe23a26fe9ac7856d8c5bc1059d.asciidoc
new file mode 100644
index 000000000..dc02df84d
--- /dev/null
+++ b/docs/examples/1ba7afe23a26fe9ac7856d8c5bc1059d.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1501
+
+[source, python]
+----
+resp = client.indices.create(
+ index="romanian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "romanian_stop": {
+ "type": "stop",
+ "stopwords": "_romanian_"
+ },
+ "romanian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "exemplu"
+ ]
+ },
+ "romanian_stemmer": {
+ "type": "stemmer",
+ "language": "romanian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_romanian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "romanian_stop",
+ "romanian_keywords",
+ "romanian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1bceb160ed2bcd51ee040caf21acf780.asciidoc b/docs/examples/1bceb160ed2bcd51ee040caf21acf780.asciidoc
new file mode 100644
index 000000000..4283e6f0b
--- /dev/null
+++ b/docs/examples/1bceb160ed2bcd51ee040caf21acf780.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:391
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my-search-app",
+ search_application={
+ "indices": [
+ "index1"
+ ],
+ "template": {
+ "script": {
+ "lang": "mustache",
+ "source": "\n {\n \"retriever\": {\n \"rrf\": {\n \"retrievers\": [\n {{#text_fields}}\n {\n \"standard\": {\n \"query\": {\n \"match\": {\n \"{{.}}\": \"{{query_string}}\"\n }\n }\n }\n },\n {{/text_fields}}\n {{#elser_fields}}\n {\n \"standard\": {\n \"query\": {\n \"sparse_vector\": {\n \"field\": \"ml.inference.{{.}}_expanded.predicted_value\",\n \"inference_id\": \"\",\n \"query\": \"{{query_string}}\"\n }\n }\n }\n },\n {{/elser_fields}}\n ],\n \"rank_window_size\": {{rrf.rank_window_size}},\n \"rank_constant\": {{rrf.rank_constant}}\n }\n }\n }\n ",
+ "params": {
+ "elser_fields": [
+ "title",
+ "meta_description"
+ ],
+ "text_fields": [
+ "title",
+ "meta_description"
+ ],
+ "query_string": "",
+ "rrf": {
+ "rank_window_size": 100,
+ "rank_constant": 60
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1c142bc8cac8d9dcb4f60e22902d434f.asciidoc b/docs/examples/1c142bc8cac8d9dcb4f60e22902d434f.asciidoc
new file mode 100644
index 000000000..6094cf437
--- /dev/null
+++ b/docs/examples/1c142bc8cac8d9dcb4f60e22902d434f.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/string-stats-aggregation.asciidoc:65
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ size="0",
+ aggs={
+ "message_stats": {
+ "string_stats": {
+ "field": "message.keyword",
+ "show_distribution": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1c1f2a6a193d9e64c37242b2824b3031.asciidoc b/docs/examples/1c1f2a6a193d9e64c37242b2824b3031.asciidoc
new file mode 100644
index 000000000..e3b6bbbc2
--- /dev/null
+++ b/docs/examples/1c1f2a6a193d9e64c37242b2824b3031.asciidoc
@@ -0,0 +1,55 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/tsds-reindex.asciidoc:44
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="source_template",
+ template={
+ "settings": {
+ "index": {
+ "number_of_replicas": 2,
+ "number_of_shards": 2,
+ "mode": "time_series",
+ "routing_path": [
+ "metricset"
+ ]
+ }
+ },
+ "mappings": {
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ },
+ "metricset": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "k8s": {
+ "properties": {
+ "tx": {
+ "type": "long"
+ },
+ "rx": {
+ "type": "long"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.put_index_template(
+ name="1",
+ index_patterns=[
+ "k8s*"
+ ],
+ composed_of=[
+ "source_template"
+ ],
+ data_stream={},
+)
+print(resp1)
+----
diff --git a/docs/examples/1c3e3c4f2d268f1826a9b417e1868a58.asciidoc b/docs/examples/1c3e3c4f2d268f1826a9b417e1868a58.asciidoc
new file mode 100644
index 000000000..059651182
--- /dev/null
+++ b/docs/examples/1c3e3c4f2d268f1826a9b417e1868a58.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:312
+
+[source, python]
+----
+resp = client.update(
+ index="my-index-000001",
+ id="1",
+ script={
+ "source": "ctx._source.tags.add(params['tag'])",
+ "lang": "painless",
+ "params": {
+ "tag": "blue"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1c87b5bf682bc1e8809a657529e14b07.asciidoc b/docs/examples/1c87b5bf682bc1e8809a657529e14b07.asciidoc
new file mode 100644
index 000000000..28405ffbc
--- /dev/null
+++ b/docs/examples/1c87b5bf682bc1e8809a657529e14b07.asciidoc
@@ -0,0 +1,58 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-shape-query.asciidoc:189
+
+[source, python]
+----
+resp = client.indices.create(
+ index="shapes",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_shape"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="shapes",
+ id="deu",
+ document={
+ "location": {
+ "type": "envelope",
+ "coordinates": [
+ [
+ 13,
+ 53
+ ],
+ [
+ 14,
+ 52
+ ]
+ ]
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="example",
+ query={
+ "bool": {
+ "filter": {
+ "geo_shape": {
+ "location": {
+ "indexed_shape": {
+ "index": "shapes",
+ "id": "deu",
+ "path": "location"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/1c8b6768c4eefc76fcb38708152f561b.asciidoc b/docs/examples/1c8b6768c4eefc76fcb38708152f561b.asciidoc
new file mode 100644
index 000000000..aa1420b78
--- /dev/null
+++ b/docs/examples/1c8b6768c4eefc76fcb38708152f561b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/delete-dfanalytics.asciidoc:51
+
+[source, python]
+----
+resp = client.ml.delete_data_frame_analytics(
+ id="loganalytics",
+)
+print(resp)
+----
diff --git a/docs/examples/1cab9da122778a95061831265c250cc1.asciidoc b/docs/examples/1cab9da122778a95061831265c250cc1.asciidoc
index bf550b6ed..54c5fbeaf 100644
--- a/docs/examples/1cab9da122778a95061831265c250cc1.asciidoc
+++ b/docs/examples/1cab9da122778a95061831265c250cc1.asciidoc
@@ -1,19 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/metrics/valuecount-aggregation.asciidoc:49
[source, python]
----
resp = client.search(
index="sales",
- body={
- "size": 0,
- "runtime_mappings": {
- "tags": {
- "type": "keyword",
- "script": "\n emit(doc['type'].value);\n if (doc['promoted'].value) {\n emit('hot');\n }\n ",
+ size=0,
+ runtime_mappings={
+ "tags": {
+ "type": "keyword",
+ "script": "\n emit(doc['type'].value);\n if (doc['promoted'].value) {\n emit('hot');\n }\n "
+ }
+ },
+ aggs={
+ "tags_count": {
+ "value_count": {
+ "field": "tags"
}
- },
- "aggs": {"tags_count": {"value_count": {"field": "tags"}}},
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1cadbcf2cfeb312f73b7f098291356ac.asciidoc b/docs/examples/1cadbcf2cfeb312f73b7f098291356ac.asciidoc
index e88f56b47..1daa63c88 100644
--- a/docs/examples/1cadbcf2cfeb312f73b7f098291356ac.asciidoc
+++ b/docs/examples/1cadbcf2cfeb312f73b7f098291356ac.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:346
[source, python]
----
resp = client.index(
index="example",
- body={"location": "MULTIPOINT (102.0 2.0, 103.0 2.0)"},
+ document={
+ "location": "MULTIPOINT (102.0 2.0, 103.0 2.0)"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1cb3b45335ab1b9697c358104d44ea39.asciidoc b/docs/examples/1cb3b45335ab1b9697c358104d44ea39.asciidoc
new file mode 100644
index 000000000..18ea25322
--- /dev/null
+++ b/docs/examples/1cb3b45335ab1b9697c358104d44ea39.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// security/using-ip-filtering.asciidoc:158
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "xpack.security.transport.filter.enabled": False
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1cca4bb2f0ea7e43181be8bd965149d4.asciidoc b/docs/examples/1cca4bb2f0ea7e43181be8bd965149d4.asciidoc
new file mode 100644
index 000000000..5e39d3f97
--- /dev/null
+++ b/docs/examples/1cca4bb2f0ea7e43181be8bd965149d4.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1296
+
+[source, python]
+----
+resp = client.eql.get(
+ id="FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
+ wait_for_completion_timeout="2s",
+)
+print(resp)
+----
diff --git a/docs/examples/1cd3b9d65576a9212eef898eb3105758.asciidoc b/docs/examples/1cd3b9d65576a9212eef898eb3105758.asciidoc
index f146c1b5d..39530b179 100644
--- a/docs/examples/1cd3b9d65576a9212eef898eb3105758.asciidoc
+++ b/docs/examples/1cd3b9d65576a9212eef898eb3105758.asciidoc
@@ -1,11 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// setup/restart-cluster.asciidoc:35
[source, python]
----
resp = client.cluster.put_settings(
- body={
- "persistent": {"cluster.routing.allocation.enable": "primaries"}
+ persistent={
+ "cluster.routing.allocation.enable": "primaries"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1cea60c47d5c0e150b4c8fff4cd75ffe.asciidoc b/docs/examples/1cea60c47d5c0e150b4c8fff4cd75ffe.asciidoc
new file mode 100644
index 000000000..e4bbab9f1
--- /dev/null
+++ b/docs/examples/1cea60c47d5c0e150b4c8fff4cd75ffe.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/script.asciidoc:112
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "processors": [
+ {
+ "script": {
+ "description": "Set index based on `lang` field and `dataset` param",
+ "lang": "painless",
+ "source": "\n ctx['_index'] = ctx['lang'] + '-' + params['dataset'];\n ",
+ "params": {
+ "dataset": "catalog"
+ }
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_index": "generic-index",
+ "_source": {
+ "lang": "fr"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/1ceaa211756e2db3d48c6bc4b1a861b0.asciidoc b/docs/examples/1ceaa211756e2db3d48c6bc4b1a861b0.asciidoc
new file mode 100644
index 000000000..4dfea7820
--- /dev/null
+++ b/docs/examples/1ceaa211756e2db3d48c6bc4b1a861b0.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:944
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-index*",
+ max_samples_per_key=2,
+ size=20,
+ query="\n sample\n [any where uptime > 0] by host,os\n [any where port > 100] by host,op_sys\n [any where bool == true] by host,os\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/1cecd4d87a92427175157d41859df2af.asciidoc b/docs/examples/1cecd4d87a92427175157d41859df2af.asciidoc
index f4ff982b7..5e73037d0 100644
--- a/docs/examples/1cecd4d87a92427175157d41859df2af.asciidoc
+++ b/docs/examples/1cecd4d87a92427175157d41859df2af.asciidoc
@@ -1,14 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// cluster/allocation-explain.asciidoc:10
[source, python]
----
resp = client.cluster.allocation_explain(
- body={
- "index": "my-index-000001",
- "shard": 0,
- "primary": False,
- "current_node": "my-node",
- },
+ index="my-index-000001",
+ shard=0,
+ primary=False,
+ current_node="my-node",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1cfa04e9654c1484e3d4c75bf439400a.asciidoc b/docs/examples/1cfa04e9654c1484e3d4c75bf439400a.asciidoc
index 7966355af..b585c5ddb 100644
--- a/docs/examples/1cfa04e9654c1484e3d4c75bf439400a.asciidoc
+++ b/docs/examples/1cfa04e9654c1484e3d4c75bf439400a.asciidoc
@@ -1,30 +1,61 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:226
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "polygon",
"coordinates": [
[
- [1000, -1001],
- [1001, -1001],
- [1001, -1000],
- [1000, -1000],
- [1000, -1001],
+ [
+ 1000,
+ -1001
+ ],
+ [
+ 1001,
+ -1001
+ ],
+ [
+ 1001,
+ -1000
+ ],
+ [
+ 1000,
+ -1000
+ ],
+ [
+ 1000,
+ -1001
+ ]
],
[
- [1000.2, -1001.2],
- [1000.8, -1001.2],
- [1000.8, -1001.8],
- [1000.2, -1001.8],
- [1000.2, -1001.2],
- ],
- ],
+ [
+ 1000.2,
+ -1001.2
+ ],
+ [
+ 1000.8,
+ -1001.2
+ ],
+ [
+ 1000.8,
+ -1001.8
+ ],
+ [
+ 1000.2,
+ -1001.8
+ ],
+ [
+ 1000.2,
+ -1001.2
+ ]
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1d252d9217c61c2c1cbe7a92f77b078f.asciidoc b/docs/examples/1d252d9217c61c2c1cbe7a92f77b078f.asciidoc
new file mode 100644
index 000000000..442eae70f
--- /dev/null
+++ b/docs/examples/1d252d9217c61c2c1cbe7a92f77b078f.asciidoc
@@ -0,0 +1,71 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-api-key.asciidoc:608
+
+[source, python]
+----
+resp = client.security.query_api_keys(
+ size=0,
+ query={
+ "bool": {
+ "must": {
+ "term": {
+ "invalidated": False
+ }
+ },
+ "should": [
+ {
+ "range": {
+ "expiration": {
+ "gte": "now"
+ }
+ }
+ },
+ {
+ "bool": {
+ "must_not": {
+ "exists": {
+ "field": "expiration"
+ }
+ }
+ }
+ }
+ ],
+ "minimum_should_match": 1
+ }
+ },
+ aggs={
+ "keys_by_username": {
+ "composite": {
+ "sources": [
+ {
+ "usernames": {
+ "terms": {
+ "field": "username"
+ }
+ }
+ }
+ ]
+ },
+ "aggs": {
+ "expires_soon": {
+ "filter": {
+ "range": {
+ "expiration": {
+ "lte": "now+30d/d"
+ }
+ }
+ },
+ "aggs": {
+ "key_names": {
+ "terms": {
+ "field": "name"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1d746272a7511bf91302a15b5c58ca0e.asciidoc b/docs/examples/1d746272a7511bf91302a15b5c58ca0e.asciidoc
new file mode 100644
index 000000000..47ed9e030
--- /dev/null
+++ b/docs/examples/1d746272a7511bf91302a15b5c58ca0e.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:707
+
+[source, python]
+----
+resp = client.search(
+ index="passage_vectors",
+ fields=[
+ "full_text",
+ "creation_time"
+ ],
+ source=False,
+ knn={
+ "query_vector": [
+ 0.45,
+ 45
+ ],
+ "field": "paragraph.vector",
+ "k": 2,
+ "num_candidates": 2
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1d827ae674970692643ea81991e5396e.asciidoc b/docs/examples/1d827ae674970692643ea81991e5396e.asciidoc
index dbc6a01a6..faaa8e48a 100644
--- a/docs/examples/1d827ae674970692643ea81991e5396e.asciidoc
+++ b/docs/examples/1d827ae674970692643ea81991e5396e.asciidoc
@@ -1,22 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/flattened.asciidoc:334
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"flattened": {"type": "flattened"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "flattened": {
+ "type": "flattened"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={
+ document={
"flattened": {
"field": [
"apple",
@@ -27,10 +32,10 @@ resp = client.index(
"200",
"AVOCADO",
"Banana",
- "Tangerine",
+ "Tangerine"
]
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/1d918e206ad8dab916e59183da24d9ec.asciidoc b/docs/examples/1d918e206ad8dab916e59183da24d9ec.asciidoc
new file mode 100644
index 000000000..236c5a03f
--- /dev/null
+++ b/docs/examples/1d918e206ad8dab916e59183da24d9ec.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/how-watcher-works.asciidoc:156
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index=".watches",
+ settings={
+ "index.routing.allocation.include.role": "watcher"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1d9b695a17cffd910c496c9b03c75d6f.asciidoc b/docs/examples/1d9b695a17cffd910c496c9b03c75d6f.asciidoc
new file mode 100644
index 000000000..c9c7bce87
--- /dev/null
+++ b/docs/examples/1d9b695a17cffd910c496c9b03c75d6f.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-migrate-data-stream-from-ilm-to-dsl.asciidoc:34
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="pre-dsl-ilm-policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_primary_shard_size": "50gb"
+ }
+ }
+ },
+ "delete": {
+ "min_age": "7d",
+ "actions": {
+ "delete": {}
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1dadb7efe27b6c0c231eb6535e413bd9.asciidoc b/docs/examples/1dadb7efe27b6c0c231eb6535e413bd9.asciidoc
new file mode 100644
index 000000000..78c452868
--- /dev/null
+++ b/docs/examples/1dadb7efe27b6c0c231eb6535e413bd9.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-azure-ai-studio.asciidoc:142
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="azure_ai_studio_embeddings",
+ inference_config={
+ "service": "azureaistudio",
+ "service_settings": {
+ "api_key": "",
+ "target": "",
+ "provider": "",
+ "endpoint_type": ""
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1db086021e83205b6eab3b7765911cc2.asciidoc b/docs/examples/1db086021e83205b6eab3b7765911cc2.asciidoc
new file mode 100644
index 000000000..996b40c09
--- /dev/null
+++ b/docs/examples/1db086021e83205b6eab3b7765911cc2.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/parent-aggregation.asciidoc:16
+
+[source, python]
+----
+resp = client.indices.create(
+ index="parent_example",
+ mappings={
+ "properties": {
+ "join": {
+ "type": "join",
+ "relations": {
+ "question": "answer"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1db715eb00832686ecddb6603684fc26.asciidoc b/docs/examples/1db715eb00832686ecddb6603684fc26.asciidoc
new file mode 100644
index 000000000..9e6c2b2c5
--- /dev/null
+++ b/docs/examples/1db715eb00832686ecddb6603684fc26.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/enroll-kibana.asciidoc:28
+
+[source, python]
+----
+resp = client.security.enroll_kibana()
+print(resp)
+----
diff --git a/docs/examples/1dbb8cf17fbc45c87c7d2f75f15f9778.asciidoc b/docs/examples/1dbb8cf17fbc45c87c7d2f75f15f9778.asciidoc
new file mode 100644
index 000000000..ccd737744
--- /dev/null
+++ b/docs/examples/1dbb8cf17fbc45c87c7d2f75f15f9778.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/common-options.asciidoc:102
+
+[source, python]
+----
+resp = client.cluster.state(
+ filter_path="metadata.indices.*.stat*",
+)
+print(resp)
+----
diff --git a/docs/examples/1e08e054c761353f99211cd18e8ca47b.asciidoc b/docs/examples/1e08e054c761353f99211cd18e8ca47b.asciidoc
new file mode 100644
index 000000000..c4ff7e042
--- /dev/null
+++ b/docs/examples/1e08e054c761353f99211cd18e8ca47b.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/delete-snapshot.asciidoc:43
+
+[source, python]
+----
+resp = client.ml.delete_model_snapshot(
+ job_id="farequote",
+ snapshot_id="1491948163",
+)
+print(resp)
+----
diff --git a/docs/examples/1e0b85750d4e63ebbc927d4627c44bf8.asciidoc b/docs/examples/1e0b85750d4e63ebbc927d4627c44bf8.asciidoc
new file mode 100644
index 000000000..a5c7cca2e
--- /dev/null
+++ b/docs/examples/1e0b85750d4e63ebbc927d4627c44bf8.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/size-your-shards.asciidoc:599
+
+[source, python]
+----
+resp = client.indices.forcemerge(
+ index="my-index-000001",
+ only_expunge_deletes=True,
+)
+print(resp)
+----
diff --git a/docs/examples/1e0f203aced9344382081ab095c44dde.asciidoc b/docs/examples/1e0f203aced9344382081ab095c44dde.asciidoc
index 2e158c5bb..9c3bb543d 100644
--- a/docs/examples/1e0f203aced9344382081ab095c44dde.asciidoc
+++ b/docs/examples/1e0f203aced9344382081ab095c44dde.asciidoc
@@ -1,28 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/text.asciidoc:233
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"text": {"type": "text", "store": True}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "text": {
+ "type": "text",
+ "store": True
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={
+ document={
"text": [
"the quick brown fox",
"the quick brown fox",
- "jumped over the lazy dog",
+ "jumped over the lazy dog"
]
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/1e18a67caf8f06ff2710ec4a8b30f625.asciidoc b/docs/examples/1e18a67caf8f06ff2710ec4a8b30f625.asciidoc
new file mode 100644
index 000000000..1e8a28531
--- /dev/null
+++ b/docs/examples/1e18a67caf8f06ff2710ec4a8b30f625.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/common-options.asciidoc:169
+
+[source, python]
+----
+resp = client.cluster.state(
+ filter_path="metadata.indices.*.state,-metadata.indices.logstash-*",
+)
+print(resp)
+----
diff --git a/docs/examples/1e26353d546d733634187b8c3a7837a7.asciidoc b/docs/examples/1e26353d546d733634187b8c3a7837a7.asciidoc
new file mode 100644
index 000000000..588151968
--- /dev/null
+++ b/docs/examples/1e26353d546d733634187b8c3a7837a7.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/list-connectors-api.asciidoc:100
+
+[source, python]
+----
+resp = client.connector.list(
+ service_type="sharepoint_online",
+)
+print(resp)
+----
diff --git a/docs/examples/1e2c5cef7a3f254c71a33865eb4d7569.asciidoc b/docs/examples/1e2c5cef7a3f254c71a33865eb4d7569.asciidoc
new file mode 100644
index 000000000..8e6283e07
--- /dev/null
+++ b/docs/examples/1e2c5cef7a3f254c71a33865eb4d7569.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/distance-feature-query.asciidoc:98
+
+[source, python]
+----
+resp = client.search(
+ index="items",
+ query={
+ "bool": {
+ "must": {
+ "match": {
+ "name": "chocolate"
+ }
+ },
+ "should": {
+ "distance_feature": {
+ "field": "production_date",
+ "pivot": "7d",
+ "origin": "now"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1e3384bc255729b65a6f0fc8011ff733.asciidoc b/docs/examples/1e3384bc255729b65a6f0fc8011ff733.asciidoc
new file mode 100644
index 000000000..e0a2d183c
--- /dev/null
+++ b/docs/examples/1e3384bc255729b65a6f0fc8011ff733.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/segments.asciidoc:12
+
+[source, python]
+----
+resp = client.indices.segments(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/1e3553a73da487017f7a95088b6aa957.asciidoc b/docs/examples/1e3553a73da487017f7a95088b6aa957.asciidoc
new file mode 100644
index 000000000..2b259046e
--- /dev/null
+++ b/docs/examples/1e3553a73da487017f7a95088b6aa957.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-roles-cache.asciidoc:56
+
+[source, python]
+----
+resp = client.security.clear_cached_roles(
+ name="*",
+)
+print(resp)
+----
diff --git a/docs/examples/1e4b17b830ead15087ccd96151a5ebde.asciidoc b/docs/examples/1e4b17b830ead15087ccd96151a5ebde.asciidoc
new file mode 100644
index 000000000..17ee3d11d
--- /dev/null
+++ b/docs/examples/1e4b17b830ead15087ccd96151a5ebde.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/string-stats-aggregation.asciidoc:133
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ size=0,
+ runtime_mappings={
+ "message_and_context": {
+ "type": "keyword",
+ "script": "\n emit(doc['message.keyword'].value + ' ' + doc['context.keyword'].value)\n "
+ }
+ },
+ aggs={
+ "message_stats": {
+ "string_stats": {
+ "field": "message_and_context"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1e547696f54582840040b1aa6661760c.asciidoc b/docs/examples/1e547696f54582840040b1aa6661760c.asciidoc
new file mode 100644
index 000000000..3166b147c
--- /dev/null
+++ b/docs/examples/1e547696f54582840040b1aa6661760c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/rollover-index.asciidoc:226
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/1e871f060dbe1a5c316ed205278804a8.asciidoc b/docs/examples/1e871f060dbe1a5c316ed205278804a8.asciidoc
index ebf31cc5e..d976644d5 100644
--- a/docs/examples/1e871f060dbe1a5c316ed205278804a8.asciidoc
+++ b/docs/examples/1e871f060dbe1a5c316ed205278804a8.asciidoc
@@ -1,28 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:338
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "countries": {
- "terms": {
- "field": "artist.country",
- "order": {"rock>playback_stats.avg": "desc"},
- },
- "aggs": {
- "rock": {
- "filter": {"term": {"genre": "rock"}},
- "aggs": {
- "playback_stats": {
- "stats": {"field": "play_count"}
+ aggs={
+ "countries": {
+ "terms": {
+ "field": "artist.country",
+ "order": {
+ "rock>playback_stats.avg": "desc"
+ }
+ },
+ "aggs": {
+ "rock": {
+ "filter": {
+ "term": {
+ "genre": "rock"
+ }
+ },
+ "aggs": {
+ "playback_stats": {
+ "stats": {
+ "field": "play_count"
}
- },
+ }
}
- },
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/1e94a2bb95bc245bcfb87ac7d611cf49.asciidoc b/docs/examples/1e94a2bb95bc245bcfb87ac7d611cf49.asciidoc
new file mode 100644
index 000000000..f419b9f59
--- /dev/null
+++ b/docs/examples/1e94a2bb95bc245bcfb87ac7d611cf49.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-aggregation.asciidoc:335
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_outlier": {
+ "percentiles": {
+ "field": "load_time",
+ "tdigest": {
+ "execution_hint": "high_accuracy"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1e9cab0b2727624e22e8cf4e7ca498ac.asciidoc b/docs/examples/1e9cab0b2727624e22e8cf4e7ca498ac.asciidoc
new file mode 100644
index 000000000..3fc6be026
--- /dev/null
+++ b/docs/examples/1e9cab0b2727624e22e8cf4e7ca498ac.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/example-watches/example-watch-clusterstatus.asciidoc:45
+
+[source, python]
+----
+resp = client.cluster.health(
+ pretty=True,
+)
+print(resp)
+----
diff --git a/docs/examples/1ea24f67fbbb6293d53caf2fe0c4b984.asciidoc b/docs/examples/1ea24f67fbbb6293d53caf2fe0c4b984.asciidoc
new file mode 100644
index 000000000..91ff6f009
--- /dev/null
+++ b/docs/examples/1ea24f67fbbb6293d53caf2fe0c4b984.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/simple-analyzer.asciidoc:15
+
+[source, python]
+----
+resp = client.indices.analyze(
+ analyzer="simple",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/1eb9c6ecb827ca69f7b17f7d2a26eae9.asciidoc b/docs/examples/1eb9c6ecb827ca69f7b17f7d2a26eae9.asciidoc
new file mode 100644
index 000000000..e6ddf4d8a
--- /dev/null
+++ b/docs/examples/1eb9c6ecb827ca69f7b17f7d2a26eae9.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:280
+
+[source, python]
+----
+resp = client.render_search_template(
+ source={
+ "query": {
+ "term": {
+ "url.full": "{{#url}}{{host}}/{{page}}{{/url}}"
+ }
+ }
+ },
+ params={
+ "host": "http://example.com",
+ "page": "hello-world"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1ec66f188f681598cb5d7df700b214e3.asciidoc b/docs/examples/1ec66f188f681598cb5d7df700b214e3.asciidoc
new file mode 100644
index 000000000..1eb1e49a1
--- /dev/null
+++ b/docs/examples/1ec66f188f681598cb5d7df700b214e3.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keyword-marker-tokenfilter.asciidoc:365
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_custom_analyzer": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "my_custom_keyword_marker_filter",
+ "porter_stem"
+ ]
+ }
+ },
+ "filter": {
+ "my_custom_keyword_marker_filter": {
+ "type": "keyword_marker",
+ "keywords_path": "analysis/example_word_list.txt"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1ed26c7b445ab1c167bd9385e1f0066f.asciidoc b/docs/examples/1ed26c7b445ab1c167bd9385e1f0066f.asciidoc
new file mode 100644
index 000000000..fcf34c209
--- /dev/null
+++ b/docs/examples/1ed26c7b445ab1c167bd9385e1f0066f.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/apis/delete-async-sql-search-api.asciidoc:12
+
+[source, python]
+----
+resp = client.sql.delete_async(
+ id="FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
+)
+print(resp)
+----
diff --git a/docs/examples/1ed77bf308fa4ab328b36060e412f500.asciidoc b/docs/examples/1ed77bf308fa4ab328b36060e412f500.asciidoc
new file mode 100644
index 000000000..8a4c5d347
--- /dev/null
+++ b/docs/examples/1ed77bf308fa4ab328b36060e412f500.asciidoc
@@ -0,0 +1,90 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/histogram-aggregation.asciidoc:334
+
+[source, python]
+----
+resp = client.indices.create(
+ index="metrics_index",
+ mappings={
+ "properties": {
+ "network": {
+ "properties": {
+ "name": {
+ "type": "keyword"
+ }
+ }
+ },
+ "latency_histo": {
+ "type": "histogram"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="metrics_index",
+ id="1",
+ refresh=True,
+ document={
+ "network.name": "net-1",
+ "latency_histo": {
+ "values": [
+ 1,
+ 3,
+ 8,
+ 12,
+ 15
+ ],
+ "counts": [
+ 3,
+ 7,
+ 23,
+ 12,
+ 6
+ ]
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="metrics_index",
+ id="2",
+ refresh=True,
+ document={
+ "network.name": "net-2",
+ "latency_histo": {
+ "values": [
+ 1,
+ 6,
+ 8,
+ 12,
+ 14
+ ],
+ "counts": [
+ 8,
+ 17,
+ 8,
+ 7,
+ 6
+ ]
+ }
+ },
+)
+print(resp2)
+
+resp3 = client.search(
+ index="metrics_index",
+ size="0",
+ aggs={
+ "latency_buckets": {
+ "histogram": {
+ "field": "latency_histo",
+ "interval": 5
+ }
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/1eea46b08610972b79fdc4649748455d.asciidoc b/docs/examples/1eea46b08610972b79fdc4649748455d.asciidoc
new file mode 100644
index 000000000..cdf1a1f9d
--- /dev/null
+++ b/docs/examples/1eea46b08610972b79fdc4649748455d.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// vectors/vector-functions.asciidoc:82
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "script_score": {
+ "query": {
+ "bool": {
+ "filter": {
+ "term": {
+ "status": "published"
+ }
+ }
+ }
+ },
+ "script": {
+ "source": "cosineSimilarity(params.query_vector, 'my_dense_vector') + 1.0",
+ "params": {
+ "query_vector": [
+ 4,
+ 3.4,
+ -0.2
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1ef5119db55a6f2b6fc0ab92f36e7f8e.asciidoc b/docs/examples/1ef5119db55a6f2b6fc0ab92f36e7f8e.asciidoc
new file mode 100644
index 000000000..6456d8322
--- /dev/null
+++ b/docs/examples/1ef5119db55a6f2b6fc0ab92f36e7f8e.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:61
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ sort=[
+ {
+ "post_date": {
+ "format": "strict_date_optional_time_nanos"
+ }
+ }
+ ],
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1f00e73c144603e97f6c14ab15fa1913.asciidoc b/docs/examples/1f00e73c144603e97f6c14ab15fa1913.asciidoc
new file mode 100644
index 000000000..624e986a5
--- /dev/null
+++ b/docs/examples/1f00e73c144603e97f6c14ab15fa1913.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:940
+
+[source, python]
+----
+resp = client.indices.create(
+ index="greek_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "greek_stop": {
+ "type": "stop",
+ "stopwords": "_greek_"
+ },
+ "greek_lowercase": {
+ "type": "lowercase",
+ "language": "greek"
+ },
+ "greek_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "παράδειγμα"
+ ]
+ },
+ "greek_stemmer": {
+ "type": "stemmer",
+ "language": "greek"
+ }
+ },
+ "analyzer": {
+ "rebuilt_greek": {
+ "tokenizer": "standard",
+ "filter": [
+ "greek_lowercase",
+ "greek_stop",
+ "greek_keywords",
+ "greek_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1f13c7caef9c2fe0f73fce8795bbc9b0.asciidoc b/docs/examples/1f13c7caef9c2fe0f73fce8795bbc9b0.asciidoc
new file mode 100644
index 000000000..0abbc126a
--- /dev/null
+++ b/docs/examples/1f13c7caef9c2fe0f73fce8795bbc9b0.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/testing.asciidoc:125
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "std_folded": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "asciifolding"
+ ]
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "my_text": {
+ "type": "text",
+ "analyzer": "std_folded"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="std_folded",
+ text="Is this déjà vu?",
+)
+print(resp1)
+
+resp2 = client.indices.analyze(
+ index="my-index-000001",
+ field="my_text",
+ text="Is this déjà vu?",
+)
+print(resp2)
+----
diff --git a/docs/examples/1f3dd84ab11bae09d3f99b1b3536e239.asciidoc b/docs/examples/1f3dd84ab11bae09d3f99b1b3536e239.asciidoc
new file mode 100644
index 000000000..2f5859098
--- /dev/null
+++ b/docs/examples/1f3dd84ab11bae09d3f99b1b3536e239.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/create-snapshot-api.asciidoc:25
+
+[source, python]
+----
+resp = client.snapshot.create(
+ repository="my_repository",
+ snapshot="my_snapshot",
+)
+print(resp)
+----
diff --git a/docs/examples/1f507659757e2844cefced25848540a0.asciidoc b/docs/examples/1f507659757e2844cefced25848540a0.asciidoc
new file mode 100644
index 000000000..3e7dcc1a0
--- /dev/null
+++ b/docs/examples/1f507659757e2844cefced25848540a0.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-distance-query.asciidoc:187
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_distance": {
+ "distance": "12km",
+ "pin.location": [
+ -70,
+ 40
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1f673e1a0de2970dc648618d5425a994.asciidoc b/docs/examples/1f673e1a0de2970dc648618d5425a994.asciidoc
index d9fc26178..6f79d3872 100644
--- a/docs/examples/1f673e1a0de2970dc648618d5425a994.asciidoc
+++ b/docs/examples/1f673e1a0de2970dc648618d5425a994.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:267
[source, python]
@@ -5,10 +6,10 @@
resp = client.indices.refresh()
print(resp)
-resp = client.search(
+resp1 = client.search(
index="my-new-index-000001",
size="0",
filter_path="hits.total",
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/1f6a190fa1aade1fb66680388f184ef9.asciidoc b/docs/examples/1f6a190fa1aade1fb66680388f184ef9.asciidoc
new file mode 100644
index 000000000..130a7178d
--- /dev/null
+++ b/docs/examples/1f6a190fa1aade1fb66680388f184ef9.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// search/validate.asciidoc:266
+
+[source, python]
+----
+resp = client.indices.validate_query(
+ index="my-index-000001",
+ rewrite=True,
+ all_shards=True,
+ query={
+ "match": {
+ "user.id": {
+ "query": "kimchy",
+ "fuzziness": "auto"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1f8a6d2cc57ed8997a52354aca371aac.asciidoc b/docs/examples/1f8a6d2cc57ed8997a52354aca371aac.asciidoc
new file mode 100644
index 000000000..5e237bef8
--- /dev/null
+++ b/docs/examples/1f8a6d2cc57ed8997a52354aca371aac.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/configuring-pki-realm.asciidoc:267
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="direct_pki_only",
+ roles=[
+ "role_for_pki1_direct"
+ ],
+ rules={
+ "all": [
+ {
+ "field": {
+ "realm.name": "pki1"
+ }
+ },
+ {
+ "field": {
+ "metadata.pki_delegated_by_user": None
+ }
+ }
+ ]
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/1f900f7178e80051e75d4fd04467cf49.asciidoc b/docs/examples/1f900f7178e80051e75d4fd04467cf49.asciidoc
new file mode 100644
index 000000000..6da11d076
--- /dev/null
+++ b/docs/examples/1f900f7178e80051e75d4fd04467cf49.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/pipeline.asciidoc:79
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ pipeline="pipelineB",
+ document={
+ "field": "value"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1fcc4a3280be399753dcfd5c489ff682.asciidoc b/docs/examples/1fcc4a3280be399753dcfd5c489ff682.asciidoc
index 395e53f28..2dac63638 100644
--- a/docs/examples/1fcc4a3280be399753dcfd5c489ff682.asciidoc
+++ b/docs/examples/1fcc4a3280be399753dcfd5c489ff682.asciidoc
@@ -1,27 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/range.asciidoc:316
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"my_range": {"type": "ip_range"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "my_range": {
+ "type": "ip_range"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={
+ document={
"my_range": [
"10.0.0.0/24",
- {"gte": "10.0.0.0", "lte": "10.0.0.255"},
+ {
+ "gte": "10.0.0.0",
+ "lte": "10.0.0.255"
+ }
]
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/1fddbd602a6acf896a393cdb500a2831.asciidoc b/docs/examples/1fddbd602a6acf896a393cdb500a2831.asciidoc
new file mode 100644
index 000000000..beb62e38a
--- /dev/null
+++ b/docs/examples/1fddbd602a6acf896a393cdb500a2831.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/rate-aggregation.asciidoc:310
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "by_date": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "avg_number_of_sales_per_year": {
+ "rate": {
+ "field": "price",
+ "unit": "year",
+ "mode": "value_count"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1fe2ed1d65c4774755de44c9b9d6ed67.asciidoc b/docs/examples/1fe2ed1d65c4774755de44c9b9d6ed67.asciidoc
new file mode 100644
index 000000000..b64f785d6
--- /dev/null
+++ b/docs/examples/1fe2ed1d65c4774755de44c9b9d6ed67.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:986
+
+[source, python]
+----
+resp = client.nodes.stats(
+ metric="ingest",
+ filter_path="nodes.*.ingest",
+)
+print(resp)
+----
diff --git a/docs/examples/1ff12523efbd59c213c676937757c460.asciidoc b/docs/examples/1ff12523efbd59c213c676937757c460.asciidoc
new file mode 100644
index 000000000..244ccbbe6
--- /dev/null
+++ b/docs/examples/1ff12523efbd59c213c676937757c460.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-api-keys.asciidoc:110
+
+[source, python]
+----
+resp = client.security.invalidate_api_key(
+ ids=[
+ "VuaCfGcBCdbkQm-e5aOx"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/1ff296e868635fd102239871a331331b.asciidoc b/docs/examples/1ff296e868635fd102239871a331331b.asciidoc
new file mode 100644
index 000000000..b60943c5f
--- /dev/null
+++ b/docs/examples/1ff296e868635fd102239871a331331b.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/cardinality-aggregation.asciidoc:47
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "type_count": {
+ "cardinality": {
+ "field": "type",
+ "precision_threshold": 100
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/1ff9b263b7c3e83278bb6a776a51590a.asciidoc b/docs/examples/1ff9b263b7c3e83278bb6a776a51590a.asciidoc
new file mode 100644
index 000000000..5ab8bb3f3
--- /dev/null
+++ b/docs/examples/1ff9b263b7c3e83278bb6a776a51590a.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/histogram-aggregation.asciidoc:31
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "prices": {
+ "histogram": {
+ "field": "price",
+ "interval": 50
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/20005d8a6555b259b299d862cd218701.asciidoc b/docs/examples/20005d8a6555b259b299d862cd218701.asciidoc
index c8e0098b9..93d00d236 100644
--- a/docs/examples/20005d8a6555b259b299d862cd218701.asciidoc
+++ b/docs/examples/20005d8a6555b259b299d862cd218701.asciidoc
@@ -1,15 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/match-query.asciidoc:186
[source, python]
----
resp = client.search(
- body={
- "query": {
- "match": {
- "message": {"query": "this is a test", "operator": "and"}
+ query={
+ "match": {
+ "message": {
+ "query": "this is a test",
+ "operator": "and"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2006f577a113bda40905cf7b405bf1cf.asciidoc b/docs/examples/2006f577a113bda40905cf7b405bf1cf.asciidoc
new file mode 100644
index 000000000..c2edcddc2
--- /dev/null
+++ b/docs/examples/2006f577a113bda40905cf7b405bf1cf.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:816
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "set": {
+ "description": "If 'url.scheme' is 'http', set 'url.insecure' to true",
+ "if": "ctx.url?.scheme =~ /^http[^s]/",
+ "field": "url.insecure",
+ "value": True
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/2009f2d1ba0780a799a0fdce889c9739.asciidoc b/docs/examples/2009f2d1ba0780a799a0fdce889c9739.asciidoc
new file mode 100644
index 000000000..dc68dd952
--- /dev/null
+++ b/docs/examples/2009f2d1ba0780a799a0fdce889c9739.asciidoc
@@ -0,0 +1,67 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:695
+
+[source, python]
+----
+resp = client.bulk(
+ index="passage_vectors",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "1"
+ }
+ },
+ {
+ "full_text": "first paragraph another paragraph",
+ "creation_time": "2019-05-04",
+ "paragraph": [
+ {
+ "vector": [
+ 0.45,
+ 45
+ ],
+ "text": "first paragraph",
+ "paragraph_id": "1"
+ },
+ {
+ "vector": [
+ 0.8,
+ 0.6
+ ],
+ "text": "another paragraph",
+ "paragraph_id": "2"
+ }
+ ]
+ },
+ {
+ "index": {
+ "_id": "2"
+ }
+ },
+ {
+ "full_text": "number one paragraph number two paragraph",
+ "creation_time": "2020-05-04",
+ "paragraph": [
+ {
+ "vector": [
+ 1.2,
+ 4.5
+ ],
+ "text": "number one paragraph",
+ "paragraph_id": "1"
+ },
+ {
+ "vector": [
+ -1,
+ 42
+ ],
+ "text": "number two paragraph",
+ "paragraph_id": "2"
+ }
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/200f6d4cc7b9c300b8962a119e03873f.asciidoc b/docs/examples/200f6d4cc7b9c300b8962a119e03873f.asciidoc
new file mode 100644
index 000000000..469859101
--- /dev/null
+++ b/docs/examples/200f6d4cc7b9c300b8962a119e03873f.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-data-stream.asciidoc:276
+
+[source, python]
+----
+resp = client.indices.get_data_stream(
+ name="my-data-stream*",
+)
+print(resp)
+----
diff --git a/docs/examples/20162e1dac807a7604f58dad814d1bc5.asciidoc b/docs/examples/20162e1dac807a7604f58dad814d1bc5.asciidoc
new file mode 100644
index 000000000..f1ee6d70c
--- /dev/null
+++ b/docs/examples/20162e1dac807a7604f58dad814d1bc5.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/hunspell-tokenfilter.asciidoc:199
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "en": {
+ "tokenizer": "standard",
+ "filter": [
+ "my_en_US_dict_stemmer"
+ ]
+ }
+ },
+ "filter": {
+ "my_en_US_dict_stemmer": {
+ "type": "hunspell",
+ "locale": "en_US",
+ "dedup": False
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/203c3bb334384bdfb11ff1101ccfba25.asciidoc b/docs/examples/203c3bb334384bdfb11ff1101ccfba25.asciidoc
new file mode 100644
index 000000000..0fa808352
--- /dev/null
+++ b/docs/examples/203c3bb334384bdfb11ff1101ccfba25.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/phrase-suggest.asciidoc:290
+
+[source, python]
+----
+resp = client.search(
+ index="test",
+ suggest={
+ "text": "obel prize",
+ "simple_phrase": {
+ "phrase": {
+ "field": "title.trigram",
+ "size": 1,
+ "smoothing": {
+ "laplace": {
+ "alpha": 0.7
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/20407c847adb8393ce41dc656384afc4.asciidoc b/docs/examples/20407c847adb8393ce41dc656384afc4.asciidoc
new file mode 100644
index 000000000..454a1c06d
--- /dev/null
+++ b/docs/examples/20407c847adb8393ce41dc656384afc4.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:787
+
+[source, python]
+----
+resp = client.search(
+ index="passage_vectors",
+ fields=[
+ "creation_time",
+ "full_text"
+ ],
+ source=False,
+ knn={
+ "query_vector": [
+ 0.45,
+ 45
+ ],
+ "field": "paragraph.vector",
+ "k": 2,
+ "num_candidates": 2,
+ "filter": {
+ "bool": {
+ "filter": [
+ {
+ "range": {
+ "creation_time": {
+ "gte": "2019-05-01",
+ "lte": "2019-05-05"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2051ffe025550ab6645bfd525eaed3c4.asciidoc b/docs/examples/2051ffe025550ab6645bfd525eaed3c4.asciidoc
new file mode 100644
index 000000000..0af7902a4
--- /dev/null
+++ b/docs/examples/2051ffe025550ab6645bfd525eaed3c4.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-bounding-box-query.asciidoc:246
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_bounding_box": {
+ "pin.location": {
+ "top_left": "POINT (-74.1 40.73)",
+ "bottom_right": "POINT (-71.12 40.01)"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2063713516847eef5d1dbf4ca1e877b0.asciidoc b/docs/examples/2063713516847eef5d1dbf4ca1e877b0.asciidoc
new file mode 100644
index 000000000..e16a8a026
--- /dev/null
+++ b/docs/examples/2063713516847eef5d1dbf4ca1e877b0.asciidoc
@@ -0,0 +1,93 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geohexgrid-aggregation.asciidoc:29
+
+[source, python]
+----
+resp = client.indices.create(
+ index="museums",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="museums",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "location": "POINT (4.912350 52.374081)",
+ "name": "NEMO Science Museum"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "location": "POINT (4.901618 52.369219)",
+ "name": "Museum Het Rembrandthuis"
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "location": "POINT (4.914722 52.371667)",
+ "name": "Nederlands Scheepvaartmuseum"
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "location": "POINT (4.405200 51.222900)",
+ "name": "Letterenhuis"
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "location": "POINT (2.336389 48.861111)",
+ "name": "Musée du Louvre"
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "location": "POINT (2.327000 48.860000)",
+ "name": "Musée d'Orsay"
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="museums",
+ size="0",
+ aggregations={
+ "large-grid": {
+ "geohex_grid": {
+ "field": "location",
+ "precision": 4
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/206c723296be8ef8d58aef3ee01f5ba2.asciidoc b/docs/examples/206c723296be8ef8d58aef3ee01f5ba2.asciidoc
new file mode 100644
index 000000000..b06a2a9f7
--- /dev/null
+++ b/docs/examples/206c723296be8ef8d58aef3ee01f5ba2.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline.asciidoc:176
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "day"
+ },
+ "aggs": {
+ "the_deriv": {
+ "derivative": {
+ "buckets_path": "_count"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/206d57bf0cb022c8229894e7753eca83.asciidoc b/docs/examples/206d57bf0cb022c8229894e7753eca83.asciidoc
new file mode 100644
index 000000000..527554f2f
--- /dev/null
+++ b/docs/examples/206d57bf0cb022c8229894e7753eca83.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-shape-query.asciidoc:58
+
+[source, python]
+----
+resp = client.search(
+ index="example",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_shape": {
+ "location": {
+ "shape": {
+ "type": "envelope",
+ "coordinates": [
+ [
+ 13,
+ 53
+ ],
+ [
+ 14,
+ 52
+ ]
+ ]
+ },
+ "relation": "within"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2081739da0c69de8af6f5bf9e94433e6.asciidoc b/docs/examples/2081739da0c69de8af6f5bf9e94433e6.asciidoc
index 10908c87a..ce0ada6f8 100644
--- a/docs/examples/2081739da0c69de8af6f5bf9e94433e6.asciidoc
+++ b/docs/examples/2081739da0c69de8af6f5bf9e94433e6.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:377
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "MULTILINESTRING ((102.0 2.0, 103.0 2.0, 103.0 3.0, 102.0 3.0), (100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0), (100.2 0.2, 100.8 0.2, 100.8 0.8, 100.2 0.8))"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/208c2b41bd1659aae8f02fa3e3b7378a.asciidoc b/docs/examples/208c2b41bd1659aae8f02fa3e3b7378a.asciidoc
new file mode 100644
index 000000000..092ef6e7a
--- /dev/null
+++ b/docs/examples/208c2b41bd1659aae8f02fa3e3b7378a.asciidoc
@@ -0,0 +1,48 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/copy-to.asciidoc:15
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "first_name": {
+ "type": "text",
+ "copy_to": "full_name"
+ },
+ "last_name": {
+ "type": "text",
+ "copy_to": "full_name"
+ },
+ "full_name": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "first_name": "John",
+ "last_name": "Smith"
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "full_name": {
+ "query": "John Smith",
+ "operator": "and"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/209a9190082498f0b7daa26f8834846b.asciidoc b/docs/examples/209a9190082498f0b7daa26f8834846b.asciidoc
new file mode 100644
index 000000000..7ccd317be
--- /dev/null
+++ b/docs/examples/209a9190082498f0b7daa26f8834846b.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/norms.asciidoc:21
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my-index-000001",
+ properties={
+ "title": {
+ "type": "text",
+ "norms": False
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/20bc71cc5bbe04184e27827f3777a406.asciidoc b/docs/examples/20bc71cc5bbe04184e27827f3777a406.asciidoc
index 8a4ab2012..bd5a11971 100644
--- a/docs/examples/20bc71cc5bbe04184e27827f3777a406.asciidoc
+++ b/docs/examples/20bc71cc5bbe04184e27827f3777a406.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:723
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={"fields": ["@timestamp", "day_of_week"], "_source": False},
+ fields=[
+ "@timestamp",
+ "day_of_week"
+ ],
+ source=False,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/20c595907b4afbf26bd60e816a6ddf6a.asciidoc b/docs/examples/20c595907b4afbf26bd60e816a6ddf6a.asciidoc
new file mode 100644
index 000000000..a8b2e845b
--- /dev/null
+++ b/docs/examples/20c595907b4afbf26bd60e816a6ddf6a.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:275
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my_search_application",
+ params={
+ "query_string": "kayaking"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/20e3b181114e00c943a27a9bbcf85f15.asciidoc b/docs/examples/20e3b181114e00c943a27a9bbcf85f15.asciidoc
new file mode 100644
index 000000000..b4083b135
--- /dev/null
+++ b/docs/examples/20e3b181114e00c943a27a9bbcf85f15.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-record.asciidoc:280
+
+[source, python]
+----
+resp = client.ml.get_records(
+ job_id="low_request_rate",
+ sort="record_score",
+ desc=True,
+ start="1454944100000",
+)
+print(resp)
+----
diff --git a/docs/examples/20f62d0540bf6261549bd286416eae28.asciidoc b/docs/examples/20f62d0540bf6261549bd286416eae28.asciidoc
new file mode 100644
index 000000000..0dc048650
--- /dev/null
+++ b/docs/examples/20f62d0540bf6261549bd286416eae28.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/enrich/put-enrich-policy.asciidoc:25
+
+[source, python]
+----
+resp = client.enrich.put_policy(
+ name="my-policy",
+ match={
+ "indices": "users",
+ "match_field": "email",
+ "enrich_fields": [
+ "first_name",
+ "last_name",
+ "city",
+ "zip",
+ "state"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2105f2d1d81977054a93163a175793ce.asciidoc b/docs/examples/2105f2d1d81977054a93163a175793ce.asciidoc
new file mode 100644
index 000000000..3212ee5bf
--- /dev/null
+++ b/docs/examples/2105f2d1d81977054a93163a175793ce.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/get-snapshot-status-api.asciidoc:75
+
+[source, python]
+----
+resp = client.snapshot.status()
+print(resp)
+----
diff --git a/docs/examples/2155c920d7d860f3ee7542f2211b4fec.asciidoc b/docs/examples/2155c920d7d860f3ee7542f2211b4fec.asciidoc
new file mode 100644
index 000000000..d478f5eb2
--- /dev/null
+++ b/docs/examples/2155c920d7d860f3ee7542f2211b4fec.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/text-expansion-query.asciidoc:18
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "text_expansion": {
+ "": {
+ "model_id": "the model to produce the token weights",
+ "model_text": "the query string"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/21565b72da426776e445b1a166f6e104.asciidoc b/docs/examples/21565b72da426776e445b1a166f6e104.asciidoc
new file mode 100644
index 000000000..e0ba9e580
--- /dev/null
+++ b/docs/examples/21565b72da426776e445b1a166f6e104.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/has-child-query.asciidoc:31
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "my-join-field": {
+ "type": "join",
+ "relations": {
+ "parent": "child"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/216848930c2d344fe0bed0daa70c35b9.asciidoc b/docs/examples/216848930c2d344fe0bed0daa70c35b9.asciidoc
index 08373ff3c..681edffbc 100644
--- a/docs/examples/216848930c2d344fe0bed0daa70c35b9.asciidoc
+++ b/docs/examples/216848930c2d344fe0bed0daa70c35b9.asciidoc
@@ -1,10 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:620
[source, python]
----
resp = client.tasks.list(
- detailed="true",
+ detailed=True,
actions="*/delete/byquery",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/216a6573ab4ab023e5dcac4eaa08c3c8.asciidoc b/docs/examples/216a6573ab4ab023e5dcac4eaa08c3c8.asciidoc
new file mode 100644
index 000000000..93232b87e
--- /dev/null
+++ b/docs/examples/216a6573ab4ab023e5dcac4eaa08c3c8.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/register-repository.asciidoc:185
+
+[source, python]
+----
+resp = client.snapshot.verify_repository(
+ name="my_unverified_backup",
+)
+print(resp)
+----
diff --git a/docs/examples/21715c32c140feeab04b38ff6d6de111.asciidoc b/docs/examples/21715c32c140feeab04b38ff6d6de111.asciidoc
new file mode 100644
index 000000000..7a528a672
--- /dev/null
+++ b/docs/examples/21715c32c140feeab04b38ff6d6de111.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:143
+
+[source, python]
+----
+resp = client.indices.get_mapping(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/2185c9dfc62a59313df1702ec1c3513e.asciidoc b/docs/examples/2185c9dfc62a59313df1702ec1c3513e.asciidoc
new file mode 100644
index 000000000..cf5f9f3a5
--- /dev/null
+++ b/docs/examples/2185c9dfc62a59313df1702ec1c3513e.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-aggregation.asciidoc:88
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_outlier": {
+ "percentiles": {
+ "field": "load_time",
+ "percents": [
+ 95,
+ 99,
+ 99.9
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/218b9009f120e8ad33f710e019179562.asciidoc b/docs/examples/218b9009f120e8ad33f710e019179562.asciidoc
new file mode 100644
index 000000000..6a6c45d49
--- /dev/null
+++ b/docs/examples/218b9009f120e8ad33f710e019179562.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/get-repo-api.asciidoc:119
+
+[source, python]
+----
+resp = client.snapshot.get_repository(
+ name="my_repository",
+)
+print(resp)
+----
diff --git a/docs/examples/21a226d91d8edd209f6a821064e83918.asciidoc b/docs/examples/21a226d91d8edd209f6a821064e83918.asciidoc
new file mode 100644
index 000000000..0879cd78c
--- /dev/null
+++ b/docs/examples/21a226d91d8edd209f6a821064e83918.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/global-aggregation.asciidoc:18
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ query={
+ "match": {
+ "type": "t-shirt"
+ }
+ },
+ aggs={
+ "all_products": {
+ "global": {},
+ "aggs": {
+ "avg_price": {
+ "avg": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "t_shirts": {
+ "avg": {
+ "field": "price"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/21bb03ca9123de3237c1c76934f9f172.asciidoc b/docs/examples/21bb03ca9123de3237c1c76934f9f172.asciidoc
new file mode 100644
index 000000000..63319ce38
--- /dev/null
+++ b/docs/examples/21bb03ca9123de3237c1c76934f9f172.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/filters-aggregation.asciidoc:138
+
+[source, python]
+----
+resp = client.index(
+ index="logs",
+ id="4",
+ refresh=True,
+ document={
+ "body": "info: user Bob logged out"
+ },
+)
+print(resp)
+
+resp1 = client.search(
+ index="logs",
+ size=0,
+ aggs={
+ "messages": {
+ "filters": {
+ "other_bucket_key": "other_messages",
+ "filters": {
+ "errors": {
+ "match": {
+ "body": "error"
+ }
+ },
+ "warnings": {
+ "match": {
+ "body": "warning"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/21c1e6ee886140ce0cd67184dd19b981.asciidoc b/docs/examples/21c1e6ee886140ce0cd67184dd19b981.asciidoc
new file mode 100644
index 000000000..96e791f0b
--- /dev/null
+++ b/docs/examples/21c1e6ee886140ce0cd67184dd19b981.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/dangling-indices-list.asciidoc:13
+
+[source, python]
+----
+resp = client.dangling_indices.list_dangling_indices()
+print(resp)
+----
diff --git a/docs/examples/21cd01cb90d3ea1acd0ab22d7edd2c88.asciidoc b/docs/examples/21cd01cb90d3ea1acd0ab22d7edd2c88.asciidoc
new file mode 100644
index 000000000..00a052e0f
--- /dev/null
+++ b/docs/examples/21cd01cb90d3ea1acd0ab22d7edd2c88.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-task.asciidoc:154
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="azure_ai_studio_embeddings",
+ inference_config={
+ "service": "azureaistudio",
+ "service_settings": {
+ "api_key": "",
+ "target": "",
+ "provider": "",
+ "endpoint_type": ""
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/21d0ab6e420bfe7a1639db6af5b2e9c0.asciidoc b/docs/examples/21d0ab6e420bfe7a1639db6af5b2e9c0.asciidoc
new file mode 100644
index 000000000..63cc9e119
--- /dev/null
+++ b/docs/examples/21d0ab6e420bfe7a1639db6af5b2e9c0.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/median-absolute-deviation-aggregation.asciidoc:116
+
+[source, python]
+----
+resp = client.search(
+ index="reviews",
+ filter_path="aggregations",
+ size=0,
+ runtime_mappings={
+ "rating.out_of_ten": {
+ "type": "long",
+ "script": {
+ "source": "emit(doc['rating'].value * params.scaleFactor)",
+ "params": {
+ "scaleFactor": 2
+ }
+ }
+ }
+ },
+ aggs={
+ "review_average": {
+ "avg": {
+ "field": "rating.out_of_ten"
+ }
+ },
+ "review_variability": {
+ "median_absolute_deviation": {
+ "field": "rating.out_of_ten"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/21d5fe55ca32b10b118224ea1a8a2e04.asciidoc b/docs/examples/21d5fe55ca32b10b118224ea1a8a2e04.asciidoc
new file mode 100644
index 000000000..97891263a
--- /dev/null
+++ b/docs/examples/21d5fe55ca32b10b118224ea1a8a2e04.asciidoc
@@ -0,0 +1,81 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/bucket-count-ks-test-aggregation.asciidoc:81
+
+[source, python]
+----
+resp = client.search(
+ index="correlate_latency",
+ size="0",
+ filter_path="aggregations",
+ aggs={
+ "buckets": {
+ "terms": {
+ "field": "version",
+ "size": 2
+ },
+ "aggs": {
+ "latency_ranges": {
+ "range": {
+ "field": "latency",
+ "ranges": [
+ {
+ "to": 0
+ },
+ {
+ "from": 0,
+ "to": 105
+ },
+ {
+ "from": 105,
+ "to": 225
+ },
+ {
+ "from": 225,
+ "to": 445
+ },
+ {
+ "from": 445,
+ "to": 665
+ },
+ {
+ "from": 665,
+ "to": 885
+ },
+ {
+ "from": 885,
+ "to": 1115
+ },
+ {
+ "from": 1115,
+ "to": 1335
+ },
+ {
+ "from": 1335,
+ "to": 1555
+ },
+ {
+ "from": 1555,
+ "to": 1775
+ },
+ {
+ "from": 1775
+ }
+ ]
+ }
+ },
+ "ks_test": {
+ "bucket_count_ks_test": {
+ "buckets_path": "latency_ranges>_count",
+ "alternative": [
+ "less",
+ "greater",
+ "two_sided"
+ ]
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/21e95d29bc37deb5689a654aa323b4ba.asciidoc b/docs/examples/21e95d29bc37deb5689a654aa323b4ba.asciidoc
new file mode 100644
index 000000000..e84cd1457
--- /dev/null
+++ b/docs/examples/21e95d29bc37deb5689a654aa323b4ba.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/configuring-ldap-realm.asciidoc:138
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="admins",
+ roles=[
+ "monitoring",
+ "user"
+ ],
+ rules={
+ "field": {
+ "groups": "cn=admins,dc=example,dc=com"
+ }
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/221e9b14567f950008459af77757750e.asciidoc b/docs/examples/221e9b14567f950008459af77757750e.asciidoc
new file mode 100644
index 000000000..f79e936d4
--- /dev/null
+++ b/docs/examples/221e9b14567f950008459af77757750e.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/example-watches/example-watch-clusterstatus.asciidoc:54
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="cluster_health_watch",
+ trigger={
+ "schedule": {
+ "interval": "10s"
+ }
+ },
+ input={
+ "http": {
+ "request": {
+ "host": "localhost",
+ "port": 9200,
+ "path": "/_cluster/health"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2224143c45dfc83a2d10b98cd4f94bb5.asciidoc b/docs/examples/2224143c45dfc83a2d10b98cd4f94bb5.asciidoc
index 4f2008a2b..131ba3f8f 100644
--- a/docs/examples/2224143c45dfc83a2d10b98cd4f94bb5.asciidoc
+++ b/docs/examples/2224143c45dfc83a2d10b98cd4f94bb5.asciidoc
@@ -1,25 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/nested-query.asciidoc:415
[source, python]
----
resp = client.search(
index="my-index",
- body={
- "query": {
- "bool": {
- "must_not": [
- {
- "nested": {
- "path": "comments",
- "query": {
- "term": {"comments.author": "nik9000"}
- },
+ query={
+ "bool": {
+ "must_not": [
+ {
+ "nested": {
+ "path": "comments",
+ "query": {
+ "term": {
+ "comments.author": "nik9000"
+ }
}
}
- ]
- }
+ }
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/222e49c924ca8bac7b41bc952a39261c.asciidoc b/docs/examples/222e49c924ca8bac7b41bc952a39261c.asciidoc
new file mode 100644
index 000000000..faebb1e6e
--- /dev/null
+++ b/docs/examples/222e49c924ca8bac7b41bc952a39261c.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/semantic-query.asciidoc:55
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ size=3,
+ query={
+ "bool": {
+ "should": [
+ {
+ "match": {
+ "title": {
+ "query": "mountain lake",
+ "boost": 1
+ }
+ }
+ },
+ {
+ "semantic": {
+ "field": "title_semantic",
+ "query": "mountain lake",
+ "boost": 2
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/22334f4b24bb8977d3e1bf2ffdc29d3f.asciidoc b/docs/examples/22334f4b24bb8977d3e1bf2ffdc29d3f.asciidoc
new file mode 100644
index 000000000..496e9e9b5
--- /dev/null
+++ b/docs/examples/22334f4b24bb8977d3e1bf2ffdc29d3f.asciidoc
@@ -0,0 +1,61 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:313
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "nested": {
+ "path": "parent",
+ "query": {
+ "bool": {
+ "must": {
+ "range": {
+ "parent.age": {
+ "gte": 21
+ }
+ }
+ },
+ "filter": {
+ "nested": {
+ "path": "parent.child",
+ "query": {
+ "match": {
+ "parent.child.name": "matt"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ sort=[
+ {
+ "parent.child.age": {
+ "mode": "min",
+ "order": "asc",
+ "nested": {
+ "path": "parent",
+ "filter": {
+ "range": {
+ "parent.age": {
+ "gte": 21
+ }
+ }
+ },
+ "nested": {
+ "path": "parent.child",
+ "filter": {
+ "match": {
+ "parent.child.name": "matt"
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/2238ac4170275f6cfc2af49c3f014cbc.asciidoc b/docs/examples/2238ac4170275f6cfc2af49c3f014cbc.asciidoc
new file mode 100644
index 000000000..1880ca056
--- /dev/null
+++ b/docs/examples/2238ac4170275f6cfc2af49c3f014cbc.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/extendedstats-aggregation.asciidoc:108
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size=0,
+ runtime_mappings={
+ "grade.corrected": {
+ "type": "double",
+ "script": {
+ "source": "emit(Math.min(100, doc['grade'].value * params.correction))",
+ "params": {
+ "correction": 1.2
+ }
+ }
+ }
+ },
+ aggs={
+ "grades_stats": {
+ "extended_stats": {
+ "field": "grade.corrected"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/22619a4111f66e1b7231693b8f8d069a.asciidoc b/docs/examples/22619a4111f66e1b7231693b8f8d069a.asciidoc
new file mode 100644
index 000000000..5c0150eaf
--- /dev/null
+++ b/docs/examples/22619a4111f66e1b7231693b8f8d069a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/managing-watches.asciidoc:30
+
+[source, python]
+----
+resp = client.watcher.query_watches(
+ size=100,
+)
+print(resp)
+----
diff --git a/docs/examples/22882d4eb8b99f44c8e0d3a2c893fc4b.asciidoc b/docs/examples/22882d4eb8b99f44c8e0d3a2c893fc4b.asciidoc
new file mode 100644
index 000000000..a08888aeb
--- /dev/null
+++ b/docs/examples/22882d4eb8b99f44c8e0d3a2c893fc4b.asciidoc
@@ -0,0 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:408
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "my-small": {
+ "type": "keyword",
+ "ignore_above": 2
+ },
+ "my-large": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "my-small": [
+ "ok",
+ "bad"
+ ],
+ "my-large": "ok content"
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ fields=[
+ "my-*"
+ ],
+ source=False,
+)
+print(resp2)
+----
diff --git a/docs/examples/229b83cbcd8efa1b0288a728a2abacb4.asciidoc b/docs/examples/229b83cbcd8efa1b0288a728a2abacb4.asciidoc
index 6f01448f2..7d5b1c6bc 100644
--- a/docs/examples/229b83cbcd8efa1b0288a728a2abacb4.asciidoc
+++ b/docs/examples/229b83cbcd8efa1b0288a728a2abacb4.asciidoc
@@ -1,54 +1,79 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/point.asciidoc:21
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"location": {"type": "point"}}}},
+ mappings={
+ "properties": {
+ "location": {
+ "type": "point"
+ }
+ }
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={
+ document={
"text": "Point as an object using GeoJSON format",
- "location": {"type": "Point", "coordinates": [-71.34, 41.12]},
+ "location": {
+ "type": "Point",
+ "coordinates": [
+ -71.34,
+ 41.12
+ ]
+ }
},
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="my-index-000001",
id="2",
- body={
+ document={
"text": "Point as a WKT POINT primitive",
- "location": "POINT (-71.34 41.12)",
+ "location": "POINT (-71.34 41.12)"
},
)
-print(resp)
+print(resp2)
-resp = client.index(
+resp3 = client.index(
index="my-index-000001",
id="3",
- body={
+ document={
"text": "Point as an object with 'x' and 'y' keys",
- "location": {"x": -71.34, "y": 41.12},
+ "location": {
+ "x": -71.34,
+ "y": 41.12
+ }
},
)
-print(resp)
+print(resp3)
-resp = client.index(
+resp4 = client.index(
index="my-index-000001",
id="4",
- body={"text": "Point as an array", "location": [-71.34, 41.12]},
+ document={
+ "text": "Point as an array",
+ "location": [
+ -71.34,
+ 41.12
+ ]
+ },
)
-print(resp)
+print(resp4)
-resp = client.index(
+resp5 = client.index(
index="my-index-000001",
id="5",
- body={"text": "Point as a string", "location": "-71.34,41.12"},
+ document={
+ "text": "Point as a string",
+ "location": "-71.34,41.12"
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp5)
+----
diff --git a/docs/examples/22cb99d4e6ba3101a2d9f59764a90877.asciidoc b/docs/examples/22cb99d4e6ba3101a2d9f59764a90877.asciidoc
index d255c66f4..82acbb61e 100644
--- a/docs/examples/22cb99d4e6ba3101a2d9f59764a90877.asciidoc
+++ b/docs/examples/22cb99d4e6ba3101a2d9f59764a90877.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:178
[source, python]
----
resp = client.index(
index="example",
- body={"location": "POINT (-77.03653 38.897676)"},
+ document={
+ "location": "POINT (-77.03653 38.897676)"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/22d8e92b4100f8e4f52260ef8d3aa2b2.asciidoc b/docs/examples/22d8e92b4100f8e4f52260ef8d3aa2b2.asciidoc
index ca64d8b50..c8129b11c 100644
--- a/docs/examples/22d8e92b4100f8e4f52260ef8d3aa2b2.asciidoc
+++ b/docs/examples/22d8e92b4100f8e4f52260ef8d3aa2b2.asciidoc
@@ -1,24 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/binary.asciidoc:12
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "name": {"type": "text"},
- "blob": {"type": "binary"},
+ mappings={
+ "properties": {
+ "name": {
+ "type": "text"
+ },
+ "blob": {
+ "type": "binary"
}
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"name": "Some binary blob", "blob": "U29tZSBiaW5hcnkgYmxvYg=="},
+ document={
+ "name": "Some binary blob",
+ "blob": "U29tZSBiaW5hcnkgYmxvYg=="
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/22dd833336fa22c8a8f67bb754ffba9a.asciidoc b/docs/examples/22dd833336fa22c8a8f67bb754ffba9a.asciidoc
new file mode 100644
index 000000000..ca752b66a
--- /dev/null
+++ b/docs/examples/22dd833336fa22c8a8f67bb754ffba9a.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-search.asciidoc:278
+
+[source, python]
+----
+resp = client.search(
+ index="azure-openai-embeddings",
+ knn={
+ "field": "content_embedding",
+ "query_vector_builder": {
+ "text_embedding": {
+ "model_id": "azure_openai_embeddings",
+ "model_text": "Calculate fuel cost"
+ }
+ },
+ "k": 10,
+ "num_candidates": 100
+ },
+ source=[
+ "id",
+ "content"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/22dde5fe7ac5d85d52115641a68b3c55.asciidoc b/docs/examples/22dde5fe7ac5d85d52115641a68b3c55.asciidoc
new file mode 100644
index 000000000..d09d80766
--- /dev/null
+++ b/docs/examples/22dde5fe7ac5d85d52115641a68b3c55.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:196
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "lowercase",
+ {
+ "type": "stop",
+ "stopwords": [
+ "a",
+ "is",
+ "this"
+ ]
+ }
+ ],
+ text="this is a test",
+)
+print(resp)
+----
diff --git a/docs/examples/22ef90a7fb057728d2115f0c6f551819.asciidoc b/docs/examples/22ef90a7fb057728d2115f0c6f551819.asciidoc
new file mode 100644
index 000000000..66fc8ae8a
--- /dev/null
+++ b/docs/examples/22ef90a7fb057728d2115f0c6f551819.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/range-aggregation.asciidoc:250
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ aggs={
+ "price_ranges": {
+ "range": {
+ "field": "price",
+ "ranges": [
+ {
+ "to": 100
+ },
+ {
+ "from": 100,
+ "to": 200
+ },
+ {
+ "from": 200
+ }
+ ]
+ },
+ "aggs": {
+ "price_stats": {
+ "stats": {
+ "field": "price"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/23074748d6c978176df5b04265e88938.asciidoc b/docs/examples/23074748d6c978176df5b04265e88938.asciidoc
new file mode 100644
index 000000000..07220f772
--- /dev/null
+++ b/docs/examples/23074748d6c978176df5b04265e88938.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/increase-cluster-shard-limit.asciidoc:109
+
+[source, python]
+----
+resp = client.indices.get_settings(
+ index="my-index-000001",
+ name="index.routing.allocation.include._tier_preference",
+ flat_settings=True,
+)
+print(resp)
+----
diff --git a/docs/examples/2308c9948cbebd2092eec03b11281005.asciidoc b/docs/examples/2308c9948cbebd2092eec03b11281005.asciidoc
new file mode 100644
index 000000000..fcf86c0ad
--- /dev/null
+++ b/docs/examples/2308c9948cbebd2092eec03b11281005.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/register-fs-repo.asciidoc:93
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_fs_backup",
+ repository={
+ "type": "fs",
+ "settings": {
+ "location": "E:\\Mount\\Backups\\My_fs_backup_location"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2310d84ebf113f2a3ed14cc53172ae4a.asciidoc b/docs/examples/2310d84ebf113f2a3ed14cc53172ae4a.asciidoc
new file mode 100644
index 000000000..79f87f9cc
--- /dev/null
+++ b/docs/examples/2310d84ebf113f2a3ed14cc53172ae4a.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/text-expansion-query.asciidoc:93
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "text_expansion": {
+ "ml.tokens": {
+ "model_id": ".elser_model_2",
+ "model_text": "How is the weather in Jamaica?"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2342a56279106ea643026df657bf7f88.asciidoc b/docs/examples/2342a56279106ea643026df657bf7f88.asciidoc
index 79ec731bb..ac00ed482 100644
--- a/docs/examples/2342a56279106ea643026df657bf7f88.asciidoc
+++ b/docs/examples/2342a56279106ea643026df657bf7f88.asciidoc
@@ -1,24 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/similarity.asciidoc:22
[source, python]
----
resp = client.indices.create(
index="index",
- body={
- "settings": {
- "index": {
- "similarity": {
- "my_similarity": {
- "type": "DFR",
- "basic_model": "g",
- "after_effect": "l",
- "normalization": "h2",
- "normalization.h2.c": "3.0",
- }
+ settings={
+ "index": {
+ "similarity": {
+ "my_similarity": {
+ "type": "DFR",
+ "basic_model": "g",
+ "after_effect": "l",
+ "normalization": "h2",
+ "normalization.h2.c": "3.0"
}
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/234cec3ead32d7ed71afbe1edfea23df.asciidoc b/docs/examples/234cec3ead32d7ed71afbe1edfea23df.asciidoc
new file mode 100644
index 000000000..c83095e97
--- /dev/null
+++ b/docs/examples/234cec3ead32d7ed71afbe1edfea23df.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/has-parent-query.asciidoc:122
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "has_parent": {
+ "parent_type": "parent",
+ "score": True,
+ "query": {
+ "function_score": {
+ "script_score": {
+ "script": "_score * doc['view_count'].value"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/236f50d89a07b83119af72e367e685da.asciidoc b/docs/examples/236f50d89a07b83119af72e367e685da.asciidoc
new file mode 100644
index 000000000..1dfbc76f4
--- /dev/null
+++ b/docs/examples/236f50d89a07b83119af72e367e685da.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-rollover.asciidoc:298
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_primary_shard_size": "50gb",
+ "max_age": "30d",
+ "min_primary_shard_size": "1gb"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/239f615e0009c5cb1dc4e82ec4c0dab5.asciidoc b/docs/examples/239f615e0009c5cb1dc4e82ec4c0dab5.asciidoc
new file mode 100644
index 000000000..f6fe2cab1
--- /dev/null
+++ b/docs/examples/239f615e0009c5cb1dc4e82ec4c0dab5.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/example-watches/example-watch-clusterstatus.asciidoc:76
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="cluster_health_watch",
+ trigger={
+ "schedule": {
+ "interval": "10s"
+ }
+ },
+ input={
+ "http": {
+ "request": {
+ "host": "localhost",
+ "port": 9200,
+ "path": "/_cluster/health",
+ "auth": {
+ "basic": {
+ "username": "elastic",
+ "password": "x-pack-test-password"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/23af230e824f48b9cd56a4cf973d788c.asciidoc b/docs/examples/23af230e824f48b9cd56a4cf973d788c.asciidoc
index 3ee3eb21a..167bf7db0 100644
--- a/docs/examples/23af230e824f48b9cd56a4cf973d788c.asciidoc
+++ b/docs/examples/23af230e824f48b9cd56a4cf973d788c.asciidoc
@@ -1,10 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/slowlog.asciidoc:31
[source, python]
----
resp = client.indices.put_settings(
index="my-index-000001",
- body={
+ settings={
"index.search.slowlog.threshold.query.warn": "10s",
"index.search.slowlog.threshold.query.info": "5s",
"index.search.slowlog.threshold.query.debug": "2s",
@@ -12,8 +13,8 @@ resp = client.indices.put_settings(
"index.search.slowlog.threshold.fetch.warn": "1s",
"index.search.slowlog.threshold.fetch.info": "800ms",
"index.search.slowlog.threshold.fetch.debug": "500ms",
- "index.search.slowlog.threshold.fetch.trace": "200ms",
+ "index.search.slowlog.threshold.fetch.trace": "200ms"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/23b062c157235246d7c347b9047b2435.asciidoc b/docs/examples/23b062c157235246d7c347b9047b2435.asciidoc
new file mode 100644
index 000000000..1277fbb7a
--- /dev/null
+++ b/docs/examples/23b062c157235246d7c347b9047b2435.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-role-mappings.asciidoc:113
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="mapping1",
+ roles=[
+ "user"
+ ],
+ enabled=True,
+ rules={
+ "field": {
+ "username": "*"
+ }
+ },
+ metadata={
+ "version": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/23c4ae62f7035f2796e0ac3c7c4c20a9.asciidoc b/docs/examples/23c4ae62f7035f2796e0ac3c7c4c20a9.asciidoc
new file mode 100644
index 000000000..3125fbdea
--- /dev/null
+++ b/docs/examples/23c4ae62f7035f2796e0ac3c7c4c20a9.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-migrate.asciidoc:57
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "warm": {
+ "actions": {
+ "migrate": {},
+ "allocate": {
+ "number_of_replicas": 1
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2408020186af569a76a30eccadaed0d5.asciidoc b/docs/examples/2408020186af569a76a30eccadaed0d5.asciidoc
new file mode 100644
index 000000000..dd3848ebe
--- /dev/null
+++ b/docs/examples/2408020186af569a76a30eccadaed0d5.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/script.asciidoc:48
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "processors": [
+ {
+ "script": {
+ "description": "Extract 'tags' from 'env' field",
+ "lang": "painless",
+ "source": "\n String[] envSplit = ctx['env'].splitOnToken(params['delimiter']);\n ArrayList tags = new ArrayList();\n tags.add(envSplit[params['position']].trim());\n ctx['tags'] = tags;\n ",
+ "params": {
+ "delimiter": "-",
+ "position": 1
+ }
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_source": {
+ "env": "es01-prod"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/24275847128b68da6e14233aa1259fb9.asciidoc b/docs/examples/24275847128b68da6e14233aa1259fb9.asciidoc
new file mode 100644
index 000000000..d886bc5a0
--- /dev/null
+++ b/docs/examples/24275847128b68da6e14233aa1259fb9.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/collapse-search-results.asciidoc:93
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "message": "GET /search"
+ }
+ },
+ collapse={
+ "field": "user.id",
+ "inner_hits": [
+ {
+ "name": "largest_responses",
+ "size": 3,
+ "sort": [
+ {
+ "http.response.bytes": {
+ "order": "desc"
+ }
+ }
+ ]
+ },
+ {
+ "name": "most_recent",
+ "size": 3,
+ "sort": [
+ {
+ "@timestamp": {
+ "order": "desc"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ sort=[
+ "http.response.bytes"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/242a26ced0e5706e48dcda19a4003094.asciidoc b/docs/examples/242a26ced0e5706e48dcda19a4003094.asciidoc
index 36be186f9..e6459126a 100644
--- a/docs/examples/242a26ced0e5706e48dcda19a4003094.asciidoc
+++ b/docs/examples/242a26ced0e5706e48dcda19a4003094.asciidoc
@@ -1,20 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:964
[source, python]
----
resp = client.reindex(
- body={
- "source": {
- "remote": {
- "host": "http://otherhost:9200",
- "username": "user",
- "password": "pass",
- },
- "index": "my-index-000001",
- "query": {"match": {"test": "data"}},
+ source={
+ "remote": {
+ "host": "http://otherhost:9200",
+ "username": "user",
+ "password": "pass"
},
- "dest": {"index": "my-new-index-000001"},
+ "index": "my-index-000001",
+ "query": {
+ "match": {
+ "test": "data"
+ }
+ }
+ },
+ dest={
+ "index": "my-new-index-000001"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2493c25e1ef944bc4de0f726470bcdec.asciidoc b/docs/examples/2493c25e1ef944bc4de0f726470bcdec.asciidoc
new file mode 100644
index 000000000..539cb5686
--- /dev/null
+++ b/docs/examples/2493c25e1ef944bc4de0f726470bcdec.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/frequent-item-sets-aggregation.asciidoc:144
+
+[source, python]
+----
+resp = client.async_search.submit(
+ index="kibana_sample_data_ecommerce",
+ size=0,
+ aggs={
+ "my_agg": {
+ "frequent_item_sets": {
+ "minimum_set_size": 3,
+ "fields": [
+ {
+ "field": "category.keyword"
+ },
+ {
+ "field": "geoip.city_name",
+ "exclude": "other"
+ }
+ ],
+ "size": 3
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/249bf48252c8cea47ef872541c8a884c.asciidoc b/docs/examples/249bf48252c8cea47ef872541c8a884c.asciidoc
new file mode 100644
index 000000000..af3cafb7b
--- /dev/null
+++ b/docs/examples/249bf48252c8cea47ef872541c8a884c.asciidoc
@@ -0,0 +1,59 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/grant-api-keys.asciidoc:127
+
+[source, python]
+----
+resp = client.security.grant_api_key(
+ grant_type="password",
+ username="test_admin",
+ password="x-pack-test-password",
+ api_key={
+ "name": "my-api-key",
+ "expiration": "1d",
+ "role_descriptors": {
+ "role-a": {
+ "cluster": [
+ "all"
+ ],
+ "indices": [
+ {
+ "names": [
+ "index-a*"
+ ],
+ "privileges": [
+ "read"
+ ]
+ }
+ ]
+ },
+ "role-b": {
+ "cluster": [
+ "all"
+ ],
+ "indices": [
+ {
+ "names": [
+ "index-b*"
+ ],
+ "privileges": [
+ "all"
+ ]
+ }
+ ]
+ }
+ },
+ "metadata": {
+ "application": "my-application",
+ "environment": {
+ "level": 1,
+ "trusted": True,
+ "tags": [
+ "dev",
+ "staging"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/24ad3c234f69f55a3fbe2d488e70178a.asciidoc b/docs/examples/24ad3c234f69f55a3fbe2d488e70178a.asciidoc
new file mode 100644
index 000000000..db644f6b7
--- /dev/null
+++ b/docs/examples/24ad3c234f69f55a3fbe2d488e70178a.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/evaluate-dfanalytics.asciidoc:354
+
+[source, python]
+----
+resp = client.ml.evaluate_data_frame(
+ index="student_performance_mathematics_reg",
+ query={
+ "term": {
+ "ml.is_training": {
+ "value": True
+ }
+ }
+ },
+ evaluation={
+ "regression": {
+ "actual_field": "G3",
+ "predicted_field": "ml.G3_prediction",
+ "metrics": {
+ "r_squared": {},
+ "mse": {},
+ "msle": {},
+ "huber": {}
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/24aee6033bf77a68ced74e3fd9d34283.asciidoc b/docs/examples/24aee6033bf77a68ced74e3fd9d34283.asciidoc
new file mode 100644
index 000000000..7c1bba413
--- /dev/null
+++ b/docs/examples/24aee6033bf77a68ced74e3fd9d34283.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-index-template-v1.asciidoc:79
+
+[source, python]
+----
+resp = client.indices.get_template(
+ name="template_1,template_2",
+)
+print(resp)
+----
diff --git a/docs/examples/24bdccb07bba7e7e6ff45d3d4cd83064.asciidoc b/docs/examples/24bdccb07bba7e7e6ff45d3d4cd83064.asciidoc
new file mode 100644
index 000000000..d7df6e88d
--- /dev/null
+++ b/docs/examples/24bdccb07bba7e7e6ff45d3d4cd83064.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:250
+
+[source, python]
+----
+resp = client.update_by_query(
+ index="my-data-stream",
+ pipeline="my-pipeline",
+)
+print(resp)
+
+resp1 = client.reindex(
+ source={
+ "index": "my-data-stream"
+ },
+ dest={
+ "index": "my-new-data-stream",
+ "op_type": "create",
+ "pipeline": "my-pipeline"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/24d66b2ebdf662d8b03e17214e65c825.asciidoc b/docs/examples/24d66b2ebdf662d8b03e17214e65c825.asciidoc
new file mode 100644
index 000000000..9a9775ffc
--- /dev/null
+++ b/docs/examples/24d66b2ebdf662d8b03e17214e65c825.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:375
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "xpack.profiling.templates.enabled": False
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/24d806d1803158dacd4dda73c4204d3e.asciidoc b/docs/examples/24d806d1803158dacd4dda73c4204d3e.asciidoc
new file mode 100644
index 000000000..bdff603a7
--- /dev/null
+++ b/docs/examples/24d806d1803158dacd4dda73c4204d3e.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// query-rules/apis/get-query-rule.asciidoc:105
+
+[source, python]
+----
+resp = client.query_rules.get_rule(
+ ruleset_id="my-ruleset",
+ rule_id="my-rule1",
+)
+print(resp)
+----
diff --git a/docs/examples/24f4dfdf9922d5aa79151675b7767742.asciidoc b/docs/examples/24f4dfdf9922d5aa79151675b7767742.asciidoc
new file mode 100644
index 000000000..b10bdf250
--- /dev/null
+++ b/docs/examples/24f4dfdf9922d5aa79151675b7767742.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:383
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ scroll="1m",
+ size=100,
+ query={
+ "match": {
+ "message": "foo"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/253140cb1e270e5ee23e15dbaeaaa0ea.asciidoc b/docs/examples/253140cb1e270e5ee23e15dbaeaaa0ea.asciidoc
new file mode 100644
index 000000000..e478ca2fc
--- /dev/null
+++ b/docs/examples/253140cb1e270e5ee23e15dbaeaaa0ea.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:29
+
+[source, python]
+----
+resp = client.indices.data_streams_stats(
+ human=True,
+)
+print(resp)
+----
diff --git a/docs/examples/25576b6773322f0929d4c635a940dba0.asciidoc b/docs/examples/25576b6773322f0929d4c635a940dba0.asciidoc
index 43543fedf..56e0c8101 100644
--- a/docs/examples/25576b6773322f0929d4c635a940dba0.asciidoc
+++ b/docs/examples/25576b6773322f0929d4c635a940dba0.asciidoc
@@ -1,18 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:530
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {
- "fields": ["title", "content"],
- "query": "this OR that OR thus",
- "type": "cross_fields",
- "minimum_should_match": 2,
- }
+ query={
+ "query_string": {
+ "fields": [
+ "title",
+ "content"
+ ],
+ "query": "this OR that OR thus",
+ "type": "cross_fields",
+ "minimum_should_match": 2
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/256eba7a77c8890a43afeda8ce8a3225.asciidoc b/docs/examples/256eba7a77c8890a43afeda8ce8a3225.asciidoc
new file mode 100644
index 000000000..25e6098cc
--- /dev/null
+++ b/docs/examples/256eba7a77c8890a43afeda8ce8a3225.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/semantic-search/generate-embeddings.asciidoc:54
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-text-embeddings-pipeline",
+ description="Text embedding pipeline",
+ processors=[
+ {
+ "inference": {
+ "model_id": "sentence-transformers__msmarco-minilm-l-12-v3",
+ "target_field": "my_embeddings",
+ "field_map": {
+ "my_text_field": "text_field"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/25737fd456fd317cc4cc2db76b6cf28e.asciidoc b/docs/examples/25737fd456fd317cc4cc2db76b6cf28e.asciidoc
new file mode 100644
index 000000000..660b2830f
--- /dev/null
+++ b/docs/examples/25737fd456fd317cc4cc2db76b6cf28e.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/set-up-lifecycle-policy.asciidoc:150
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test-000001",
+ aliases={
+ "test-alias": {
+ "is_write_index": True
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2592e5361f7ea3b3dd1840f63d760dae.asciidoc b/docs/examples/2592e5361f7ea3b3dd1840f63d760dae.asciidoc
new file mode 100644
index 000000000..9ff389ad6
--- /dev/null
+++ b/docs/examples/2592e5361f7ea3b3dd1840f63d760dae.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/mlt-query.asciidoc:67
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "more_like_this": {
+ "fields": [
+ "name.first",
+ "name.last"
+ ],
+ "like": [
+ {
+ "_index": "marvel",
+ "doc": {
+ "name": {
+ "first": "Ben",
+ "last": "Grimm"
+ },
+ "_doc": "You got no idea what I'd... what I'd give to be invisible."
+ }
+ },
+ {
+ "_index": "marvel",
+ "_id": "2"
+ }
+ ],
+ "min_term_freq": 1,
+ "max_query_terms": 12
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/25981b7b3d55b87e1484586d57b695b1.asciidoc b/docs/examples/25981b7b3d55b87e1484586d57b695b1.asciidoc
new file mode 100644
index 000000000..2f911b6a3
--- /dev/null
+++ b/docs/examples/25981b7b3d55b87e1484586d57b695b1.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/concurrency-control.asciidoc:24
+
+[source, python]
+----
+resp = client.index(
+ index="products",
+ id="1567",
+ document={
+ "product": "r2d2",
+ "details": "A resourceful astromech droid"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/25a0dad6547d432f5a3d394528f1c138.asciidoc b/docs/examples/25a0dad6547d432f5a3d394528f1c138.asciidoc
index ec0b7d4be..7b429b7bd 100644
--- a/docs/examples/25a0dad6547d432f5a3d394528f1c138.asciidoc
+++ b/docs/examples/25a0dad6547d432f5a3d394528f1c138.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:395
[source, python]
@@ -6,7 +7,7 @@ resp = client.get(
index="my-index-000001",
id="2",
routing="user1",
- stored_fields=["tags", "counter"],
+ stored_fields="tags,counter",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/25ae1a698f867ba5139605cc952436c0.asciidoc b/docs/examples/25ae1a698f867ba5139605cc952436c0.asciidoc
new file mode 100644
index 000000000..05db6cead
--- /dev/null
+++ b/docs/examples/25ae1a698f867ba5139605cc952436c0.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/context-suggest.asciidoc:168
+
+[source, python]
+----
+resp = client.search(
+ index="place",
+ pretty=True,
+ suggest={
+ "place_suggestion": {
+ "prefix": "tim",
+ "completion": {
+ "field": "suggest",
+ "size": 10,
+ "contexts": {
+ "place_type": [
+ {
+ "context": "cafe"
+ },
+ {
+ "context": "restaurants",
+ "boost": 2
+ }
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/25c0e66a433a0cd596e0641b752ff6d7.asciidoc b/docs/examples/25c0e66a433a0cd596e0641b752ff6d7.asciidoc
new file mode 100644
index 000000000..8f0653e9e
--- /dev/null
+++ b/docs/examples/25c0e66a433a0cd596e0641b752ff6d7.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/shards.asciidoc:405
+
+[source, python]
+----
+resp = client.cat.shards(
+ h="index,shard,prirep,state,unassigned.reason",
+)
+print(resp)
+----
diff --git a/docs/examples/25cb9e1da00dfd971065ce182467434d.asciidoc b/docs/examples/25cb9e1da00dfd971065ce182467434d.asciidoc
new file mode 100644
index 000000000..4a396c3df
--- /dev/null
+++ b/docs/examples/25cb9e1da00dfd971065ce182467434d.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/voting-exclusions.asciidoc:112
+
+[source, python]
+----
+resp = client.cluster.delete_voting_config_exclusions()
+print(resp)
+----
diff --git a/docs/examples/25d40d3049e57e2bb70c2c5b88bd7b87.asciidoc b/docs/examples/25d40d3049e57e2bb70c2c5b88bd7b87.asciidoc
index 8b60d5465..1cf81345e 100644
--- a/docs/examples/25d40d3049e57e2bb70c2c5b88bd7b87.asciidoc
+++ b/docs/examples/25d40d3049e57e2bb70c2c5b88bd7b87.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/allocation/delayed.asciidoc:95
[source, python]
----
resp = client.indices.put_settings(
index="_all",
- body={"settings": {"index.unassigned.node_left.delayed_timeout": "0"}},
+ settings={
+ "settings": {
+ "index.unassigned.node_left.delayed_timeout": "0"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/25ecfe423548ac1d7cc86de4a18c48c6.asciidoc b/docs/examples/25ecfe423548ac1d7cc86de4a18c48c6.asciidoc
new file mode 100644
index 000000000..70e035163
--- /dev/null
+++ b/docs/examples/25ecfe423548ac1d7cc86de4a18c48c6.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/charfilters/pattern-replace-charfilter.asciidoc:54
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "char_filter": [
+ "my_char_filter"
+ ]
+ }
+ },
+ "char_filter": {
+ "my_char_filter": {
+ "type": "pattern_replace",
+ "pattern": "(\\d+)-(?=\\d)",
+ "replacement": "$1_"
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="My credit card is 123-456-789",
+)
+print(resp1)
+----
diff --git a/docs/examples/25ed47fcb890fcf8d8518ae067362d18.asciidoc b/docs/examples/25ed47fcb890fcf8d8518ae067362d18.asciidoc
new file mode 100644
index 000000000..edee84f07
--- /dev/null
+++ b/docs/examples/25ed47fcb890fcf8d8518ae067362d18.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/median-absolute-deviation-aggregation.asciidoc:31
+
+[source, python]
+----
+resp = client.search(
+ index="reviews",
+ size=0,
+ aggs={
+ "review_average": {
+ "avg": {
+ "field": "rating"
+ }
+ },
+ "review_variability": {
+ "median_absolute_deviation": {
+ "field": "rating"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/261480571394632db40e88fbb6c59c2f.asciidoc b/docs/examples/261480571394632db40e88fbb6c59c2f.asciidoc
new file mode 100644
index 000000000..73966f9df
--- /dev/null
+++ b/docs/examples/261480571394632db40e88fbb6c59c2f.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/delete-role-mappings.asciidoc:46
+
+[source, python]
+----
+resp = client.security.delete_role_mapping(
+ name="mapping1",
+)
+print(resp)
+----
diff --git a/docs/examples/26168987f799cdc4ee4151c85ba7afc5.asciidoc b/docs/examples/26168987f799cdc4ee4151c85ba7afc5.asciidoc
new file mode 100644
index 000000000..8cc2eb820
--- /dev/null
+++ b/docs/examples/26168987f799cdc4ee4151c85ba7afc5.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:213
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ filter_path="aggregations",
+ aggs={
+ "my-num-field-stats": {
+ "stats": {
+ "field": "my-num-field"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/262196e4323dfc1f8e6daf77d7ba3b6a.asciidoc b/docs/examples/262196e4323dfc1f8e6daf77d7ba3b6a.asciidoc
new file mode 100644
index 000000000..af5a4b42f
--- /dev/null
+++ b/docs/examples/262196e4323dfc1f8e6daf77d7ba3b6a.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/repository-gcs.asciidoc:217
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_gcs_repository",
+ repository={
+ "type": "gcs",
+ "settings": {
+ "bucket": "my_other_bucket",
+ "base_path": "dev"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2623eb122cc0299b42fc9eca6e7f5e56.asciidoc b/docs/examples/2623eb122cc0299b42fc9eca6e7f5e56.asciidoc
new file mode 100644
index 000000000..cfd59dc5d
--- /dev/null
+++ b/docs/examples/2623eb122cc0299b42fc9eca6e7f5e56.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-builtin-privileges.asciidoc:58
+
+[source, python]
+----
+resp = client.security.get_builtin_privileges()
+print(resp)
+----
diff --git a/docs/examples/262a778d754add491fbc9c721ac25bf0.asciidoc b/docs/examples/262a778d754add491fbc9c721ac25bf0.asciidoc
new file mode 100644
index 000000000..dbe0fc312
--- /dev/null
+++ b/docs/examples/262a778d754add491fbc9c721ac25bf0.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/whitespace-analyzer.asciidoc:14
+
+[source, python]
+----
+resp = client.indices.analyze(
+ analyzer="whitespace",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/26419320085434680142567d5fda9c35.asciidoc b/docs/examples/26419320085434680142567d5fda9c35.asciidoc
new file mode 100644
index 000000000..41c14c08f
--- /dev/null
+++ b/docs/examples/26419320085434680142567d5fda9c35.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/ipprefix-aggregation.asciidoc:340
+
+[source, python]
+----
+resp = client.search(
+ index="network-traffic",
+ size=0,
+ aggs={
+ "ipv4-subnets": {
+ "ip_prefix": {
+ "field": "ipv4",
+ "prefix_length": 24,
+ "min_doc_count": 3
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2643b8c512cb3f3449259cdf498c6ab5.asciidoc b/docs/examples/2643b8c512cb3f3449259cdf498c6ab5.asciidoc
new file mode 100644
index 000000000..8fd9c461e
--- /dev/null
+++ b/docs/examples/2643b8c512cb3f3449259cdf498c6ab5.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:525
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "date": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "1d"
+ }
+ }
+ },
+ {
+ "product": {
+ "terms": {
+ "field": "product"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2646710ece0c4c843aebeacd370d0396.asciidoc b/docs/examples/2646710ece0c4c843aebeacd370d0396.asciidoc
index b6abe3c8d..41168da02 100644
--- a/docs/examples/2646710ece0c4c843aebeacd370d0396.asciidoc
+++ b/docs/examples/2646710ece0c4c843aebeacd370d0396.asciidoc
@@ -1,21 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/dense-vector.asciidoc:137
[source, python]
----
resp = client.indices.create(
index="my-byte-quantized-index",
- body={
- "mappings": {
- "properties": {
- "my_vector": {
- "type": "dense_vector",
- "dims": 3,
- "index": True,
- "index_options": {"type": "int8_hnsw"},
+ mappings={
+ "properties": {
+ "my_vector": {
+ "type": "dense_vector",
+ "dims": 3,
+ "index": True,
+ "index_options": {
+ "type": "int8_hnsw"
}
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/268151ed1f0e12586e66e614b61d7981.asciidoc b/docs/examples/268151ed1f0e12586e66e614b61d7981.asciidoc
new file mode 100644
index 000000000..4bad2f2b0
--- /dev/null
+++ b/docs/examples/268151ed1f0e12586e66e614b61d7981.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-polygon-query.asciidoc:122
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_polygon": {
+ "person.location": {
+ "points": [
+ "drn5x1g8cu2y",
+ "30, -80",
+ "20, -90"
+ ]
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/26abfc49c238c2b5d259983ac38dbcee.asciidoc b/docs/examples/26abfc49c238c2b5d259983ac38dbcee.asciidoc
new file mode 100644
index 000000000..371ab5d65
--- /dev/null
+++ b/docs/examples/26abfc49c238c2b5d259983ac38dbcee.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/recipes/stemming.asciidoc:173
+
+[source, python]
+----
+resp = client.search(
+ index="index",
+ query={
+ "simple_query_string": {
+ "fields": [
+ "body"
+ ],
+ "quote_field_suffix": ".exact",
+ "query": "\"ski\""
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/26bd8c027c82cd72c007c10fa66dc97f.asciidoc b/docs/examples/26bd8c027c82cd72c007c10fa66dc97f.asciidoc
new file mode 100644
index 000000000..43fdcee03
--- /dev/null
+++ b/docs/examples/26bd8c027c82cd72c007c10fa66dc97f.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:438
+
+[source, python]
+----
+resp = client.snapshot.restore(
+ repository="my_repository",
+ snapshot="my_snapshot_2099.05.06",
+ indices="*",
+ include_global_state=True,
+)
+print(resp)
+----
diff --git a/docs/examples/26d3ab748a855eb383e992eb1ff79662.asciidoc b/docs/examples/26d3ab748a855eb383e992eb1ff79662.asciidoc
new file mode 100644
index 000000000..9dba23b31
--- /dev/null
+++ b/docs/examples/26d3ab748a855eb383e992eb1ff79662.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/delete-async-eql-search-api.asciidoc:14
+
+[source, python]
+----
+resp = client.eql.delete(
+ id="FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
+)
+print(resp)
+----
diff --git a/docs/examples/26f237f9bf14e8b972cc33ff6aebefa2.asciidoc b/docs/examples/26f237f9bf14e8b972cc33ff6aebefa2.asciidoc
new file mode 100644
index 000000000..349d2c1d6
--- /dev/null
+++ b/docs/examples/26f237f9bf14e8b972cc33ff6aebefa2.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keyword-marker-tokenfilter.asciidoc:35
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "stemmer"
+ ],
+ text="fox running and jumping",
+)
+print(resp)
+----
diff --git a/docs/examples/270549e6b062228312c4e7a54a2c2209.asciidoc b/docs/examples/270549e6b062228312c4e7a54a2c2209.asciidoc
new file mode 100644
index 000000000..3fdc374f1
--- /dev/null
+++ b/docs/examples/270549e6b062228312c4e7a54a2c2209.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/task-queue-backlog.asciidoc:34
+
+[source, python]
+----
+resp = client.nodes.hot_threads()
+print(resp)
+----
diff --git a/docs/examples/2716453454dbf9c6dde2ea6850a62214.asciidoc b/docs/examples/2716453454dbf9c6dde2ea6850a62214.asciidoc
index 584040f0c..871dfed8e 100644
--- a/docs/examples/2716453454dbf9c6dde2ea6850a62214.asciidoc
+++ b/docs/examples/2716453454dbf9c6dde2ea6850a62214.asciidoc
@@ -1,26 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/alias.asciidoc:12
[source, python]
----
resp = client.indices.create(
index="trips",
- body={
- "mappings": {
- "properties": {
- "distance": {"type": "long"},
- "route_length_miles": {
- "type": "alias",
- "path": "distance",
- },
- "transit_mode": {"type": "keyword"},
+ mappings={
+ "properties": {
+ "distance": {
+ "type": "long"
+ },
+ "route_length_miles": {
+ "type": "alias",
+ "path": "distance"
+ },
+ "transit_mode": {
+ "type": "keyword"
}
}
},
)
print(resp)
-resp = client.search(
- body={"query": {"range": {"route_length_miles": {"gte": 39}}}},
+resp1 = client.search(
+ query={
+ "range": {
+ "route_length_miles": {
+ "gte": 39
+ }
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/271fe0b452b62189505ce4a1d6f8bde1.asciidoc b/docs/examples/271fe0b452b62189505ce4a1d6f8bde1.asciidoc
new file mode 100644
index 000000000..64cfa6b31
--- /dev/null
+++ b/docs/examples/271fe0b452b62189505ce4a1d6f8bde1.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-aggregation.asciidoc:110
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_outlier": {
+ "percentiles": {
+ "field": "load_time",
+ "keyed": False
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2720e613d520ce352b62e990c2d283f7.asciidoc b/docs/examples/2720e613d520ce352b62e990c2d283f7.asciidoc
new file mode 100644
index 000000000..36e3e207f
--- /dev/null
+++ b/docs/examples/2720e613d520ce352b62e990c2d283f7.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/apis/remove-policy-from-index.asciidoc:87
+
+[source, python]
+----
+resp = client.ilm.remove_policy(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/2731a8577ad734a732d784c5dcb1225d.asciidoc b/docs/examples/2731a8577ad734a732d784c5dcb1225d.asciidoc
new file mode 100644
index 000000000..86346a982
--- /dev/null
+++ b/docs/examples/2731a8577ad734a732d784c5dcb1225d.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1359
+
+[source, python]
+----
+resp = client.indices.create(
+ index="norwegian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "norwegian_stop": {
+ "type": "stop",
+ "stopwords": "_norwegian_"
+ },
+ "norwegian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "eksempel"
+ ]
+ },
+ "norwegian_stemmer": {
+ "type": "stemmer",
+ "language": "norwegian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_norwegian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "norwegian_stop",
+ "norwegian_keywords",
+ "norwegian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/27384266370152add76471dd0332a2f1.asciidoc b/docs/examples/27384266370152add76471dd0332a2f1.asciidoc
new file mode 100644
index 000000000..534dfb41d
--- /dev/null
+++ b/docs/examples/27384266370152add76471dd0332a2f1.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/update-transform.asciidoc:257
+
+[source, python]
+----
+resp = client.transform.update_transform(
+ transform_id="simple-kibana-ecomm-pivot",
+ source={
+ "index": "kibana_sample_data_ecommerce",
+ "query": {
+ "term": {
+ "geoip.continent_name": {
+ "value": "Asia"
+ }
+ }
+ }
+ },
+ description="Maximum priced ecommerce data by customer_id in Asia",
+ dest={
+ "index": "kibana_sample_data_ecommerce_transform_v2",
+ "pipeline": "add_timestamp_pipeline"
+ },
+ frequency="15m",
+ sync={
+ "time": {
+ "field": "order_date",
+ "delay": "120s"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2740b69e7246ac6d1ad249382f21d534.asciidoc b/docs/examples/2740b69e7246ac6d1ad249382f21d534.asciidoc
index 123b036f7..172b3295e 100644
--- a/docs/examples/2740b69e7246ac6d1ad249382f21d534.asciidoc
+++ b/docs/examples/2740b69e7246ac6d1ad249382f21d534.asciidoc
@@ -1,20 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/aggregate-metric-double.asciidoc:26
[source, python]
----
resp = client.indices.create(
index="my-index",
- body={
- "mappings": {
- "properties": {
- "my-agg-metric-field": {
- "type": "aggregate_metric_double",
- "metrics": ["min", "max", "sum", "value_count"],
- "default_metric": "max",
- }
+ mappings={
+ "properties": {
+ "my-agg-metric-field": {
+ "type": "aggregate_metric_double",
+ "metrics": [
+ "min",
+ "max",
+ "sum",
+ "value_count"
+ ],
+ "default_metric": "max"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/274feaaa727e0ddf61b3c0f093182839.asciidoc b/docs/examples/274feaaa727e0ddf61b3c0f093182839.asciidoc
index bdf15c2c8..3d8739eb6 100644
--- a/docs/examples/274feaaa727e0ddf61b3c0f093182839.asciidoc
+++ b/docs/examples/274feaaa727e0ddf61b3c0f093182839.asciidoc
@@ -1,20 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:414
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "runtime_mappings": {
- "duration": {
- "type": "long",
- "script": {
- "source": "\n emit(doc['measures.end'].value - doc['measures.start'].value);\n "
- },
+ runtime_mappings={
+ "duration": {
+ "type": "long",
+ "script": {
+ "source": "\n emit(doc['measures.end'].value - doc['measures.start'].value);\n "
}
- },
- "aggs": {"duration_stats": {"stats": {"field": "duration"}}},
+ }
+ },
+ aggs={
+ "duration_stats": {
+ "stats": {
+ "field": "duration"
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/275ec358d5d1e4b9ff06cb4ae7e47650.asciidoc b/docs/examples/275ec358d5d1e4b9ff06cb4ae7e47650.asciidoc
new file mode 100644
index 000000000..b19ba72f6
--- /dev/null
+++ b/docs/examples/275ec358d5d1e4b9ff06cb4ae7e47650.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-index-template.asciidoc:78
+
+[source, python]
+----
+resp = client.indices.get_index_template(
+ name="temp*",
+)
+print(resp)
+----
diff --git a/docs/examples/27600d6a78623b69689d4218618e4278.asciidoc b/docs/examples/27600d6a78623b69689d4218618e4278.asciidoc
index c1b03d097..fbd330f2d 100644
--- a/docs/examples/27600d6a78623b69689d4218618e4278.asciidoc
+++ b/docs/examples/27600d6a78623b69689d4218618e4278.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/unsigned_long.asciidoc:47
[source, python]
----
resp = client.search(
index="my_index",
- body={"query": {"term": {"my_counter": 18446744073709552000}}},
+ query={
+ "term": {
+ "my_counter": 18446744073709552000
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/276e5b71ff5c6879a9b819076ad82301.asciidoc b/docs/examples/276e5b71ff5c6879a9b819076ad82301.asciidoc
new file mode 100644
index 000000000..be906e161
--- /dev/null
+++ b/docs/examples/276e5b71ff5c6879a9b819076ad82301.asciidoc
@@ -0,0 +1,71 @@
+// This file is autogenerated, DO NOT EDIT
+// vectors/vector-functions.asciidoc:33
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "my_dense_vector": {
+ "type": "dense_vector",
+ "index": False,
+ "dims": 3
+ },
+ "my_byte_dense_vector": {
+ "type": "dense_vector",
+ "index": False,
+ "dims": 3,
+ "element_type": "byte"
+ },
+ "status": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "my_dense_vector": [
+ 0.5,
+ 10,
+ 6
+ ],
+ "my_byte_dense_vector": [
+ 0,
+ 10,
+ 6
+ ],
+ "status": "published"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="my-index-000001",
+ id="2",
+ document={
+ "my_dense_vector": [
+ -0.5,
+ 10,
+ 10
+ ],
+ "my_byte_dense_vector": [
+ 0,
+ 10,
+ 10
+ ],
+ "status": "published"
+ },
+)
+print(resp2)
+
+resp3 = client.indices.refresh(
+ index="my-index-000001",
+)
+print(resp3)
+----
diff --git a/docs/examples/277fefe2b623af61f8274f73efc97aed.asciidoc b/docs/examples/277fefe2b623af61f8274f73efc97aed.asciidoc
new file mode 100644
index 000000000..052ef09d4
--- /dev/null
+++ b/docs/examples/277fefe2b623af61f8274f73efc97aed.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/dissect-syntax.asciidoc:115
+
+[source, python]
+----
+resp = client.scripts_painless_execute(
+ script={
+ "source": "\n String response=dissect('%{clientip} %{ident} %{auth} [%{@timestamp}] \"%{verb} %{request} HTTP/%{httpversion}\" %{response} %{size}').extract(doc[\"message\"].value)?.response;\n if (response != null) emit(Integer.parseInt(response)); \n "
+ },
+ context="long_field",
+ context_setup={
+ "index": "my-index",
+ "document": {
+ "message": "247.37.0.0 - - [30/Apr/2020:14:31:22 -0500] \"GET /images/hm_nbg.jpg HTTP/1.0\" 304 0"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/278d5bfa1a01f91d5c84679ef1bca390.asciidoc b/docs/examples/278d5bfa1a01f91d5c84679ef1bca390.asciidoc
new file mode 100644
index 000000000..7c45ca8cf
--- /dev/null
+++ b/docs/examples/278d5bfa1a01f91d5c84679ef1bca390.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/concurrency-control.asciidoc:61
+
+[source, python]
+----
+resp = client.get(
+ index="products",
+ id="1567",
+)
+print(resp)
+----
diff --git a/docs/examples/2793fa53b7d269852aa74f6bf57e34dc.asciidoc b/docs/examples/2793fa53b7d269852aa74f6bf57e34dc.asciidoc
new file mode 100644
index 000000000..90aa13eed
--- /dev/null
+++ b/docs/examples/2793fa53b7d269852aa74f6bf57e34dc.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/ngram-tokenfilter.asciidoc:208
+
+[source, python]
+----
+resp = client.indices.create(
+ index="ngram_custom_example",
+ settings={
+ "index": {
+ "max_ngram_diff": 2
+ },
+ "analysis": {
+ "analyzer": {
+ "default": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "3_5_grams"
+ ]
+ }
+ },
+ "filter": {
+ "3_5_grams": {
+ "type": "ngram",
+ "min_gram": 3,
+ "max_gram": 5
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/279e2b29261971999923fdc658bba8ff.asciidoc b/docs/examples/279e2b29261971999923fdc658bba8ff.asciidoc
new file mode 100644
index 000000000..8c10d90b6
--- /dev/null
+++ b/docs/examples/279e2b29261971999923fdc658bba8ff.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:556
+
+[source, python]
+----
+resp = client.search(
+ source={
+ "includes": [
+ "obj1.*",
+ "obj2.*"
+ ],
+ "excludes": [
+ "*.description"
+ ]
+ },
+ query={
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/27f9f604e7a48799fa30529cbc0ff619.asciidoc b/docs/examples/27f9f604e7a48799fa30529cbc0ff619.asciidoc
new file mode 100644
index 000000000..a595ba283
--- /dev/null
+++ b/docs/examples/27f9f604e7a48799fa30529cbc0ff619.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/delimited-payload-tokenfilter.asciidoc:173
+
+[source, python]
+----
+resp = client.indices.create(
+ index="delimited_payload_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_plus_delimited": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "plus_delimited"
+ ]
+ }
+ },
+ "filter": {
+ "plus_delimited": {
+ "type": "delimited_payload",
+ "delimiter": "+",
+ "encoding": "int"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc b/docs/examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc
index 4ae1f8e46..d50cf7897 100644
--- a/docs/examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc
+++ b/docs/examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc
@@ -1,22 +1,34 @@
-// mapping/types/boolean.asciidoc:249
+// This file is autogenerated, DO NOT EDIT
+// mapping/types/boolean.asciidoc:242
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"bool": {"type": "boolean"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "bool": {
+ "type": "boolean"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"bool": [True, False, True, False]},
+ document={
+ "bool": [
+ True,
+ False,
+ True,
+ False
+ ]
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/282e9e845b606f29a5bba174ae4c4c4d.asciidoc b/docs/examples/282e9e845b606f29a5bba174ae4c4c4d.asciidoc
new file mode 100644
index 000000000..ffbfe91ed
--- /dev/null
+++ b/docs/examples/282e9e845b606f29a5bba174ae4c4c4d.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-security.asciidoc:40
+
+[source, python]
+----
+resp = client.security.create_api_key(
+ name="my-restricted-api-key",
+ expiration="7d",
+ role_descriptors={
+ "my-restricted-role-descriptor": {
+ "indices": [
+ {
+ "names": [
+ "website-product-search"
+ ],
+ "privileges": [
+ "read"
+ ]
+ }
+ ],
+ "restriction": {
+ "workflows": [
+ "search_application_query"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/28415647fced5f983b42f8435332a625.asciidoc b/docs/examples/28415647fced5f983b42f8435332a625.asciidoc
new file mode 100644
index 000000000..6b37b5ad1
--- /dev/null
+++ b/docs/examples/28415647fced5f983b42f8435332a625.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:157
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "processors": [
+ {
+ "lowercase": {
+ "field": "my-keyword-field"
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_source": {
+ "my-keyword-field": "FOO"
+ }
+ },
+ {
+ "_source": {
+ "my-keyword-field": "BAR"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/28543836b62b5622a402e6f7731d68f0.asciidoc b/docs/examples/28543836b62b5622a402e6f7731d68f0.asciidoc
new file mode 100644
index 000000000..ef9cd5175
--- /dev/null
+++ b/docs/examples/28543836b62b5622a402e6f7731d68f0.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-manual.asciidoc:421
+
+[source, python]
+----
+resp = client.indices.downsample(
+ index=".ds-my-data-stream-2023.07.26-000001",
+ target_index=".ds-my-data-stream-2023.07.26-000001-downsample",
+ config={
+ "fixed_interval": "1h"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2856a5ceff1861aa9a78099f1c517fe7.asciidoc b/docs/examples/2856a5ceff1861aa9a78099f1c517fe7.asciidoc
new file mode 100644
index 000000000..a34abd399
--- /dev/null
+++ b/docs/examples/2856a5ceff1861aa9a78099f1c517fe7.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/troubleshooting.asciidoc:14
+
+[source, python]
+----
+resp = client.indices.get_mapping(
+ index=".watches",
+)
+print(resp)
+----
diff --git a/docs/examples/2864a24608b3ac59d21f604f8a31d131.asciidoc b/docs/examples/2864a24608b3ac59d21f604f8a31d131.asciidoc
new file mode 100644
index 000000000..98fb98017
--- /dev/null
+++ b/docs/examples/2864a24608b3ac59d21f604f8a31d131.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/jwt-realm.asciidoc:504
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="jwt_role1",
+ refresh=True,
+ cluster=[
+ "manage"
+ ],
+ indices=[
+ {
+ "names": [
+ "*"
+ ],
+ "privileges": [
+ "read"
+ ]
+ }
+ ],
+ run_as=[
+ "user123_runas"
+ ],
+ metadata={
+ "version": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2864d04bf99860ed5dbe1458f1ab5f78.asciidoc b/docs/examples/2864d04bf99860ed5dbe1458f1ab5f78.asciidoc
new file mode 100644
index 000000000..c9fcedba5
--- /dev/null
+++ b/docs/examples/2864d04bf99860ed5dbe1458f1ab5f78.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/apis/put-autoscaling-policy.asciidoc:16
+
+[source, python]
+----
+resp = client.autoscaling.put_autoscaling_policy(
+ name="",
+ policy={
+ "roles": [],
+ "deciders": {
+ "fixed": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2879d7bf4167194b102bf97117327164.asciidoc b/docs/examples/2879d7bf4167194b102bf97117327164.asciidoc
new file mode 100644
index 000000000..a1778310a
--- /dev/null
+++ b/docs/examples/2879d7bf4167194b102bf97117327164.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/charfilters/htmlstrip-charfilter.asciidoc:64
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "keyword",
+ "char_filter": [
+ "html_strip"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2884eacac3ad05ff794f5296ec7427e7.asciidoc b/docs/examples/2884eacac3ad05ff794f5296ec7427e7.asciidoc
new file mode 100644
index 000000000..923e21c79
--- /dev/null
+++ b/docs/examples/2884eacac3ad05ff794f5296ec7427e7.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/knn-query.asciidoc:57
+
+[source, python]
+----
+resp = client.search(
+ index="my-image-index",
+ size=3,
+ query={
+ "knn": {
+ "field": "image-vector",
+ "query_vector": [
+ -5,
+ 9,
+ -12
+ ],
+ "k": 10
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2891aa10ee9d474780adf94d5607f2db.asciidoc b/docs/examples/2891aa10ee9d474780adf94d5607f2db.asciidoc
new file mode 100644
index 000000000..fe88b0dff
--- /dev/null
+++ b/docs/examples/2891aa10ee9d474780adf94d5607f2db.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:175
+
+[source, python]
+----
+resp = client.search(
+ index="index_long,index_double",
+ sort=[
+ {
+ "field": {
+ "numeric_type": "double"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/2897ccc2a3bf3d0cd89328ee4413fae5.asciidoc b/docs/examples/2897ccc2a3bf3d0cd89328ee4413fae5.asciidoc
new file mode 100644
index 000000000..198589a8c
--- /dev/null
+++ b/docs/examples/2897ccc2a3bf3d0cd89328ee4413fae5.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-across-clusters.asciidoc:605
+
+[source, python]
+----
+resp = client.async_search.get(
+ id="FklQYndoTDJ2VEFlMEVBTzFJMGhJVFEaLVlKYndBWWZSMUdicUc4WVlEaFl4ZzoxNTU=",
+)
+print(resp)
+----
diff --git a/docs/examples/2898cf033b5bdefdbe3723af850b25c5.asciidoc b/docs/examples/2898cf033b5bdefdbe3723af850b25c5.asciidoc
new file mode 100644
index 000000000..80e6550b5
--- /dev/null
+++ b/docs/examples/2898cf033b5bdefdbe3723af850b25c5.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/collapse-search-results.asciidoc:53
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "message": "GET /search"
+ }
+ },
+ collapse={
+ "field": "user.id",
+ "inner_hits": {
+ "name": "most_recent",
+ "size": 5,
+ "sort": [
+ {
+ "@timestamp": "desc"
+ }
+ ]
+ },
+ "max_concurrent_group_searches": 4
+ },
+ sort=[
+ {
+ "http.response.bytes": {
+ "order": "desc"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/28ac880057135e46b3b00c7f3976538c.asciidoc b/docs/examples/28ac880057135e46b3b00c7f3976538c.asciidoc
index 732d01fe5..8d4184d2a 100644
--- a/docs/examples/28ac880057135e46b3b00c7f3976538c.asciidoc
+++ b/docs/examples/28ac880057135e46b3b00c7f3976538c.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/allocation/filtering.asciidoc:122
[source, python]
----
resp = client.indices.put_settings(
index="test",
- body={"index.routing.allocation.include._ip": "192.168.2.*"},
+ settings={
+ "index.routing.allocation.include._ip": "192.168.2.*"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/291110f4cac02f4610d0853f5800a70d.asciidoc b/docs/examples/291110f4cac02f4610d0853f5800a70d.asciidoc
new file mode 100644
index 000000000..cacb442cb
--- /dev/null
+++ b/docs/examples/291110f4cac02f4610d0853f5800a70d.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/weighted-avg-aggregation.asciidoc:214
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size=0,
+ aggs={
+ "weighted_grade": {
+ "weighted_avg": {
+ "value": {
+ "field": "grade",
+ "missing": 2
+ },
+ "weight": {
+ "field": "weight",
+ "missing": 3
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc b/docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc
index edd4ab6f7..871706d7e 100644
--- a/docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc
+++ b/docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc
@@ -1,14 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:294
[source, python]
----
resp = client.reindex(
slices="5",
- refresh="true",
- body={
- "source": {"index": "my-index-000001"},
- "dest": {"index": "my-new-index-000001"},
+ refresh=True,
+ source={
+ "index": "my-index-000001"
+ },
+ dest={
+ "index": "my-new-index-000001"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/295b3aaeb223612afdd991744dc9c873.asciidoc b/docs/examples/295b3aaeb223612afdd991744dc9c873.asciidoc
new file mode 100644
index 000000000..f54eccc6e
--- /dev/null
+++ b/docs/examples/295b3aaeb223612afdd991744dc9c873.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:484
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my_test_scores_pipeline",
+ description="Calculates the total test score",
+ processors=[
+ {
+ "script": {
+ "source": "ctx.total_score = (ctx.math_score + ctx.verbal_score)"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/29783e5de3a5f3c985cbf11094cf49a0.asciidoc b/docs/examples/29783e5de3a5f3c985cbf11094cf49a0.asciidoc
new file mode 100644
index 000000000..069582502
--- /dev/null
+++ b/docs/examples/29783e5de3a5f3c985cbf11094cf49a0.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keyword-repeat-tokenfilter.asciidoc:274
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "keyword_repeat",
+ "stemmer",
+ "remove_duplicates"
+ ],
+ text="fox running and jumping",
+ explain=True,
+ attributes="keyword",
+)
+print(resp)
+----
diff --git a/docs/examples/29824032d7d64512d17458fdd687b1f6.asciidoc b/docs/examples/29824032d7d64512d17458fdd687b1f6.asciidoc
new file mode 100644
index 000000000..7500f918a
--- /dev/null
+++ b/docs/examples/29824032d7d64512d17458fdd687b1f6.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/tasks.asciidoc:138
+
+[source, python]
+----
+resp = client.tasks.list(
+ parent_task_id="oTUltX4IQMOUUVeiohTt8A:123",
+)
+print(resp)
+----
diff --git a/docs/examples/29953082744b7a36e437b392a6391c81.asciidoc b/docs/examples/29953082744b7a36e437b392a6391c81.asciidoc
new file mode 100644
index 000000000..015f48a49
--- /dev/null
+++ b/docs/examples/29953082744b7a36e437b392a6391c81.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:699
+
+[source, python]
+----
+resp = client.render_search_template(
+ id="my-search-template",
+ params={
+ "from": 20,
+ "size": 10
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/299900fb08da80fe455cf3f1bb7d62ee.asciidoc b/docs/examples/299900fb08da80fe455cf3f1bb7d62ee.asciidoc
new file mode 100644
index 000000000..77842e352
--- /dev/null
+++ b/docs/examples/299900fb08da80fe455cf3f1bb7d62ee.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-field-mapping.asciidoc:96
+
+[source, python]
+----
+resp = client.indices.get_field_mapping(
+ index="publications",
+ fields="title",
+)
+print(resp)
+----
diff --git a/docs/examples/29d9df958de292cec50daaf31844b573.asciidoc b/docs/examples/29d9df958de292cec50daaf31844b573.asciidoc
new file mode 100644
index 000000000..91441a858
--- /dev/null
+++ b/docs/examples/29d9df958de292cec50daaf31844b573.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-field-mapping.asciidoc:226
+
+[source, python]
+----
+resp = client.indices.get_field_mapping(
+ index="my-index-000001,my-index-000002",
+ fields="message",
+)
+print(resp)
+----
diff --git a/docs/examples/29e002ab596bae58712eb048ac1768d1.asciidoc b/docs/examples/29e002ab596bae58712eb048ac1768d1.asciidoc
new file mode 100644
index 000000000..036330b71
--- /dev/null
+++ b/docs/examples/29e002ab596bae58712eb048ac1768d1.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/collapse-search-results.asciidoc:189
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ routing="xyz",
+ document={
+ "@timestamp": "2099-11-15T13:12:00",
+ "message": "You know for search!",
+ "user.id": "xyz"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc b/docs/examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc
new file mode 100644
index 000000000..e831ba094
--- /dev/null
+++ b/docs/examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/oidc-logout-api.asciidoc:47
+
+[source, python]
+----
+resp = client.security.oidc_logout(
+ body={
+ "token": "dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
+ "refresh_token": "vLBPvmAB6KvwvJZr27cS"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2a247e36a86a373bcbf478ac9a588f44.asciidoc b/docs/examples/2a247e36a86a373bcbf478ac9a588f44.asciidoc
index 4c5744034..4f5b43e4e 100644
--- a/docs/examples/2a247e36a86a373bcbf478ac9a588f44.asciidoc
+++ b/docs/examples/2a247e36a86a373bcbf478ac9a588f44.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/index_.asciidoc:328
[source, python]
@@ -5,11 +6,13 @@
resp = client.index(
index="my-index-000001",
routing="kimchy",
- body={
+ document={
"@timestamp": "2099-11-15T13:12:00",
"message": "GET /search HTTP/1.1 200 1070000",
- "user": {"id": "kimchy"},
+ "user": {
+ "id": "kimchy"
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2a287d213a812b98d8353c563a058cfc.asciidoc b/docs/examples/2a287d213a812b98d8353c563a058cfc.asciidoc
new file mode 100644
index 000000000..edd8476b5
--- /dev/null
+++ b/docs/examples/2a287d213a812b98d8353c563a058cfc.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/boxplot-aggregation.asciidoc:31
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_boxplot": {
+ "boxplot": {
+ "field": "load_time"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2a44d254e6e32abe97515fd2eb34705d.asciidoc b/docs/examples/2a44d254e6e32abe97515fd2eb34705d.asciidoc
new file mode 100644
index 000000000..de6b7e5ef
--- /dev/null
+++ b/docs/examples/2a44d254e6e32abe97515fd2eb34705d.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:643
+
+[source, python]
+----
+resp = client.sql.get_async(
+ id="FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=",
+ wait_for_completion_timeout="2s",
+ format="json",
+)
+print(resp)
+----
diff --git a/docs/examples/2a47d11c6e19c9da5104e738359ea8a8.asciidoc b/docs/examples/2a47d11c6e19c9da5104e738359ea8a8.asciidoc
new file mode 100644
index 000000000..e94f253e8
--- /dev/null
+++ b/docs/examples/2a47d11c6e19c9da5104e738359ea8a8.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/migrate-to-data-tiers-routing-guide.asciidoc:208
+
+[source, python]
+----
+resp = client.ilm.start()
+print(resp)
+----
diff --git a/docs/examples/2a5f7e7d6b92c66e52616845146d2820.asciidoc b/docs/examples/2a5f7e7d6b92c66e52616845146d2820.asciidoc
new file mode 100644
index 000000000..757d2d7a4
--- /dev/null
+++ b/docs/examples/2a5f7e7d6b92c66e52616845146d2820.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/painless-examples.asciidoc:513
+
+[source, python]
+----
+resp = client.transform.preview_transform(
+ id="index_compare",
+ source={
+ "index": [
+ "index1",
+ "index2"
+ ],
+ "query": {
+ "match_all": {}
+ }
+ },
+ dest={
+ "index": "compare"
+ },
+ pivot={
+ "group_by": {
+ "unique-id": {
+ "terms": {
+ "field": ""
+ }
+ }
+ },
+ "aggregations": {
+ "compare": {
+ "scripted_metric": {
+ "map_script": "state.doc = new HashMap(params['_source'])",
+ "combine_script": "return state",
+ "reduce_script": " \n if (states.size() != 2) {\n return \"count_mismatch\"\n }\n if (states.get(0).equals(states.get(1))) {\n return \"match\"\n } else {\n return \"mismatch\"\n }\n "
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2a70194ebd2f01a3229a5092513676b3.asciidoc b/docs/examples/2a70194ebd2f01a3229a5092513676b3.asciidoc
new file mode 100644
index 000000000..dc73d3191
--- /dev/null
+++ b/docs/examples/2a70194ebd2f01a3229a5092513676b3.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/charfilters/htmlstrip-charfilter.asciidoc:106
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "keyword",
+ "char_filter": [
+ "my_custom_html_strip_char_filter"
+ ]
+ }
+ },
+ "char_filter": {
+ "my_custom_html_strip_char_filter": {
+ "type": "html_strip",
+ "escaped_tags": [
+ "b"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2a71e2d7f7179dd76183d30789046808.asciidoc b/docs/examples/2a71e2d7f7179dd76183d30789046808.asciidoc
new file mode 100644
index 000000000..46ca2436d
--- /dev/null
+++ b/docs/examples/2a71e2d7f7179dd76183d30789046808.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/multivalued-fields.asciidoc:177
+
+[source, python]
+----
+resp = client.bulk(
+ index="mv",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "a": 1,
+ "b": [
+ 2,
+ 1
+ ]
+ },
+ {
+ "index": {}
+ },
+ {
+ "a": 2,
+ "b": 3
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/2a91e1fb8ad93a188fa9d77ec01bc431.asciidoc b/docs/examples/2a91e1fb8ad93a188fa9d77ec01bc431.asciidoc
new file mode 100644
index 000000000..e90d87c7d
--- /dev/null
+++ b/docs/examples/2a91e1fb8ad93a188fa9d77ec01bc431.asciidoc
@@ -0,0 +1,53 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-inner-hits.asciidoc:90
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test",
+ mappings={
+ "properties": {
+ "comments": {
+ "type": "nested"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="test",
+ id="1",
+ refresh=True,
+ document={
+ "title": "Test title",
+ "comments": [
+ {
+ "author": "kimchy",
+ "number": 1
+ },
+ {
+ "author": "nik9000",
+ "number": 2
+ }
+ ]
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="test",
+ query={
+ "nested": {
+ "path": "comments",
+ "query": {
+ "match": {
+ "comments.number": 2
+ }
+ },
+ "inner_hits": {}
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/2a9747bcfaf1f9491ebd410b3fcb6798.asciidoc b/docs/examples/2a9747bcfaf1f9491ebd410b3fcb6798.asciidoc
index e2ea2f288..10e45ec11 100644
--- a/docs/examples/2a9747bcfaf1f9491ebd410b3fcb6798.asciidoc
+++ b/docs/examples/2a9747bcfaf1f9491ebd410b3fcb6798.asciidoc
@@ -1,16 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:45
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {
- "query": "(new york city) OR (big apple)",
- "default_field": "content",
- }
+ query={
+ "query_string": {
+ "query": "(new york city) OR (big apple)",
+ "default_field": "content"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2a9d3119a9e26e29220be436b9382955.asciidoc b/docs/examples/2a9d3119a9e26e29220be436b9382955.asciidoc
new file mode 100644
index 000000000..3efd3123e
--- /dev/null
+++ b/docs/examples/2a9d3119a9e26e29220be436b9382955.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-mapping.asciidoc:208
+
+[source, python]
+----
+resp = client.indices.create(
+ index="mistral-embeddings",
+ mappings={
+ "properties": {
+ "content_embedding": {
+ "type": "dense_vector",
+ "dims": 1024,
+ "element_type": "float",
+ "similarity": "dot_product"
+ },
+ "content": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2aa548b692fc2fe7b6f0d90eb8b2ae29.asciidoc b/docs/examples/2aa548b692fc2fe7b6f0d90eb8b2ae29.asciidoc
new file mode 100644
index 000000000..aea75cee0
--- /dev/null
+++ b/docs/examples/2aa548b692fc2fe7b6f0d90eb8b2ae29.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/delete-watch.asciidoc:60
+
+[source, python]
+----
+resp = client.watcher.delete_watch(
+ id="my_watch",
+)
+print(resp)
+----
diff --git a/docs/examples/2abfe0d3f5593d23d2dfa608b1e2532a.asciidoc b/docs/examples/2abfe0d3f5593d23d2dfa608b1e2532a.asciidoc
new file mode 100644
index 000000000..8d80db91f
--- /dev/null
+++ b/docs/examples/2abfe0d3f5593d23d2dfa608b1e2532a.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:796
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "user_name": {
+ "terms": {
+ "field": "user_name"
+ }
+ }
+ },
+ {
+ "date": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "1d",
+ "order": "desc"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2ac37c3c572170ded67f1d5a0c8151ab.asciidoc b/docs/examples/2ac37c3c572170ded67f1d5a0c8151ab.asciidoc
new file mode 100644
index 000000000..bf6459bab
--- /dev/null
+++ b/docs/examples/2ac37c3c572170ded67f1d5a0c8151ab.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1204
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ tiebreaker_field="event.sequence",
+ query="\n process where process.name == \"cmd.exe\" and stringContains(process.executable, \"System32\")\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/2ac7efe3919ee0c7971f5d502f482662.asciidoc b/docs/examples/2ac7efe3919ee0c7971f5d502f482662.asciidoc
new file mode 100644
index 000000000..25ba3ea33
--- /dev/null
+++ b/docs/examples/2ac7efe3919ee0c7971f5d502f482662.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// vectors/vector-functions.asciidoc:159
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "script_score": {
+ "query": {
+ "bool": {
+ "filter": {
+ "term": {
+ "status": "published"
+ }
+ }
+ }
+ },
+ "script": {
+ "source": "1 / (1 + l1norm(params.queryVector, 'my_dense_vector'))",
+ "params": {
+ "queryVector": [
+ 4,
+ 3.4,
+ -0.2
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2acf75803494fef29f9ca70671aa6be1.asciidoc b/docs/examples/2acf75803494fef29f9ca70671aa6be1.asciidoc
new file mode 100644
index 000000000..fbba69008
--- /dev/null
+++ b/docs/examples/2acf75803494fef29f9ca70671aa6be1.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/bulk-delete-roles.asciidoc:95
+
+[source, python]
+----
+resp = client.security.bulk_delete_role(
+ names=[
+ "my_admin_role",
+ "superuser"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/2ad35a13262f98574a48f88b4a838512.asciidoc b/docs/examples/2ad35a13262f98574a48f88b4a838512.asciidoc
new file mode 100644
index 000000000..2a61d5860
--- /dev/null
+++ b/docs/examples/2ad35a13262f98574a48f88b4a838512.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/alias-privileges.asciidoc:92
+
+[source, python]
+----
+resp = client.get(
+ index="current_year",
+ id="1",
+)
+print(resp)
+----
diff --git a/docs/examples/2ade05fb3fb06a67df25e097dfadb045.asciidoc b/docs/examples/2ade05fb3fb06a67df25e097dfadb045.asciidoc
new file mode 100644
index 000000000..13dfd8f19
--- /dev/null
+++ b/docs/examples/2ade05fb3fb06a67df25e097dfadb045.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/range-enrich-policy-type-ex.asciidoc:125
+
+[source, python]
+----
+resp = client.get(
+ index="my-index-000001",
+ id="my_id",
+)
+print(resp)
+----
diff --git a/docs/examples/2aec92bc31bc24bce58d983738f9e0fe.asciidoc b/docs/examples/2aec92bc31bc24bce58d983738f9e0fe.asciidoc
new file mode 100644
index 000000000..e1e69ade6
--- /dev/null
+++ b/docs/examples/2aec92bc31bc24bce58d983738f9e0fe.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/matrix-stats-aggregation.asciidoc:128
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "matrixstats": {
+ "matrix_stats": {
+ "fields": [
+ "poverty",
+ "income"
+ ],
+ "missing": {
+ "income": 50000
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2afc1231679898bd864d06679d9e951b.asciidoc b/docs/examples/2afc1231679898bd864d06679d9e951b.asciidoc
new file mode 100644
index 000000000..8b310f05f
--- /dev/null
+++ b/docs/examples/2afc1231679898bd864d06679d9e951b.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline.asciidoc:202
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "day"
+ },
+ "aggs": {
+ "categories": {
+ "terms": {
+ "field": "category"
+ }
+ },
+ "min_bucket_selector": {
+ "bucket_selector": {
+ "buckets_path": {
+ "count": "categories._bucket_count"
+ },
+ "script": {
+ "source": "params.count != 0"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc b/docs/examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc
new file mode 100644
index 000000000..65c237a2b
--- /dev/null
+++ b/docs/examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-rest.asciidoc:381
+
+[source, python]
+----
+resp = client.esql.async_query_get(
+ id="FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
+ wait_for_completion_timeout="30s",
+ body=None,
+)
+print(resp)
+----
diff --git a/docs/examples/2b1c560f00d9bcf5caaf56c03f6b5962.asciidoc b/docs/examples/2b1c560f00d9bcf5caaf56c03f6b5962.asciidoc
new file mode 100644
index 000000000..5027a5dcb
--- /dev/null
+++ b/docs/examples/2b1c560f00d9bcf5caaf56c03f6b5962.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/list-connector-sync-jobs-api.asciidoc:78
+
+[source, python]
+----
+resp = client.perform_request(
+ "GET",
+ "/_connector/_sync_job",
+ params={
+ "job_type": "full,incremental"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2b47be4b712147a429102aef386470ee.asciidoc b/docs/examples/2b47be4b712147a429102aef386470ee.asciidoc
new file mode 100644
index 000000000..3f80bff4b
--- /dev/null
+++ b/docs/examples/2b47be4b712147a429102aef386470ee.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/detect-threats-with-eql.asciidoc:277
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n sequence by process.pid\n [process where process.name == \"regsvr32.exe\"]\n [library where dll.name == \"scrobj.dll\"]\n [network where true]\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/2b59b014349d45bf894aca90b2b1fbe0.asciidoc b/docs/examples/2b59b014349d45bf894aca90b2b1fbe0.asciidoc
new file mode 100644
index 000000000..f17f21d1c
--- /dev/null
+++ b/docs/examples/2b59b014349d45bf894aca90b2b1fbe0.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-a-data-stream.asciidoc:377
+
+[source, python]
+----
+resp = client.indices.delete_data_stream(
+ name="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/2b5a5f8689f04d095fa86570130ee4d4.asciidoc b/docs/examples/2b5a5f8689f04d095fa86570130ee4d4.asciidoc
index df11931b5..2242ef24d 100644
--- a/docs/examples/2b5a5f8689f04d095fa86570130ee4d4.asciidoc
+++ b/docs/examples/2b5a5f8689f04d095fa86570130ee4d4.asciidoc
@@ -1,20 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/parent-join.asciidoc:22
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "my_id": {"type": "keyword"},
- "my_join_field": {
- "type": "join",
- "relations": {"question": "answer"},
- },
+ mappings={
+ "properties": {
+ "my_id": {
+ "type": "keyword"
+ },
+ "my_join_field": {
+ "type": "join",
+ "relations": {
+ "question": "answer"
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2b5c69778eb3daba9fbd7242bcc2daf9.asciidoc b/docs/examples/2b5c69778eb3daba9fbd7242bcc2daf9.asciidoc
new file mode 100644
index 000000000..d8dd88c98
--- /dev/null
+++ b/docs/examples/2b5c69778eb3daba9fbd7242bcc2daf9.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-api-key.asciidoc:724
+
+[source, python]
+----
+resp = client.security.query_api_keys(
+ size=0,
+ query={
+ "bool": {
+ "filter": {
+ "term": {
+ "invalidated": True
+ }
+ }
+ }
+ },
+ aggs={
+ "invalidated_keys": {
+ "composite": {
+ "sources": [
+ {
+ "username": {
+ "terms": {
+ "field": "username"
+ }
+ }
+ },
+ {
+ "key_name": {
+ "terms": {
+ "field": "name"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2b7687e3d7c06824950e00618c297864.asciidoc b/docs/examples/2b7687e3d7c06824950e00618c297864.asciidoc
new file mode 100644
index 000000000..c9652cf82
--- /dev/null
+++ b/docs/examples/2b7687e3d7c06824950e00618c297864.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/resolve-cluster.asciidoc:141
+
+[source, python]
+----
+resp = client.indices.resolve_cluster(
+ name="my-index*,clust*:my-index*",
+)
+print(resp)
+----
diff --git a/docs/examples/2ba15c066d55a9b26d49b09471151cb4.asciidoc b/docs/examples/2ba15c066d55a9b26d49b09471151cb4.asciidoc
new file mode 100644
index 000000000..697f976b1
--- /dev/null
+++ b/docs/examples/2ba15c066d55a9b26d49b09471151cb4.asciidoc
@@ -0,0 +1,84 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/adjacency-matrix-aggregation.asciidoc:36
+
+[source, python]
+----
+resp = client.bulk(
+ index="emails",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "accounts": [
+ "hillary",
+ "sidney"
+ ]
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "accounts": [
+ "hillary",
+ "donald"
+ ]
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "accounts": [
+ "vladimir",
+ "donald"
+ ]
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.search(
+ index="emails",
+ size=0,
+ aggs={
+ "interactions": {
+ "adjacency_matrix": {
+ "filters": {
+ "grpA": {
+ "terms": {
+ "accounts": [
+ "hillary",
+ "sidney"
+ ]
+ }
+ },
+ "grpB": {
+ "terms": {
+ "accounts": [
+ "donald",
+ "mitt"
+ ]
+ }
+ },
+ "grpC": {
+ "terms": {
+ "accounts": [
+ "vladimir",
+ "nigel"
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/2bacdcb278705d944f367cfb984cf4d2.asciidoc b/docs/examples/2bacdcb278705d944f367cfb984cf4d2.asciidoc
new file mode 100644
index 000000000..3d9506a77
--- /dev/null
+++ b/docs/examples/2bacdcb278705d944f367cfb984cf4d2.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:30
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ sort=[
+ {
+ "post_date": {
+ "order": "asc",
+ "format": "strict_date_optional_time_nanos"
+ }
+ },
+ "user",
+ {
+ "name": "desc"
+ },
+ {
+ "age": "desc"
+ },
+ "_score"
+ ],
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc b/docs/examples/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc
new file mode 100644
index 000000000..64dfcb7b5
--- /dev/null
+++ b/docs/examples/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// migration/transient-settings-migration-guide.asciidoc:64
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.indices.close.enable": False,
+ "indices.recovery.max_bytes_per_sec": "50mb"
+ },
+ transient={
+ "*": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2bc1d52efec2076dc9fc2a3a2d90e8ab.asciidoc b/docs/examples/2bc1d52efec2076dc9fc2a3a2d90e8ab.asciidoc
new file mode 100644
index 000000000..6eeae57f5
--- /dev/null
+++ b/docs/examples/2bc1d52efec2076dc9fc2a3a2d90e8ab.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/boxplot-aggregation.asciidoc:177
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_boxplot": {
+ "boxplot": {
+ "field": "load_time",
+ "execution_hint": "high_accuracy"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2bc57cd3f32b59b0b44ca63b19cdfcc0.asciidoc b/docs/examples/2bc57cd3f32b59b0b44ca63b19cdfcc0.asciidoc
new file mode 100644
index 000000000..4af6d21c6
--- /dev/null
+++ b/docs/examples/2bc57cd3f32b59b0b44ca63b19cdfcc0.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:623
+
+[source, python]
+----
+resp = client.search(
+ index="image-index",
+ knn={
+ "field": "image-vector",
+ "query_vector": [
+ 1,
+ 5,
+ -20
+ ],
+ "k": 5,
+ "num_candidates": 50,
+ "similarity": 36,
+ "filter": {
+ "term": {
+ "file-type": "png"
+ }
+ }
+ },
+ fields=[
+ "title"
+ ],
+ source=False,
+)
+print(resp)
+----
diff --git a/docs/examples/2c090fe7ec7b66b3f5c178d71c46323b.asciidoc b/docs/examples/2c090fe7ec7b66b3f5c178d71c46323b.asciidoc
index 8b0a41cfe..1f12b2a09 100644
--- a/docs/examples/2c090fe7ec7b66b3f5c178d71c46323b.asciidoc
+++ b/docs/examples/2c090fe7ec7b66b3f5c178d71c46323b.asciidoc
@@ -1,19 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/parent-join.asciidoc:403
[source, python]
----
resp = client.indices.stats(
metric="fielddata",
- human="true",
+ human=True,
fields="my_join_field",
)
print(resp)
-resp = client.nodes.stats(
+resp1 = client.nodes.stats(
metric="indices",
index_metric="fielddata",
- human="true",
+ human=True,
fields="my_join_field",
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/2c0dbdcf400cde5d36f7c9e6c1101011.asciidoc b/docs/examples/2c0dbdcf400cde5d36f7c9e6c1101011.asciidoc
new file mode 100644
index 000000000..f2ff73eba
--- /dev/null
+++ b/docs/examples/2c0dbdcf400cde5d36f7c9e6c1101011.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/health.asciidoc:101
+
+[source, python]
+----
+resp = client.cat.health(
+ v=True,
+ ts=False,
+)
+print(resp)
+----
diff --git a/docs/examples/2c1e16e9ac24cfea979af2a69900d3c2.asciidoc b/docs/examples/2c1e16e9ac24cfea979af2a69900d3c2.asciidoc
new file mode 100644
index 000000000..81f979d28
--- /dev/null
+++ b/docs/examples/2c1e16e9ac24cfea979af2a69900d3c2.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// synonyms/apis/put-synonym-rule.asciidoc:107
+
+[source, python]
+----
+resp = client.synonyms.put_synonym_rule(
+ set_id="my-synonyms-set",
+ rule_id="test-1",
+ synonyms="hello, hi, howdy",
+)
+print(resp)
+----
diff --git a/docs/examples/2c27a8eb6528126f37a843d434cd88b6.asciidoc b/docs/examples/2c27a8eb6528126f37a843d434cd88b6.asciidoc
new file mode 100644
index 000000000..5df64d938
--- /dev/null
+++ b/docs/examples/2c27a8eb6528126f37a843d434cd88b6.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/flatten-graph-tokenfilter.asciidoc:39
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ {
+ "type": "synonym_graph",
+ "synonyms": [
+ "dns, domain name system"
+ ]
+ }
+ ],
+ text="domain name system is fragile",
+)
+print(resp)
+----
diff --git a/docs/examples/2c3207c0c985d253b2ecccc14e69e25a.asciidoc b/docs/examples/2c3207c0c985d253b2ecccc14e69e25a.asciidoc
new file mode 100644
index 000000000..8822e4d52
--- /dev/null
+++ b/docs/examples/2c3207c0c985d253b2ecccc14e69e25a.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-manual.asciidoc:412
+
+[source, python]
+----
+resp = client.indices.add_block(
+ index=".ds-my-data-stream-2023.07.26-000001",
+ block="write",
+)
+print(resp)
+----
diff --git a/docs/examples/2c3dff44904d3d73ff47f1afe89c7f86.asciidoc b/docs/examples/2c3dff44904d3d73ff47f1afe89c7f86.asciidoc
index 0749a99e8..83f9a5add 100644
--- a/docs/examples/2c3dff44904d3d73ff47f1afe89c7f86.asciidoc
+++ b/docs/examples/2c3dff44904d3d73ff47f1afe89c7f86.asciidoc
@@ -1,10 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:369
[source, python]
----
resp = client.update_by_query(
index="my-index-000001",
- body={"query": {"term": {"user.id": "kimchy"}}, "max_docs": 1},
+ query={
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
+ max_docs=1,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2c44657adf550b8ade5cf5334106d38b.asciidoc b/docs/examples/2c44657adf550b8ade5cf5334106d38b.asciidoc
index 1f96b6cea..6b4e8588e 100644
--- a/docs/examples/2c44657adf550b8ade5cf5334106d38b.asciidoc
+++ b/docs/examples/2c44657adf550b8ade5cf5334106d38b.asciidoc
@@ -1,19 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1406
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "runtime_mappings": {
- "http.clientip": {
- "type": "ip",
- "script": "\n String clientip=grok('%{COMMONAPACHELOG}').extract(doc[\"message\"].value)?.clientip;\n if (clientip != null) emit(clientip);\n ",
- }
- },
- "query": {"match": {"http.clientip": "40.135.0.0"}},
- "fields": ["http.clientip"],
+ runtime_mappings={
+ "http.clientip": {
+ "type": "ip",
+ "script": "\n String clientip=grok('%{COMMONAPACHELOG}').extract(doc[\"message\"].value)?.clientip;\n if (clientip != null) emit(clientip);\n "
+ }
},
+ query={
+ "match": {
+ "http.clientip": "40.135.0.0"
+ }
+ },
+ fields=[
+ "http.clientip"
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2c602b4ee8f22cda2cdf19bad31da0af.asciidoc b/docs/examples/2c602b4ee8f22cda2cdf19bad31da0af.asciidoc
new file mode 100644
index 000000000..1aedc5929
--- /dev/null
+++ b/docs/examples/2c602b4ee8f22cda2cdf19bad31da0af.asciidoc
@@ -0,0 +1,78 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster.asciidoc:53
+
+[source, python]
+----
+resp = client.nodes.info()
+print(resp)
+
+resp1 = client.nodes.info(
+ node_id="_all",
+)
+print(resp1)
+
+resp2 = client.nodes.info(
+ node_id="_local",
+)
+print(resp2)
+
+resp3 = client.nodes.info(
+ node_id="_master",
+)
+print(resp3)
+
+resp4 = client.nodes.info(
+ node_id="node_name_goes_here",
+)
+print(resp4)
+
+resp5 = client.nodes.info(
+ node_id="node_name_goes_*",
+)
+print(resp5)
+
+resp6 = client.nodes.info(
+ node_id="10.0.0.3,10.0.0.4",
+)
+print(resp6)
+
+resp7 = client.nodes.info(
+ node_id="10.0.0.*",
+)
+print(resp7)
+
+resp8 = client.nodes.info(
+ node_id="_all,master:false",
+)
+print(resp8)
+
+resp9 = client.nodes.info(
+ node_id="data:true,ingest:true",
+)
+print(resp9)
+
+resp10 = client.nodes.info(
+ node_id="coordinating_only:true",
+)
+print(resp10)
+
+resp11 = client.nodes.info(
+ node_id="master:true,voting_only:false",
+)
+print(resp11)
+
+resp12 = client.nodes.info(
+ node_id="rack:2",
+)
+print(resp12)
+
+resp13 = client.nodes.info(
+ node_id="ra*:2",
+)
+print(resp13)
+
+resp14 = client.nodes.info(
+ node_id="ra*:2*",
+)
+print(resp14)
+----
diff --git a/docs/examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc b/docs/examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc
index a4a64ba77..2b48fd10d 100644
--- a/docs/examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc
+++ b/docs/examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc
@@ -1,28 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
// cluster/reroute.asciidoc:195
[source, python]
----
resp = client.cluster.reroute(
metric="none",
- body={
- "commands": [
- {
- "move": {
- "index": "test",
- "shard": 0,
- "from_node": "node1",
- "to_node": "node2",
- }
- },
- {
- "allocate_replica": {
- "index": "test",
- "shard": 1,
- "node": "node3",
- }
- },
- ]
- },
+ commands=[
+ {
+ "move": {
+ "index": "test",
+ "shard": 0,
+ "from_node": "node1",
+ "to_node": "node2"
+ }
+ },
+ {
+ "allocate_replica": {
+ "index": "test",
+ "shard": 1,
+ "node": "node3"
+ }
+ }
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2ceded6ee764adf1aaaac0a1cd25ed5f.asciidoc b/docs/examples/2ceded6ee764adf1aaaac0a1cd25ed5f.asciidoc
new file mode 100644
index 000000000..88f58c6e5
--- /dev/null
+++ b/docs/examples/2ceded6ee764adf1aaaac0a1cd25ed5f.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/restore-from-snapshot.asciidoc:418
+
+[source, python]
+----
+resp = client.cat.indices(
+ v=True,
+ health="red",
+ h="index,status,health",
+)
+print(resp)
+----
diff --git a/docs/examples/2d01a9e5550b525496757f1bd7f0e706.asciidoc b/docs/examples/2d01a9e5550b525496757f1bd7f0e706.asciidoc
index 43d88b771..723f5761c 100644
--- a/docs/examples/2d01a9e5550b525496757f1bd7f0e706.asciidoc
+++ b/docs/examples/2d01a9e5550b525496757f1bd7f0e706.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/index_.asciidoc:456
[source, python]
@@ -6,11 +7,13 @@ resp = client.index(
index="my-index-000001",
id="1",
timeout="5m",
- body={
+ document={
"@timestamp": "2099-11-15T13:12:00",
"message": "GET /search HTTP/1.1 200 1070000",
- "user": {"id": "kimchy"},
+ "user": {
+ "id": "kimchy"
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2d150ff3b6b991b58fea6aa5cc669aa3.asciidoc b/docs/examples/2d150ff3b6b991b58fea6aa5cc669aa3.asciidoc
index 9dd6cd0d7..88454fbda 100644
--- a/docs/examples/2d150ff3b6b991b58fea6aa5cc669aa3.asciidoc
+++ b/docs/examples/2d150ff3b6b991b58fea6aa5cc669aa3.asciidoc
@@ -1,18 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/match-phrase-query.asciidoc:30
[source, python]
----
resp = client.search(
- body={
- "query": {
- "match_phrase": {
- "message": {
- "query": "this is a test",
- "analyzer": "my_analyzer",
- }
+ query={
+ "match_phrase": {
+ "message": {
+ "query": "this is a test",
+ "analyzer": "my_analyzer"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2d2f5ec97aa34ff7822a6a1ed08ef335.asciidoc b/docs/examples/2d2f5ec97aa34ff7822a6a1ed08ef335.asciidoc
new file mode 100644
index 000000000..5aa8a29e7
--- /dev/null
+++ b/docs/examples/2d2f5ec97aa34ff7822a6a1ed08ef335.asciidoc
@@ -0,0 +1,58 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/top-metrics-aggregation.asciidoc:423
+
+[source, python]
+----
+resp = client.bulk(
+ index="test",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_index": "test1"
+ }
+ },
+ {
+ "s": 1,
+ "m": 3.1415
+ },
+ {
+ "index": {
+ "_index": "test1"
+ }
+ },
+ {
+ "s": 2,
+ "m": 1
+ },
+ {
+ "index": {
+ "_index": "test2"
+ }
+ },
+ {
+ "s": 3.1,
+ "m": 2.71828
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.search(
+ index="test*",
+ filter_path="aggregations",
+ aggs={
+ "tm": {
+ "top_metrics": {
+ "metrics": {
+ "field": "m"
+ },
+ "sort": {
+ "s": "asc"
+ }
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/2d37b02cbf6d30ae11bf239a54ec9423.asciidoc b/docs/examples/2d37b02cbf6d30ae11bf239a54ec9423.asciidoc
index fa3f3f3ec..d5646539c 100644
--- a/docs/examples/2d37b02cbf6d30ae11bf239a54ec9423.asciidoc
+++ b/docs/examples/2d37b02cbf6d30ae11bf239a54ec9423.asciidoc
@@ -1,72 +1,85 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:316
[source, python]
----
resp = client.bulk(
index="my-index-000001",
- refresh="true",
- body=[
- {"index": {}},
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
{
"@timestamp": 1516729294000,
"model_number": "QVKC92Q",
"measures": {
"voltage": "5.2",
"start": "300",
- "end": "8675309",
- },
+ "end": "8675309"
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": 1516642894000,
"model_number": "QVKC92Q",
"measures": {
"voltage": "5.8",
"start": "300",
- "end": "8675309",
- },
+ "end": "8675309"
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": 1516556494000,
"model_number": "QVKC92Q",
"measures": {
"voltage": "5.1",
"start": "300",
- "end": "8675309",
- },
+ "end": "8675309"
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": 1516470094000,
"model_number": "QVKC92Q",
"measures": {
"voltage": "5.6",
"start": "300",
- "end": "8675309",
- },
+ "end": "8675309"
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": 1516383694000,
"model_number": "HG537PU",
"measures": {
"voltage": "4.2",
"start": "400",
- "end": "8625309",
- },
+ "end": "8625309"
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": 1516297294000,
"model_number": "HG537PU",
"measures": {
"voltage": "4.0",
"start": "400",
- "end": "8625309",
- },
- },
+ "end": "8625309"
+ }
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2d60e3bdfee7afbddee149f40450b8b5.asciidoc b/docs/examples/2d60e3bdfee7afbddee149f40450b8b5.asciidoc
new file mode 100644
index 000000000..4c868c678
--- /dev/null
+++ b/docs/examples/2d60e3bdfee7afbddee149f40450b8b5.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/validate.asciidoc:143
+
+[source, python]
+----
+resp = client.indices.validate_query(
+ index="my-index-000001",
+ query={
+ "query_string": {
+ "query": "@timestamp:foo",
+ "lenient": False
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2d633b7f346b828d01f923ce9dbf6ad5.asciidoc b/docs/examples/2d633b7f346b828d01f923ce9dbf6ad5.asciidoc
deleted file mode 100644
index b2e874fd0..000000000
--- a/docs/examples/2d633b7f346b828d01f923ce9dbf6ad5.asciidoc
+++ /dev/null
@@ -1,10 +0,0 @@
-// ml/trained-models/apis/put-trained-model-vocabulary.asciidoc:63
-
-[source, python]
-----
-resp = client.ml.put_trained_model_vocabulary(
- model_id="elastic__distilbert-base-uncased-finetuned-conll03-english",
- body={"vocabulary": ["[PAD]", "[unused0]", ...]},
-)
-print(resp)
-----
\ No newline at end of file
diff --git a/docs/examples/2d8fcb03de417a71e7888bbdd948a692.asciidoc b/docs/examples/2d8fcb03de417a71e7888bbdd948a692.asciidoc
new file mode 100644
index 000000000..bc202ff06
--- /dev/null
+++ b/docs/examples/2d8fcb03de417a71e7888bbdd948a692.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/transforms.asciidoc:191
+
+[source, python]
+----
+resp = client.cat.transforms(
+ v=True,
+ format="json",
+)
+print(resp)
+----
diff --git a/docs/examples/2d9b30acd6b5683f39d53494c0dd779c.asciidoc b/docs/examples/2d9b30acd6b5683f39d53494c0dd779c.asciidoc
index 61a35491f..e9fbbe638 100644
--- a/docs/examples/2d9b30acd6b5683f39d53494c0dd779c.asciidoc
+++ b/docs/examples/2d9b30acd6b5683f39d53494c0dd779c.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// setup/restart-cluster.asciidoc:147
[source, python]
@@ -5,6 +6,6 @@
resp = client.cat.health()
print(resp)
-resp = client.cat.recovery()
-print(resp)
-----
\ No newline at end of file
+resp1 = client.cat.recovery()
+print(resp1)
+----
diff --git a/docs/examples/2dad2b0c8ba503228f4b11cecca0b348.asciidoc b/docs/examples/2dad2b0c8ba503228f4b11cecca0b348.asciidoc
new file mode 100644
index 000000000..b073c0fa0
--- /dev/null
+++ b/docs/examples/2dad2b0c8ba503228f4b11cecca0b348.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-migrate-data-stream-from-ilm-to-dsl.asciidoc:222
+
+[source, python]
+----
+resp = client.indices.put_data_lifecycle(
+ name="dsl-data-stream",
+ data_retention="7d",
+)
+print(resp)
+----
diff --git a/docs/examples/2de6885bacb8769b8f22dce253c96b0c.asciidoc b/docs/examples/2de6885bacb8769b8f22dce253c96b0c.asciidoc
new file mode 100644
index 000000000..4b1cfdc52
--- /dev/null
+++ b/docs/examples/2de6885bacb8769b8f22dce253c96b0c.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/intervals-query.asciidoc:343
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "intervals": {
+ "my_text": {
+ "match": {
+ "query": "hot porridge",
+ "filter": {
+ "script": {
+ "source": "interval.start > 10 && interval.end < 20 && interval.gaps == 0"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2e364833626c9790c042c8f006fcc999.asciidoc b/docs/examples/2e364833626c9790c042c8f006fcc999.asciidoc
new file mode 100644
index 000000000..462c71d73
--- /dev/null
+++ b/docs/examples/2e364833626c9790c042c8f006fcc999.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/multiplexer-tokenfilter.asciidoc:36
+
+[source, python]
+----
+resp = client.indices.create(
+ index="multiplexer_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "filter": [
+ "my_multiplexer"
+ ]
+ }
+ },
+ "filter": {
+ "my_multiplexer": {
+ "type": "multiplexer",
+ "filters": [
+ "lowercase",
+ "lowercase, porter_stem"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2e36fe22051a47e052e349854d9948b9.asciidoc b/docs/examples/2e36fe22051a47e052e349854d9948b9.asciidoc
new file mode 100644
index 000000000..84d55190c
--- /dev/null
+++ b/docs/examples/2e36fe22051a47e052e349854d9948b9.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// search/explain.asciidoc:192
+
+[source, python]
+----
+resp = client.explain(
+ index="my-index-000001",
+ id="0",
+ q="message:search",
+)
+print(resp)
+----
diff --git a/docs/examples/2e3d1b293da93f2a9ecfc26786ec28d6.asciidoc b/docs/examples/2e3d1b293da93f2a9ecfc26786ec28d6.asciidoc
new file mode 100644
index 000000000..3885eb500
--- /dev/null
+++ b/docs/examples/2e3d1b293da93f2a9ecfc26786ec28d6.asciidoc
@@ -0,0 +1,156 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-manual.asciidoc:60
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my-data-stream-template",
+ index_patterns=[
+ "my-data-stream*"
+ ],
+ data_stream={},
+ template={
+ "settings": {
+ "index": {
+ "mode": "time_series",
+ "routing_path": [
+ "kubernetes.namespace",
+ "kubernetes.host",
+ "kubernetes.node",
+ "kubernetes.pod"
+ ],
+ "number_of_replicas": 0,
+ "number_of_shards": 2
+ }
+ },
+ "mappings": {
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ },
+ "kubernetes": {
+ "properties": {
+ "container": {
+ "properties": {
+ "cpu": {
+ "properties": {
+ "usage": {
+ "properties": {
+ "core": {
+ "properties": {
+ "ns": {
+ "type": "long"
+ }
+ }
+ },
+ "limit": {
+ "properties": {
+ "pct": {
+ "type": "float"
+ }
+ }
+ },
+ "nanocores": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ },
+ "node": {
+ "properties": {
+ "pct": {
+ "type": "float"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "memory": {
+ "properties": {
+ "available": {
+ "properties": {
+ "bytes": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ }
+ }
+ },
+ "majorpagefaults": {
+ "type": "long"
+ },
+ "pagefaults": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ },
+ "rss": {
+ "properties": {
+ "bytes": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ }
+ }
+ },
+ "usage": {
+ "properties": {
+ "bytes": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ },
+ "limit": {
+ "properties": {
+ "pct": {
+ "type": "float"
+ }
+ }
+ },
+ "node": {
+ "properties": {
+ "pct": {
+ "type": "float"
+ }
+ }
+ }
+ }
+ },
+ "workingset": {
+ "properties": {
+ "bytes": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ }
+ }
+ }
+ }
+ },
+ "name": {
+ "type": "keyword"
+ },
+ "start_time": {
+ "type": "date"
+ }
+ }
+ },
+ "host": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "namespace": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "node": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "pod": {
+ "type": "keyword",
+ "time_series_dimension": True
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2e796e5ca59768d4426abbf9a049db3e.asciidoc b/docs/examples/2e796e5ca59768d4426abbf9a049db3e.asciidoc
new file mode 100644
index 000000000..11dd4351b
--- /dev/null
+++ b/docs/examples/2e796e5ca59768d4426abbf9a049db3e.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/split-index.asciidoc:169
+
+[source, python]
+----
+resp = client.indices.split(
+ index="my_source_index",
+ target="my_target_index",
+ settings={
+ "index.number_of_shards": 2
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2e7f4b9be999422a12abb680572b13c8.asciidoc b/docs/examples/2e7f4b9be999422a12abb680572b13c8.asciidoc
new file mode 100644
index 000000000..14b98a120
--- /dev/null
+++ b/docs/examples/2e7f4b9be999422a12abb680572b13c8.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/apis/get-lifecycle.asciidoc:76
+
+[source, python]
+----
+resp = client.ilm.get_lifecycle(
+ name="my_policy",
+)
+print(resp)
+----
diff --git a/docs/examples/2e847378ba26aa64d40186b6e3e6a1da.asciidoc b/docs/examples/2e847378ba26aa64d40186b6e3e6a1da.asciidoc
index 9449ddf4d..c5bb018d0 100644
--- a/docs/examples/2e847378ba26aa64d40186b6e3e6a1da.asciidoc
+++ b/docs/examples/2e847378ba26aa64d40186b6e3e6a1da.asciidoc
@@ -1,19 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/unsigned_long.asciidoc:159
[source, python]
----
resp = client.search(
index="my_index",
- body={
- "query": {
- "script_score": {
- "query": {"match_all": {}},
- "script": {
- "source": "field('my_counter').asBigInteger(BigInteger.ZERO).floatValue()"
- },
+ query={
+ "script_score": {
+ "query": {
+ "match_all": {}
+ },
+ "script": {
+ "source": "field('my_counter').asBigInteger(BigInteger.ZERO).floatValue()"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2e93eaaebf75fa4a2451e8a76ffa9f20.asciidoc b/docs/examples/2e93eaaebf75fa4a2451e8a76ffa9f20.asciidoc
new file mode 100644
index 000000000..50db70cd0
--- /dev/null
+++ b/docs/examples/2e93eaaebf75fa4a2451e8a76ffa9f20.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:105
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my-data-stream-template",
+ index_patterns=[
+ "my-data-stream*"
+ ],
+ data_stream={},
+ priority=500,
+ template={
+ "mappings": {
+ "properties": {
+ "message": {
+ "type": "text"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2ebcdd00ccbf26b4c8e6d9c80dfb3d55.asciidoc b/docs/examples/2ebcdd00ccbf26b4c8e6d9c80dfb3d55.asciidoc
index ff105c179..8047dd4e6 100644
--- a/docs/examples/2ebcdd00ccbf26b4c8e6d9c80dfb3d55.asciidoc
+++ b/docs/examples/2ebcdd00ccbf26b4c8e6d9c80dfb3d55.asciidoc
@@ -1,18 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:170
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "linestring",
"coordinates": [
- [-377.03653, 389.897676],
- [-377.009051, 389.889939],
- ],
+ [
+ -377.03653,
+ 389.897676
+ ],
+ [
+ -377.009051,
+ 389.889939
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2ec8d757188349a4630e120ba2c98c3b.asciidoc b/docs/examples/2ec8d757188349a4630e120ba2c98c3b.asciidoc
new file mode 100644
index 000000000..948393870
--- /dev/null
+++ b/docs/examples/2ec8d757188349a4630e120ba2c98c3b.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/pattern_replace-tokenfilter.asciidoc:36
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ {
+ "type": "pattern_replace",
+ "pattern": "(dog)",
+ "replacement": "watch$1"
+ }
+ ],
+ text="foxes jump lazy dogs",
+)
+print(resp)
+----
diff --git a/docs/examples/2ee002e60bd7a38d466e5f0eb0c38946.asciidoc b/docs/examples/2ee002e60bd7a38d466e5f0eb0c38946.asciidoc
new file mode 100644
index 000000000..0da4d008c
--- /dev/null
+++ b/docs/examples/2ee002e60bd7a38d466e5f0eb0c38946.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:373
+
+[source, python]
+----
+resp = client.indices.update_aliases(
+ actions=[
+ {
+ "add": {
+ "index": "my-index-2099.05.06-000001",
+ "alias": "my-alias",
+ "routing": "1"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/2ee239df3243c98418f7d9a5c7be4cfd.asciidoc b/docs/examples/2ee239df3243c98418f7d9a5c7be4cfd.asciidoc
new file mode 100644
index 000000000..d916e38fa
--- /dev/null
+++ b/docs/examples/2ee239df3243c98418f7d9a5c7be4cfd.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/flatten-graph-tokenfilter.asciidoc:203
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_custom_index_analyzer": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "my_custom_word_delimiter_graph_filter",
+ "flatten_graph"
+ ]
+ }
+ },
+ "filter": {
+ "my_custom_word_delimiter_graph_filter": {
+ "type": "word_delimiter_graph",
+ "catenate_all": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2eebaeb3983a04ef7a9201c1f4d40dc1.asciidoc b/docs/examples/2eebaeb3983a04ef7a9201c1f4d40dc1.asciidoc
new file mode 100644
index 000000000..a11b6598c
--- /dev/null
+++ b/docs/examples/2eebaeb3983a04ef7a9201c1f4d40dc1.asciidoc
@@ -0,0 +1,62 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/dissect-syntax.asciidoc:204
+
+[source, python]
+----
+resp = client.bulk(
+ index="my-index",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:30:17-05:00",
+ "message": "40.135.0.0 - - [30/Apr/2020:14:30:17 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:30:53-05:00",
+ "message": "232.0.0.0 - - [30/Apr/2020:14:30:53 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:31:12-05:00",
+ "message": "26.1.0.0 - - [30/Apr/2020:14:31:12 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:31:19-05:00",
+ "message": "247.37.0.0 - - [30/Apr/2020:14:31:19 -0500] \"GET /french/splash_inet.html HTTP/1.0\" 200 3781"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:31:22-05:00",
+ "message": "247.37.0.0 - - [30/Apr/2020:14:31:22 -0500] \"GET /images/hm_nbg.jpg HTTP/1.0\" 304 0"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:31:27-05:00",
+ "message": "252.0.0.0 - - [30/Apr/2020:14:31:27 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:31:28-05:00",
+ "message": "not a valid apache log"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/2f07b81fd47ec3b074242a760f0c4e9e.asciidoc b/docs/examples/2f07b81fd47ec3b074242a760f0c4e9e.asciidoc
index 084007853..5f4e810a8 100644
--- a/docs/examples/2f07b81fd47ec3b074242a760f0c4e9e.asciidoc
+++ b/docs/examples/2f07b81fd47ec3b074242a760f0c4e9e.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/slowlog.asciidoc:149
[source, python]
----
resp = client.indices.put_settings(
index="my-index-000001",
- body={"index.indexing.slowlog.include.user": True},
+ settings={
+ "index.indexing.slowlog.include.user": True
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2f0b2181c434a879a23b4643bdd92575.asciidoc b/docs/examples/2f0b2181c434a879a23b4643bdd92575.asciidoc
new file mode 100644
index 000000000..67cf5f704
--- /dev/null
+++ b/docs/examples/2f0b2181c434a879a23b4643bdd92575.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-settings.asciidoc:76
+
+[source, python]
+----
+resp = client.indices.get_settings(
+ index="my-index-000001,my-index-000002",
+)
+print(resp)
+
+resp1 = client.indices.get_settings(
+ index="_all",
+)
+print(resp1)
+
+resp2 = client.indices.get_settings(
+ index="log_2099_*",
+)
+print(resp2)
+----
diff --git a/docs/examples/2f195eeb93229e40c4d8f1a6ab4a358c.asciidoc b/docs/examples/2f195eeb93229e40c4d8f1a6ab4a358c.asciidoc
new file mode 100644
index 000000000..9705be33d
--- /dev/null
+++ b/docs/examples/2f195eeb93229e40c4d8f1a6ab4a358c.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/fingerprint.asciidoc:39
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "processors": [
+ {
+ "fingerprint": {
+ "fields": [
+ "user"
+ ]
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_source": {
+ "user": {
+ "last_name": "Smith",
+ "first_name": "John",
+ "date_of_birth": "1980-01-15",
+ "is_active": True
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/2f2580ea420e1836d922fe48fa8ada97.asciidoc b/docs/examples/2f2580ea420e1836d922fe48fa8ada97.asciidoc
new file mode 100644
index 000000000..403ea20b7
--- /dev/null
+++ b/docs/examples/2f2580ea420e1836d922fe48fa8ada97.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/auto-follow/delete-auto-follow-pattern.asciidoc:33
+
+[source, python]
+----
+resp = client.ccr.delete_auto_follow_pattern(
+ name="",
+)
+print(resp)
+----
diff --git a/docs/examples/2f2fd35905feef0b561c05d70c7064c1.asciidoc b/docs/examples/2f2fd35905feef0b561c05d70c7064c1.asciidoc
index 2ade0d3bb..98ad01d8c 100644
--- a/docs/examples/2f2fd35905feef0b561c05d70c7064c1.asciidoc
+++ b/docs/examples/2f2fd35905feef0b561c05d70c7064c1.asciidoc
@@ -1,4 +1,5 @@
-// mapping/dynamic/templates.asciidoc:570
+// This file is autogenerated, DO NOT EDIT
+// migration/migrate_8_0/migrate_to_java_time.asciidoc:239
[source, python]
----
@@ -6,4 +7,4 @@ resp = client.indices.get_mapping(
index="my-index-000001",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2f4a55dfeba8851b306ef9c1b216ef54.asciidoc b/docs/examples/2f4a55dfeba8851b306ef9c1b216ef54.asciidoc
index c8f7d32ac..bf82df633 100644
--- a/docs/examples/2f4a55dfeba8851b306ef9c1b216ef54.asciidoc
+++ b/docs/examples/2f4a55dfeba8851b306ef9c1b216ef54.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/flattened.asciidoc:85
[source, python]
----
resp = client.search(
index="bug_reports",
- body={"query": {"term": {"labels.release": "v1.3.0"}}},
+ query={
+ "term": {
+ "labels.release": "v1.3.0"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2f4e28c81db47547ad39d0926babab12.asciidoc b/docs/examples/2f4e28c81db47547ad39d0926babab12.asciidoc
new file mode 100644
index 000000000..0d2809398
--- /dev/null
+++ b/docs/examples/2f4e28c81db47547ad39d0926babab12.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:689
+
+[source, python]
+----
+resp = client.indices.create(
+ index="estonian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "estonian_stop": {
+ "type": "stop",
+ "stopwords": "_estonian_"
+ },
+ "estonian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "näide"
+ ]
+ },
+ "estonian_stemmer": {
+ "type": "stemmer",
+ "language": "estonian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_estonian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "estonian_stop",
+ "estonian_keywords",
+ "estonian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc b/docs/examples/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc
new file mode 100644
index 000000000..00612b5df
--- /dev/null
+++ b/docs/examples/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// migration/migrate_8_0/index-setting-changes.asciidoc:48
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my-index-000001",
+ settings={
+ "index.merge.policy.max_merge_at_once_explicit": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2f9574fee2ebecd6f7d917ee99b26bcc.asciidoc b/docs/examples/2f9574fee2ebecd6f7d917ee99b26bcc.asciidoc
new file mode 100644
index 000000000..1017daeec
--- /dev/null
+++ b/docs/examples/2f9574fee2ebecd6f7d917ee99b26bcc.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/doc-values.asciidoc:65
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "status_code": {
+ "type": "keyword"
+ },
+ "session_id": {
+ "type": "keyword",
+ "doc_values": False
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2f98924c3d593ea2b60edb9cef5bee22.asciidoc b/docs/examples/2f98924c3d593ea2b60edb9cef5bee22.asciidoc
new file mode 100644
index 000000000..fde28aa80
--- /dev/null
+++ b/docs/examples/2f98924c3d593ea2b60edb9cef5bee22.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/size-your-shards.asciidoc:482
+
+[source, python]
+----
+resp = client.indices.forcemerge(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/2fa45d74ba9933188c4728f8a9e5372c.asciidoc b/docs/examples/2fa45d74ba9933188c4728f8a9e5372c.asciidoc
index 14b05addd..77603a312 100644
--- a/docs/examples/2fa45d74ba9933188c4728f8a9e5372c.asciidoc
+++ b/docs/examples/2fa45d74ba9933188c4728f8a9e5372c.asciidoc
@@ -1,23 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// docs/index_.asciidoc:227
[source, python]
----
resp = client.cluster.put_settings(
- body={
- "persistent": {
- "action.auto_create_index": "my-index-000001,index10,-index1*,+ind*"
- }
+ persistent={
+ "action.auto_create_index": "my-index-000001,index10,-index1*,+ind*"
},
)
print(resp)
-resp = client.cluster.put_settings(
- body={"persistent": {"action.auto_create_index": "false"}},
+resp1 = client.cluster.put_settings(
+ persistent={
+ "action.auto_create_index": "false"
+ },
)
-print(resp)
+print(resp1)
-resp = client.cluster.put_settings(
- body={"persistent": {"action.auto_create_index": "true"}},
+resp2 = client.cluster.put_settings(
+ persistent={
+ "action.auto_create_index": "true"
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/2fa7ded8515b32f26c54394ea598f573.asciidoc b/docs/examples/2fa7ded8515b32f26c54394ea598f573.asciidoc
new file mode 100644
index 000000000..4dcbb9d05
--- /dev/null
+++ b/docs/examples/2fa7ded8515b32f26c54394ea598f573.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/index-templates.asciidoc:120
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="template_1",
+ index_patterns=[
+ "te*",
+ "bar*"
+ ],
+ template={
+ "settings": {
+ "number_of_shards": 1
+ },
+ "mappings": {
+ "_source": {
+ "enabled": True
+ },
+ "properties": {
+ "host_name": {
+ "type": "keyword"
+ },
+ "created_at": {
+ "type": "date",
+ "format": "EEE MMM dd HH:mm:ss Z yyyy"
+ }
+ }
+ },
+ "aliases": {
+ "mydata": {}
+ }
+ },
+ priority=500,
+ composed_of=[
+ "component_template1",
+ "runtime_component_template"
+ ],
+ version=3,
+ meta={
+ "description": "my custom"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/2fc2c790a85be29bbcba50bdde1493f4.asciidoc b/docs/examples/2fc2c790a85be29bbcba50bdde1493f4.asciidoc
new file mode 100644
index 000000000..2dc0632ba
--- /dev/null
+++ b/docs/examples/2fc2c790a85be29bbcba50bdde1493f4.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:225
+
+[source, python]
+----
+resp = client.snapshot.get(
+ repository="my_repository",
+ snapshot="my_snapshot_2099.05.06",
+)
+print(resp)
+----
diff --git a/docs/examples/2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc b/docs/examples/2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc
index cbc310315..822d66bd1 100644
--- a/docs/examples/2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc
+++ b/docs/examples/2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc
@@ -1,9 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// cluster/update-settings.asciidoc:123
[source, python]
----
resp = client.cluster.put_settings(
- body={"transient": {"indices.recovery.*": None}},
+ transient={
+ "indices.recovery.*": None
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2fd0b3c132b46aa34cc9d92dd2d4bc85.asciidoc b/docs/examples/2fd0b3c132b46aa34cc9d92dd2d4bc85.asciidoc
new file mode 100644
index 000000000..0a9a2d01f
--- /dev/null
+++ b/docs/examples/2fd0b3c132b46aa34cc9d92dd2d4bc85.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/common-grams-tokenfilter.asciidoc:28
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ {
+ "type": "common_grams",
+ "common_words": [
+ "is",
+ "the"
+ ]
+ }
+ ],
+ text="the quick fox is brown",
+)
+print(resp)
+----
diff --git a/docs/examples/2fd458d37aab509fe2d970c0b6e2a10f.asciidoc b/docs/examples/2fd458d37aab509fe2d970c0b6e2a10f.asciidoc
new file mode 100644
index 000000000..54adac201
--- /dev/null
+++ b/docs/examples/2fd458d37aab509fe2d970c0b6e2a10f.asciidoc
@@ -0,0 +1,59 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/tsds-reindex.asciidoc:168
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="destination_template",
+ template={
+ "settings": {
+ "index": {
+ "number_of_replicas": 0,
+ "number_of_shards": 4,
+ "mode": "time_series",
+ "routing_path": [
+ "metricset"
+ ],
+ "time_series": {
+ "end_time": "2023-09-01T14:00:00.000Z",
+ "start_time": "2023-09-01T06:00:00.000Z"
+ }
+ }
+ },
+ "mappings": {
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ },
+ "metricset": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "k8s": {
+ "properties": {
+ "tx": {
+ "type": "long"
+ },
+ "rx": {
+ "type": "long"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.put_index_template(
+ name="2",
+ index_patterns=[
+ "k8s*"
+ ],
+ composed_of=[
+ "destination_template"
+ ],
+ data_stream={},
+)
+print(resp1)
+----
diff --git a/docs/examples/2fe28d9a91b3081a9ec4601af8fb7b1c.asciidoc b/docs/examples/2fe28d9a91b3081a9ec4601af8fb7b1c.asciidoc
index 07637df5a..08dfe7896 100644
--- a/docs/examples/2fe28d9a91b3081a9ec4601af8fb7b1c.asciidoc
+++ b/docs/examples/2fe28d9a91b3081a9ec4601af8fb7b1c.asciidoc
@@ -1,40 +1,52 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:710
[source, python]
----
resp = client.indices.create(
index="test",
- body={
- "mappings": {
- "dynamic": False,
- "properties": {"text": {"type": "text"}},
+ mappings={
+ "dynamic": False,
+ "properties": {
+ "text": {
+ "type": "text"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="test",
- refresh="true",
- body={"text": "words words", "flag": "bar"},
+ refresh=True,
+ document={
+ "text": "words words",
+ "flag": "bar"
+ },
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="test",
- refresh="true",
- body={"text": "words words", "flag": "foo"},
+ refresh=True,
+ document={
+ "text": "words words",
+ "flag": "foo"
+ },
)
-print(resp)
+print(resp2)
-resp = client.indices.put_mapping(
+resp3 = client.indices.put_mapping(
index="test",
- body={
- "properties": {
- "text": {"type": "text"},
- "flag": {"type": "text", "analyzer": "keyword"},
+ properties={
+ "text": {
+ "type": "text"
+ },
+ "flag": {
+ "type": "text",
+ "analyzer": "keyword"
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp3)
+----
diff --git a/docs/examples/2fea3e324939cc7e9c396964aeee7111.asciidoc b/docs/examples/2fea3e324939cc7e9c396964aeee7111.asciidoc
index 7b216045b..339421498 100644
--- a/docs/examples/2fea3e324939cc7e9c396964aeee7111.asciidoc
+++ b/docs/examples/2fea3e324939cc7e9c396964aeee7111.asciidoc
@@ -1,19 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/match-query.asciidoc:252
[source, python]
----
resp = client.search(
- body={
- "query": {
- "match": {
- "message": {
- "query": "to be or not to be",
- "operator": "and",
- "zero_terms_query": "all",
- }
+ query={
+ "match": {
+ "message": {
+ "query": "to be or not to be",
+ "operator": "and",
+ "zero_terms_query": "all"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/2fee452baff92b409cbfc8d71eb5fc0e.asciidoc b/docs/examples/2fee452baff92b409cbfc8d71eb5fc0e.asciidoc
new file mode 100644
index 000000000..cb576f087
--- /dev/null
+++ b/docs/examples/2fee452baff92b409cbfc8d71eb5fc0e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/nodes.asciidoc:352
+
+[source, python]
+----
+resp = client.cat.nodes(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/2ffa953b29ed0156c9e610daf66b8e48.asciidoc b/docs/examples/2ffa953b29ed0156c9e610daf66b8e48.asciidoc
new file mode 100644
index 000000000..b6c5a0baa
--- /dev/null
+++ b/docs/examples/2ffa953b29ed0156c9e610daf66b8e48.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/ilm-tutorial.asciidoc:410
+
+[source, python]
+----
+resp = client.ilm.explain_lifecycle(
+ index="timeseries-*",
+)
+print(resp)
+----
diff --git a/docs/examples/300576666769b78fa6fa26b232837f81.asciidoc b/docs/examples/300576666769b78fa6fa26b232837f81.asciidoc
new file mode 100644
index 000000000..e0c8d0f52
--- /dev/null
+++ b/docs/examples/300576666769b78fa6fa26b232837f81.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/apis/get-autoscaling-capacity.asciidoc:16
+
+[source, python]
+----
+resp = client.autoscaling.get_autoscaling_capacity()
+print(resp)
+----
diff --git a/docs/examples/305c4cfb2ad4b58b4c319ffbf32336cc.asciidoc b/docs/examples/305c4cfb2ad4b58b4c319ffbf32336cc.asciidoc
new file mode 100644
index 000000000..577ba66ba
--- /dev/null
+++ b/docs/examples/305c4cfb2ad4b58b4c319ffbf32336cc.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:143
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ script_fields={
+ "my_doubled_field": {
+ "script": {
+ "lang": "painless",
+ "source": "doc['my_field'].value * params.get('multiplier');",
+ "params": {
+ "multiplier": 2
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3082ae0c3ecdc61808103214631b40c6.asciidoc b/docs/examples/3082ae0c3ecdc61808103214631b40c6.asciidoc
new file mode 100644
index 000000000..266173d42
--- /dev/null
+++ b/docs/examples/3082ae0c3ecdc61808103214631b40c6.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/avg-bucket-aggregation.asciidoc:57
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "avg_monthly_sales": {
+ "avg_bucket": {
+ "buckets_path": "sales_per_month>sales",
+ "gap_policy": "skip",
+ "format": "#,##0.00;(#,##0.00)"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/309f0721145b5c656338a02459c3ff1e.asciidoc b/docs/examples/309f0721145b5c656338a02459c3ff1e.asciidoc
new file mode 100644
index 000000000..2e406a444
--- /dev/null
+++ b/docs/examples/309f0721145b5c656338a02459c3ff1e.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/rank-feature-query.asciidoc:254
+
+[source, python]
+----
+resp = client.search(
+ index="test",
+ query={
+ "rank_feature": {
+ "field": "pagerank",
+ "saturation": {
+ "pivot": 8
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/30abc76a39e551f4b52c65002bb6405d.asciidoc b/docs/examples/30abc76a39e551f4b52c65002bb6405d.asciidoc
new file mode 100644
index 000000000..b126f55e5
--- /dev/null
+++ b/docs/examples/30abc76a39e551f4b52c65002bb6405d.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:279
+
+[source, python]
+----
+resp = client.security.get_api_key(
+ username="myuser",
+ realm_name="native1",
+)
+print(resp)
+----
diff --git a/docs/examples/30bd3c0785f3df4795684754adeb5ecb.asciidoc b/docs/examples/30bd3c0785f3df4795684754adeb5ecb.asciidoc
new file mode 100644
index 000000000..881976fc1
--- /dev/null
+++ b/docs/examples/30bd3c0785f3df4795684754adeb5ecb.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:97
+
+[source, python]
+----
+resp = client.render_search_template(
+ source={
+ "query": {
+ "match": {
+ "message": "{{query_string}}"
+ }
+ },
+ "from": "{{from}}",
+ "size": "{{size}}"
+ },
+ params={
+ "query_string": "hello world",
+ "from": 20,
+ "size": 10
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/30db2702dd0071c72a090b8311d0db09.asciidoc b/docs/examples/30db2702dd0071c72a090b8311d0db09.asciidoc
new file mode 100644
index 000000000..fd8590a63
--- /dev/null
+++ b/docs/examples/30db2702dd0071c72a090b8311d0db09.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/tophits-aggregation.asciidoc:201
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ query={
+ "match": {
+ "body": "elections"
+ }
+ },
+ aggs={
+ "top_sites": {
+ "terms": {
+ "field": "domain",
+ "order": {
+ "top_hit": "desc"
+ }
+ },
+ "aggs": {
+ "top_tags_hits": {
+ "top_hits": {}
+ },
+ "top_hit": {
+ "max": {
+ "script": {
+ "source": "_score"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/30f3e3b9df46afd12e68bc71f18483b4.asciidoc b/docs/examples/30f3e3b9df46afd12e68bc71f18483b4.asciidoc
index 7d7924041..7b431ccc1 100644
--- a/docs/examples/30f3e3b9df46afd12e68bc71f18483b4.asciidoc
+++ b/docs/examples/30f3e3b9df46afd12e68bc71f18483b4.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:125
[source, python]
@@ -7,18 +8,22 @@ resp = client.indices.create(
)
print(resp)
-resp = client.indices.create(
+resp1 = client.indices.create(
index="my-index-000002",
)
-print(resp)
+print(resp1)
-resp = client.indices.put_mapping(
- index=["my-index-000001", "my-index-000002"],
- body={
- "properties": {
- "user": {"properties": {"name": {"type": "keyword"}}}
+resp2 = client.indices.put_mapping(
+ index="my-index-000001,my-index-000002",
+ properties={
+ "user": {
+ "properties": {
+ "name": {
+ "type": "keyword"
+ }
+ }
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/30fa37c9575fe81a0ea7c12cfc08e277.asciidoc b/docs/examples/30fa37c9575fe81a0ea7c12cfc08e277.asciidoc
new file mode 100644
index 000000000..d88fd482b
--- /dev/null
+++ b/docs/examples/30fa37c9575fe81a0ea7c12cfc08e277.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/copy-to.asciidoc:71
+
+[source, python]
+----
+resp = client.indices.create(
+ index="bad_example_index",
+ mappings={
+ "properties": {
+ "field_1": {
+ "type": "text",
+ "copy_to": "field_2"
+ },
+ "field_2": {
+ "type": "text",
+ "copy_to": "field_3"
+ },
+ "field_3": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3166455372f2d96622caff076e91ebe7.asciidoc b/docs/examples/3166455372f2d96622caff076e91ebe7.asciidoc
new file mode 100644
index 000000000..bcc74217a
--- /dev/null
+++ b/docs/examples/3166455372f2d96622caff076e91ebe7.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:308
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "percolate": {
+ "field": "query",
+ "index": "my-index-000001",
+ "id": "2",
+ "version": 1
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/316cd43feb3b86396483903af1a048b1.asciidoc b/docs/examples/316cd43feb3b86396483903af1a048b1.asciidoc
index 0641456c4..9c12345fe 100644
--- a/docs/examples/316cd43feb3b86396483903af1a048b1.asciidoc
+++ b/docs/examples/316cd43feb3b86396483903af1a048b1.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:782
[source, python]
@@ -5,17 +6,15 @@
resp = client.search(
index="sales",
size="0",
- body={
- "aggs": {
- "sale_date": {
- "date_histogram": {
- "field": "date",
- "calendar_interval": "year",
- "missing": "2000/01/01",
- }
+ aggs={
+ "sale_date": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "year",
+ "missing": "2000/01/01"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3182f26c61fbe5cf89400804533d5ed2.asciidoc b/docs/examples/3182f26c61fbe5cf89400804533d5ed2.asciidoc
new file mode 100644
index 000000000..df32b554b
--- /dev/null
+++ b/docs/examples/3182f26c61fbe5cf89400804533d5ed2.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:808
+
+[source, python]
+----
+resp = client.render_search_template(
+ id="my-search-template",
+ params={
+ "query_string": "My string",
+ "text_fields": [
+ {
+ "user_name": "John"
+ },
+ {
+ "user_name": "kimchy"
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/318e209cc4d6f306e65cb2f5598a50b1.asciidoc b/docs/examples/318e209cc4d6f306e65cb2f5598a50b1.asciidoc
index a57d005c7..4a30abed2 100644
--- a/docs/examples/318e209cc4d6f306e65cb2f5598a50b1.asciidoc
+++ b/docs/examples/318e209cc4d6f306e65cb2f5598a50b1.asciidoc
@@ -1,18 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:195
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "LineString",
"coordinates": [
- [-77.03653, 38.897676],
- [-77.009051, 38.889939],
- ],
+ [
+ -77.03653,
+ 38.897676
+ ],
+ [
+ -77.009051,
+ 38.889939
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/31a79a57b242713edec6795599ba0d5d.asciidoc b/docs/examples/31a79a57b242713edec6795599ba0d5d.asciidoc
new file mode 100644
index 000000000..bf220b913
--- /dev/null
+++ b/docs/examples/31a79a57b242713edec6795599ba0d5d.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/semantic-search/field-mappings.asciidoc:15
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index",
+ mappings={
+ "properties": {
+ "my_tokens": {
+ "type": "sparse_vector"
+ },
+ "my_text_field": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/31ab4ec26176857280af630bf84a2823.asciidoc b/docs/examples/31ab4ec26176857280af630bf84a2823.asciidoc
new file mode 100644
index 000000000..46e965fdf
--- /dev/null
+++ b/docs/examples/31ab4ec26176857280af630bf84a2823.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/saml-sp-metadata.asciidoc:42
+
+[source, python]
+----
+resp = client.security.saml_service_provider_metadata(
+ realm_name="saml1",
+)
+print(resp)
+----
diff --git a/docs/examples/31ac1b68dc7c26a1d37350be47ae9381.asciidoc b/docs/examples/31ac1b68dc7c26a1d37350be47ae9381.asciidoc
index 39a50a96a..be8a7bf3e 100644
--- a/docs/examples/31ac1b68dc7c26a1d37350be47ae9381.asciidoc
+++ b/docs/examples/31ac1b68dc7c26a1d37350be47ae9381.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/completion.asciidoc:12
[source, python]
----
resp = client.indices.create(
index="music",
- body={"mappings": {"properties": {"suggest": {"type": "completion"}}}},
+ mappings={
+ "properties": {
+ "suggest": {
+ "type": "completion"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/31aed390c30bd4f42a5c56253695e53f.asciidoc b/docs/examples/31aed390c30bd4f42a5c56253695e53f.asciidoc
new file mode 100644
index 000000000..d93947328
--- /dev/null
+++ b/docs/examples/31aed390c30bd4f42a5c56253695e53f.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/whitespace-analyzer.asciidoc:131
+
+[source, python]
+----
+resp = client.indices.create(
+ index="whitespace_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "rebuilt_whitespace": {
+ "tokenizer": "whitespace",
+ "filter": []
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/31bc93e429ad0de11dd2dd231e8f2c5e.asciidoc b/docs/examples/31bc93e429ad0de11dd2dd231e8f2c5e.asciidoc
new file mode 100644
index 000000000..d76914bba
--- /dev/null
+++ b/docs/examples/31bc93e429ad0de11dd2dd231e8f2c5e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/apis/unfreeze.asciidoc:51
+
+[source, python]
+----
+resp = client.indices.unfreeze(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/31f4400716500149cccbc19aa06bff66.asciidoc b/docs/examples/31f4400716500149cccbc19aa06bff66.asciidoc
new file mode 100644
index 000000000..0caf5ace5
--- /dev/null
+++ b/docs/examples/31f4400716500149cccbc19aa06bff66.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/dangling-index-delete.asciidoc:13
+
+[source, python]
+----
+resp = client.dangling_indices.delete_dangling_index(
+ index_uuid="",
+ accept_data_loss=True,
+)
+print(resp)
+----
diff --git a/docs/examples/320645d771e952af2a67bb7445c3688d.asciidoc b/docs/examples/320645d771e952af2a67bb7445c3688d.asciidoc
new file mode 100644
index 000000000..f29deb5b7
--- /dev/null
+++ b/docs/examples/320645d771e952af2a67bb7445c3688d.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1647
+
+[source, python]
+----
+resp = client.indices.create(
+ index="sorani_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "sorani_stop": {
+ "type": "stop",
+ "stopwords": "_sorani_"
+ },
+ "sorani_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "mînak"
+ ]
+ },
+ "sorani_stemmer": {
+ "type": "stemmer",
+ "language": "sorani"
+ }
+ },
+ "analyzer": {
+ "rebuilt_sorani": {
+ "tokenizer": "standard",
+ "filter": [
+ "sorani_normalization",
+ "lowercase",
+ "decimal_digit",
+ "sorani_stop",
+ "sorani_keywords",
+ "sorani_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/32123981430e5a8b34fe14314fc48429.asciidoc b/docs/examples/32123981430e5a8b34fe14314fc48429.asciidoc
new file mode 100644
index 000000000..0b6646b9d
--- /dev/null
+++ b/docs/examples/32123981430e5a8b34fe14314fc48429.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-multiple-indices.asciidoc:11
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001,my-index-000002",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3218f8ccd59c8c90349816e0428e8fb8.asciidoc b/docs/examples/3218f8ccd59c8c90349816e0428e8fb8.asciidoc
new file mode 100644
index 000000000..cdc58299a
--- /dev/null
+++ b/docs/examples/3218f8ccd59c8c90349816e0428e8fb8.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/circuit-breaker-errors.asciidoc:92
+
+[source, python]
+----
+resp = client.indices.clear_cache(
+ fielddata=True,
+)
+print(resp)
+----
diff --git a/docs/examples/3250a8d2d2a9619035040e55a03620b9.asciidoc b/docs/examples/3250a8d2d2a9619035040e55a03620b9.asciidoc
new file mode 100644
index 000000000..664c211b1
--- /dev/null
+++ b/docs/examples/3250a8d2d2a9619035040e55a03620b9.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/network/tracers.asciidoc:46
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "logger.org.elasticsearch.http.HttpTracer": "TRACE",
+ "logger.org.elasticsearch.http.HttpBodyTracer": "TRACE"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/327466380bcd55361973b4a96c6dccb2.asciidoc b/docs/examples/327466380bcd55361973b4a96c6dccb2.asciidoc
new file mode 100644
index 000000000..307952a06
--- /dev/null
+++ b/docs/examples/327466380bcd55361973b4a96c6dccb2.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1697
+
+[source, python]
+----
+resp = client.indices.create(
+ index="spanish_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "spanish_stop": {
+ "type": "stop",
+ "stopwords": "_spanish_"
+ },
+ "spanish_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "ejemplo"
+ ]
+ },
+ "spanish_stemmer": {
+ "type": "stemmer",
+ "language": "light_spanish"
+ }
+ },
+ "analyzer": {
+ "rebuilt_spanish": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "spanish_stop",
+ "spanish_keywords",
+ "spanish_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/32a7acdfb7046966b28f394476c99126.asciidoc b/docs/examples/32a7acdfb7046966b28f394476c99126.asciidoc
index 6b09d64d9..de996666a 100644
--- a/docs/examples/32a7acdfb7046966b28f394476c99126.asciidoc
+++ b/docs/examples/32a7acdfb7046966b28f394476c99126.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:153
[source, python]
----
resp = client.index(
index="example",
- body={"location": "POINT (-377.03653 389.897676)"},
+ document={
+ "location": "POINT (-377.03653 389.897676)"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/32af23a4b0fea6c81c4688ce5fe4ac35.asciidoc b/docs/examples/32af23a4b0fea6c81c4688ce5fe4ac35.asciidoc
new file mode 100644
index 000000000..c5404e5dc
--- /dev/null
+++ b/docs/examples/32af23a4b0fea6c81c4688ce5fe4ac35.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-rank-aggregation.asciidoc:184
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_ranks": {
+ "percentile_ranks": {
+ "field": "load_time",
+ "values": [
+ 500,
+ 600
+ ],
+ "hdr": {
+ "number_of_significant_value_digits": 3
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/32b7963c5cabbe9cc7d15da62f5edda9.asciidoc b/docs/examples/32b7963c5cabbe9cc7d15da62f5edda9.asciidoc
new file mode 100644
index 000000000..bb4f229f4
--- /dev/null
+++ b/docs/examples/32b7963c5cabbe9cc7d15da62f5edda9.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/update-user-profile-data.asciidoc:118
+
+[source, python]
+----
+resp = client.security.update_user_profile_data(
+ uid="u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0",
+ labels={
+ "direction": "west"
+ },
+ data={
+ "app1": {
+ "font": "large"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/32b8a5152b47930f2e16c40c8615c7bb.asciidoc b/docs/examples/32b8a5152b47930f2e16c40c8615c7bb.asciidoc
new file mode 100644
index 000000000..52702d084
--- /dev/null
+++ b/docs/examples/32b8a5152b47930f2e16c40c8615c7bb.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-client.asciidoc:286
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my-example-app",
+ search_application={
+ "indices": [
+ "example-index"
+ ],
+ "template": {
+ "script": {
+ "lang": "mustache",
+ "source": "\n {\n \"query\": {\n \"bool\": {\n \"must\": [\n {{#query}}\n {\n \"multi_match\" : {\n \"query\": \"{{query}}\",\n \"fields\": [ \"title^4\", \"plot\", \"actors\", \"directors\" ]\n }\n },\n {\n \"multi_match\" : {\n \"query\": \"{{query}}\",\n \"type\": \"phrase_prefix\",\n \"fields\": [ \"title^4\", \"plot\"]\n }\n },\n {{/query}}\n ],\n \"filter\": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n \"aggs\": {{#toJson}}_es_aggs{{/toJson}},\n \"from\": {{from}},\n \"size\": {{size}},\n \"sort\": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ",
+ "params": {
+ "query": "",
+ "_es_filters": {},
+ "_es_aggs": {},
+ "_es_sort_fields": {},
+ "size": 10,
+ "from": 0
+ },
+ "dictionary": {}
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/32cd57666bc80b8cf793d06fa1086669.asciidoc b/docs/examples/32cd57666bc80b8cf793d06fa1086669.asciidoc
new file mode 100644
index 000000000..13dc5bdb5
--- /dev/null
+++ b/docs/examples/32cd57666bc80b8cf793d06fa1086669.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:203
+
+[source, python]
+----
+resp = client.sql.query(
+ format="tsv",
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=5,
+)
+print(resp)
+----
diff --git a/docs/examples/32ce26b8af95f7ccc2a7bd5e77a39d6c.asciidoc b/docs/examples/32ce26b8af95f7ccc2a7bd5e77a39d6c.asciidoc
new file mode 100644
index 000000000..3991d9e2b
--- /dev/null
+++ b/docs/examples/32ce26b8af95f7ccc2a7bd5e77a39d6c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:562
+
+[source, python]
+----
+resp = client.indices.recovery(
+ index="my-index",
+)
+print(resp)
+----
diff --git a/docs/examples/32de5dd306bd014d67053d2f175defcd.asciidoc b/docs/examples/32de5dd306bd014d67053d2f175defcd.asciidoc
new file mode 100644
index 000000000..68792def2
--- /dev/null
+++ b/docs/examples/32de5dd306bd014d67053d2f175defcd.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// security/troubleshooting.asciidoc:748
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "logger.org.elasticsearch.xpack.security.authc.saml": "debug"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/331caebf810a923644eb6de26e5a97f4.asciidoc b/docs/examples/331caebf810a923644eb6de26e5a97f4.asciidoc
index 0991fb2bb..35e9f82ee 100644
--- a/docs/examples/331caebf810a923644eb6de26e5a97f4.asciidoc
+++ b/docs/examples/331caebf810a923644eb6de26e5a97f4.asciidoc
@@ -1,19 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/parent-join.asciidoc:417
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "my_join_field": {
- "type": "join",
- "relations": {"question": ["answer", "comment"]},
+ mappings={
+ "properties": {
+ "my_join_field": {
+ "type": "join",
+ "relations": {
+ "question": [
+ "answer",
+ "comment"
+ ]
}
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3337c817ebd438254505a31e91c91724.asciidoc b/docs/examples/3337c817ebd438254505a31e91c91724.asciidoc
new file mode 100644
index 000000000..5c223af15
--- /dev/null
+++ b/docs/examples/3337c817ebd438254505a31e91c91724.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-data-stream.asciidoc:71
+
+[source, python]
+----
+resp = client.indices.get_data_stream(
+ name="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/3341d3bbb53052447a37c92a04c14b70.asciidoc b/docs/examples/3341d3bbb53052447a37c92a04c14b70.asciidoc
new file mode 100644
index 000000000..b9d4f716e
--- /dev/null
+++ b/docs/examples/3341d3bbb53052447a37c92a04c14b70.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:351
+
+[source, python]
+----
+resp = client.update(
+ index="my-index-000001",
+ id="1",
+ script="ctx._source.new_field = 'value_of_new_field'",
+)
+print(resp)
+----
diff --git a/docs/examples/3343a4cf559060c422d86c786a95e535.asciidoc b/docs/examples/3343a4cf559060c422d86c786a95e535.asciidoc
new file mode 100644
index 000000000..a8bddb235
--- /dev/null
+++ b/docs/examples/3343a4cf559060c422d86c786a95e535.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/apostrophe-tokenfilter.asciidoc:22
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "apostrophe"
+ ],
+ text="Istanbul'a veya Istanbul'dan",
+)
+print(resp)
+----
diff --git a/docs/examples/33610800d9de3c3e6d6b3c611ace7330.asciidoc b/docs/examples/33610800d9de3c3e6d6b3c611ace7330.asciidoc
new file mode 100644
index 000000000..06f9cf273
--- /dev/null
+++ b/docs/examples/33610800d9de3c3e6d6b3c611ace7330.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/tasks.asciidoc:128
+
+[source, python]
+----
+resp = client.tasks.get(
+ task_id="oTUltX4IQMOUUVeiohTt8A:124",
+)
+print(resp)
+----
diff --git a/docs/examples/336613f48dd95ea993dd3bcce264fd0e.asciidoc b/docs/examples/336613f48dd95ea993dd3bcce264fd0e.asciidoc
new file mode 100644
index 000000000..faa2dc223
--- /dev/null
+++ b/docs/examples/336613f48dd95ea993dd3bcce264fd0e.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-allocate.asciidoc:116
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "cold": {
+ "actions": {
+ "allocate": {
+ "require": {
+ "box_type": "cold",
+ "storage": "high"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/33732208fc6e6fe1e8d278299681932e.asciidoc b/docs/examples/33732208fc6e6fe1e8d278299681932e.asciidoc
index 34850898d..fa72ebca2 100644
--- a/docs/examples/33732208fc6e6fe1e8d278299681932e.asciidoc
+++ b/docs/examples/33732208fc6e6fe1e8d278299681932e.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:183
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "LINESTRING (-377.03653 389.897676, -377.009051 389.889939)"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3386fe07e90844dbcdbbe7c07f09e04a.asciidoc b/docs/examples/3386fe07e90844dbcdbbe7c07f09e04a.asciidoc
new file mode 100644
index 000000000..d1902818c
--- /dev/null
+++ b/docs/examples/3386fe07e90844dbcdbbe7c07f09e04a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// synonyms/apis/delete-synonyms-set.asciidoc:61
+
+[source, python]
+----
+resp = client.synonyms.delete_synonym(
+ id="my-synonyms-set",
+)
+print(resp)
+----
diff --git a/docs/examples/33b732bb301e99d2161bd2246494f487.asciidoc b/docs/examples/33b732bb301e99d2161bd2246494f487.asciidoc
new file mode 100644
index 000000000..712fa8f0f
--- /dev/null
+++ b/docs/examples/33b732bb301e99d2161bd2246494f487.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/geo-match-enrich-policy-type-ex.asciidoc:95
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="postal_lookup",
+ processors=[
+ {
+ "enrich": {
+ "description": "Add 'geo_data' based on 'geo_location'",
+ "policy_name": "postal_policy",
+ "field": "geo_location",
+ "target_field": "geo_data",
+ "shape_relation": "INTERSECTS"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/33d480fc6812ada75756cf5337bc9092.asciidoc b/docs/examples/33d480fc6812ada75756cf5337bc9092.asciidoc
new file mode 100644
index 000000000..b2a058e49
--- /dev/null
+++ b/docs/examples/33d480fc6812ada75756cf5337bc9092.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/list-connector-sync-jobs-api.asciidoc:57
+
+[source, python]
+----
+resp = client.perform_request(
+ "GET",
+ "/_connector/_sync_job",
+ params={
+ "from": "0",
+ "size": "2"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/33f148e3d8676de6cc52f58749898a13.asciidoc b/docs/examples/33f148e3d8676de6cc52f58749898a13.asciidoc
index 8951713f0..707144070 100644
--- a/docs/examples/33f148e3d8676de6cc52f58749898a13.asciidoc
+++ b/docs/examples/33f148e3d8676de6cc52f58749898a13.asciidoc
@@ -1,18 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:278
[source, python]
----
resp = client.search(
- body={
- "query": {
- "dis_max": {
- "queries": [
- {"match_phrase_prefix": {"subject": "quick brown f"}},
- {"match_phrase_prefix": {"message": "quick brown f"}},
- ]
- }
+ query={
+ "dis_max": {
+ "queries": [
+ {
+ "match_phrase_prefix": {
+ "subject": "quick brown f"
+ }
+ },
+ {
+ "match_phrase_prefix": {
+ "message": "quick brown f"
+ }
+ }
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/342ddf9121aeddd82fea2464665e25da.asciidoc b/docs/examples/342ddf9121aeddd82fea2464665e25da.asciidoc
new file mode 100644
index 000000000..13694ba05
--- /dev/null
+++ b/docs/examples/342ddf9121aeddd82fea2464665e25da.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/create-connector-api.asciidoc:20
+
+[source, python]
+----
+resp = client.connector.put(
+ connector_id="my-connector",
+ index_name="search-google-drive",
+ name="My Connector",
+ service_type="google_drive",
+)
+print(resp)
+----
diff --git a/docs/examples/343dd09a8c76987e586858be3bdc51eb.asciidoc b/docs/examples/343dd09a8c76987e586858be3bdc51eb.asciidoc
index 42711cb15..35b4b5feb 100644
--- a/docs/examples/343dd09a8c76987e586858be3bdc51eb.asciidoc
+++ b/docs/examples/343dd09a8c76987e586858be3bdc51eb.asciidoc
@@ -1,53 +1,57 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:574
[source, python]
----
resp = client.indices.create(
index="my_queries2",
- body={
- "settings": {
- "analysis": {
- "analyzer": {
- "wildcard_suffix": {
- "type": "custom",
- "tokenizer": "standard",
- "filter": [
- "lowercase",
- "reverse",
- "wildcard_edge_ngram",
- ],
- },
- "wildcard_suffix_search_time": {
- "type": "custom",
- "tokenizer": "standard",
- "filter": ["lowercase", "reverse"],
- },
- },
- "filter": {
- "wildcard_edge_ngram": {
- "type": "edge_ngram",
- "min_gram": 1,
- "max_gram": 32,
- }
+ settings={
+ "analysis": {
+ "analyzer": {
+ "wildcard_suffix": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "reverse",
+ "wildcard_edge_ngram"
+ ]
},
+ "wildcard_suffix_search_time": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "reverse"
+ ]
+ }
+ },
+ "filter": {
+ "wildcard_edge_ngram": {
+ "type": "edge_ngram",
+ "min_gram": 1,
+ "max_gram": 32
+ }
}
- },
- "mappings": {
- "properties": {
- "query": {"type": "percolator"},
- "my_field": {
- "type": "text",
- "fields": {
- "suffix": {
- "type": "text",
- "analyzer": "wildcard_suffix",
- "search_analyzer": "wildcard_suffix_search_time",
- }
- },
- },
+ }
+ },
+ mappings={
+ "properties": {
+ "query": {
+ "type": "percolator"
+ },
+ "my_field": {
+ "type": "text",
+ "fields": {
+ "suffix": {
+ "type": "text",
+ "analyzer": "wildcard_suffix",
+ "search_analyzer": "wildcard_suffix_search_time"
+ }
+ }
}
- },
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/344b4144244d57f87c6aa4652b100b25.asciidoc b/docs/examples/344b4144244d57f87c6aa4652b100b25.asciidoc
index bf1b1dda0..872c0ba9a 100644
--- a/docs/examples/344b4144244d57f87c6aa4652b100b25.asciidoc
+++ b/docs/examples/344b4144244d57f87c6aa4652b100b25.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/terms-query.asciidoc:167
[source, python]
@@ -5,7 +6,9 @@
resp = client.index(
index="my-index-000001",
id="2",
- body={"color": "blue"},
+ document={
+ "color": "blue"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/346f28d82acb5427c304aa574fea0008.asciidoc b/docs/examples/346f28d82acb5427c304aa574fea0008.asciidoc
new file mode 100644
index 000000000..a0683551d
--- /dev/null
+++ b/docs/examples/346f28d82acb5427c304aa574fea0008.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1846
+
+[source, python]
+----
+resp = client.indices.create(
+ index="thai_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "thai_stop": {
+ "type": "stop",
+ "stopwords": "_thai_"
+ }
+ },
+ "analyzer": {
+ "rebuilt_thai": {
+ "tokenizer": "thai",
+ "filter": [
+ "lowercase",
+ "decimal_digit",
+ "thai_stop"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3477a89d869b1f7f72d50c2ca86c4679.asciidoc b/docs/examples/3477a89d869b1f7f72d50c2ca86c4679.asciidoc
new file mode 100644
index 000000000..b92aa95bf
--- /dev/null
+++ b/docs/examples/3477a89d869b1f7f72d50c2ca86c4679.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/activate-watch.asciidoc:82
+
+[source, python]
+----
+resp = client.watcher.activate_watch(
+ watch_id="my_watch",
+)
+print(resp)
+----
diff --git a/docs/examples/3487e60e1ae9d4925ce540cd63574385.asciidoc b/docs/examples/3487e60e1ae9d4925ce540cd63574385.asciidoc
new file mode 100644
index 000000000..a05f3179c
--- /dev/null
+++ b/docs/examples/3487e60e1ae9d4925ce540cd63574385.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/boosting-query.asciidoc:18
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "boosting": {
+ "positive": {
+ "term": {
+ "text": "apple"
+ }
+ },
+ "negative": {
+ "term": {
+ "text": "pie tart fruit crumble tree"
+ }
+ },
+ "negative_boost": 0.5
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/349823d86980d40ac45248c19a59e339.asciidoc b/docs/examples/349823d86980d40ac45248c19a59e339.asciidoc
new file mode 100644
index 000000000..1c77fbf96
--- /dev/null
+++ b/docs/examples/349823d86980d40ac45248c19a59e339.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc:197
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="amazon_bedrock_embeddings",
+ processors=[
+ {
+ "inference": {
+ "model_id": "amazon_bedrock_embeddings",
+ "input_output": {
+ "input_field": "content",
+ "output_field": "content_embedding"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/34be27141e3a476c138546190101c8bc.asciidoc b/docs/examples/34be27141e3a476c138546190101c8bc.asciidoc
new file mode 100644
index 000000000..3cee3576c
--- /dev/null
+++ b/docs/examples/34be27141e3a476c138546190101c8bc.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-vector-tile-api.asciidoc:33
+
+[source, python]
+----
+resp = client.search_mvt(
+ index="my-index",
+ field="my-geo-field",
+ zoom="15",
+ x="5271",
+ y="12710",
+)
+print(resp)
+----
diff --git a/docs/examples/34cdeefb09bbbe5206957a8bc1bd513d.asciidoc b/docs/examples/34cdeefb09bbbe5206957a8bc1bd513d.asciidoc
index 48b222683..41820a845 100644
--- a/docs/examples/34cdeefb09bbbe5206957a8bc1bd513d.asciidoc
+++ b/docs/examples/34cdeefb09bbbe5206957a8bc1bd513d.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/slowlog.asciidoc:66
[source, python]
----
resp = client.indices.put_settings(
index="my-index-000001",
- body={"index.search.slowlog.include.user": True},
+ settings={
+ "index.search.slowlog.include.user": True
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/34d51c54b62e9a160c0ddacc10134bb0.asciidoc b/docs/examples/34d51c54b62e9a160c0ddacc10134bb0.asciidoc
new file mode 100644
index 000000000..d58f6b631
--- /dev/null
+++ b/docs/examples/34d51c54b62e9a160c0ddacc10134bb0.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-first-query.asciidoc:10
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_first": {
+ "match": {
+ "span_term": {
+ "user.id": "kimchy"
+ }
+ },
+ "end": 3
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/34d63740b58209a3d031212909743925.asciidoc b/docs/examples/34d63740b58209a3d031212909743925.asciidoc
new file mode 100644
index 000000000..8feeda994
--- /dev/null
+++ b/docs/examples/34d63740b58209a3d031212909743925.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-search.asciidoc:213
+
+[source, python]
+----
+resp = client.search(
+ index="openai-embeddings",
+ knn={
+ "field": "content_embedding",
+ "query_vector_builder": {
+ "text_embedding": {
+ "model_id": "openai_embeddings",
+ "model_text": "Calculate fuel cost"
+ }
+ },
+ "k": 10,
+ "num_candidates": 100
+ },
+ source=[
+ "id",
+ "content"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/35260b615d0b5628c95d7cc814c39bd3.asciidoc b/docs/examples/35260b615d0b5628c95d7cc814c39bd3.asciidoc
new file mode 100644
index 000000000..95b4adb2f
--- /dev/null
+++ b/docs/examples/35260b615d0b5628c95d7cc814c39bd3.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/has-child-query.asciidoc:141
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "has_child": {
+ "type": "child",
+ "query": {
+ "function_score": {
+ "script_score": {
+ "script": "_score * doc['click_count'].value"
+ }
+ }
+ },
+ "score_mode": "max"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/353020cb30a885ee7f5ce2b141ba574a.asciidoc b/docs/examples/353020cb30a885ee7f5ce2b141ba574a.asciidoc
new file mode 100644
index 000000000..3e9e7d107
--- /dev/null
+++ b/docs/examples/353020cb30a885ee7f5ce2b141ba574a.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/prefix-query.asciidoc:58
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "prefix": {
+ "user": "ki"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc b/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc
index 515516945..f983391dd 100644
--- a/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc
+++ b/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc
@@ -1,9 +1,10 @@
-// health/health.asciidoc:481
+// This file is autogenerated, DO NOT EDIT
+// health/health.asciidoc:480
[source, python]
----
resp = client.health_report(
- verbose="false",
+ verbose=False,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3544f17cb97b613a2f733707c676f759.asciidoc b/docs/examples/3544f17cb97b613a2f733707c676f759.asciidoc
index 6beeba3dd..2407f1ce6 100644
--- a/docs/examples/3544f17cb97b613a2f733707c676f759.asciidoc
+++ b/docs/examples/3544f17cb97b613a2f733707c676f759.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/filter-aggregation.asciidoc:122
[source, python]
@@ -6,19 +7,31 @@ resp = client.search(
index="sales",
size="0",
filter_path="aggregations",
- body={
- "aggs": {
- "f": {
+ aggs={
+ "f": {
+ "filters": {
"filters": {
- "filters": {
- "hats": {"term": {"type": "hat"}},
- "t_shirts": {"term": {"type": "t-shirt"}},
+ "hats": {
+ "term": {
+ "type": "hat"
+ }
+ },
+ "t_shirts": {
+ "term": {
+ "type": "t-shirt"
+ }
}
- },
- "aggs": {"avg_price": {"avg": {"field": "price"}}},
+ }
+ },
+ "aggs": {
+ "avg_price": {
+ "avg": {
+ "field": "price"
+ }
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3545261682af72f4bee57f2bac0a9590.asciidoc b/docs/examples/3545261682af72f4bee57f2bac0a9590.asciidoc
new file mode 100644
index 000000000..7085907ee
--- /dev/null
+++ b/docs/examples/3545261682af72f4bee57f2bac0a9590.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/shard-stores.asciidoc:150
+
+[source, python]
+----
+resp = client.indices.shard_stores(
+ status="green",
+)
+print(resp)
+----
diff --git a/docs/examples/35563ef92dddef9d83906d9c43c60d0f.asciidoc b/docs/examples/35563ef92dddef9d83906d9c43c60d0f.asciidoc
new file mode 100644
index 000000000..5c72ae628
--- /dev/null
+++ b/docs/examples/35563ef92dddef9d83906d9c43c60d0f.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/multi-termvectors.asciidoc:10
+
+[source, python]
+----
+resp = client.mtermvectors(
+ docs=[
+ {
+ "_index": "my-index-000001",
+ "_id": "2",
+ "term_statistics": True
+ },
+ {
+ "_index": "my-index-000001",
+ "_id": "1",
+ "fields": [
+ "message"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/355d0ee2fcb6c1fc403c6267f710e25a.asciidoc b/docs/examples/355d0ee2fcb6c1fc403c6267f710e25a.asciidoc
index 1c4010587..95c58cd5e 100644
--- a/docs/examples/355d0ee2fcb6c1fc403c6267f710e25a.asciidoc
+++ b/docs/examples/355d0ee2fcb6c1fc403c6267f710e25a.asciidoc
@@ -1,12 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:716
[source, python]
----
resp = client.reindex(
- body={
- "source": {"index": ["my-index-000001", "my-index-000002"]},
- "dest": {"index": "my-new-index-000002"},
+ source={
+ "index": [
+ "my-index-000001",
+ "my-index-000002"
+ ]
+ },
+ dest={
+ "index": "my-new-index-000002"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/357edc9d10e98ed776401c7a439a1a55.asciidoc b/docs/examples/357edc9d10e98ed776401c7a439a1a55.asciidoc
new file mode 100644
index 000000000..69fe16b28
--- /dev/null
+++ b/docs/examples/357edc9d10e98ed776401c7a439a1a55.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/resolve-cluster.asciidoc:206
+
+[source, python]
+----
+resp = client.indices.resolve_cluster(
+ name="not-present,clust*:my-index*,oldcluster:*",
+ ignore_unavailable=False,
+)
+print(resp)
+----
diff --git a/docs/examples/35a272df8c919a12d7c3106a18245748.asciidoc b/docs/examples/35a272df8c919a12d7c3106a18245748.asciidoc
index 9351c75e5..db4d626eb 100644
--- a/docs/examples/35a272df8c919a12d7c3106a18245748.asciidoc
+++ b/docs/examples/35a272df8c919a12d7c3106a18245748.asciidoc
@@ -1,16 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/infer-trained-model.asciidoc:849
[source, python]
----
resp = client.ml.infer_trained_model(
model_id="lang_ident_model_1",
- body={
- "docs": [
- {
- "text": "The fool doth think he is wise, but the wise man knows himself to be a fool."
- }
- ]
- },
+ docs=[
+ {
+ "text": "The fool doth think he is wise, but the wise man knows himself to be a fool."
+ }
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/35b686d9d9e915d0dea7a4251781767d.asciidoc b/docs/examples/35b686d9d9e915d0dea7a4251781767d.asciidoc
new file mode 100644
index 000000000..02508226f
--- /dev/null
+++ b/docs/examples/35b686d9d9e915d0dea7a4251781767d.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:248
+
+[source, python]
+----
+resp = client.cluster.reroute(
+ metric="none",
+ commands=[
+ {
+ "allocate_empty_primary": {
+ "index": "my-index",
+ "shard": 0,
+ "node": "my-node",
+ "accept_data_loss": "true"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/35be136ba9df7474a5521631e2a385b1.asciidoc b/docs/examples/35be136ba9df7474a5521631e2a385b1.asciidoc
new file mode 100644
index 000000000..890b4dc77
--- /dev/null
+++ b/docs/examples/35be136ba9df7474a5521631e2a385b1.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/apis/explain-lifecycle.asciidoc:50
+
+[source, python]
+----
+resp = client.indices.explain_data_lifecycle(
+ index=".ds-metrics-2023.03.22-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/35c33ef48cf8a4ee368874141622f9d5.asciidoc b/docs/examples/35c33ef48cf8a4ee368874141622f9d5.asciidoc
index d0a154874..b17b3ca8b 100644
--- a/docs/examples/35c33ef48cf8a4ee368874141622f9d5.asciidoc
+++ b/docs/examples/35c33ef48cf8a4ee368874141622f9d5.asciidoc
@@ -1,21 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:503
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "strings_as_text": {
- "match_mapping_type": "string",
- "mapping": {"type": "text"},
+ mappings={
+ "dynamic_templates": [
+ {
+ "strings_as_text": {
+ "match_mapping_type": "string",
+ "mapping": {
+ "type": "text"
}
}
- ]
- }
+ }
+ ]
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/35c664285f2e8b7d5d50ca37ae3ba794.asciidoc b/docs/examples/35c664285f2e8b7d5d50ca37ae3ba794.asciidoc
new file mode 100644
index 000000000..64164c66e
--- /dev/null
+++ b/docs/examples/35c664285f2e8b7d5d50ca37ae3ba794.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/collapse-search-results.asciidoc:160
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "message": "GET /search"
+ }
+ },
+ collapse={
+ "field": "user.id"
+ },
+ sort=[
+ "user.id"
+ ],
+ search_after=[
+ "dd5ce1ad"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/35eef1765e9a5991d77592a0c7490fe0.asciidoc b/docs/examples/35eef1765e9a5991d77592a0c7490fe0.asciidoc
new file mode 100644
index 000000000..ee14f1d66
--- /dev/null
+++ b/docs/examples/35eef1765e9a5991d77592a0c7490fe0.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/min-aggregation.asciidoc:99
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ aggs={
+ "grade_min": {
+ "min": {
+ "field": "grade",
+ "missing": 10
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/35f892b475a1770f18328158be7039fd.asciidoc b/docs/examples/35f892b475a1770f18328158be7039fd.asciidoc
index c47e692e7..bd69bcdd1 100644
--- a/docs/examples/35f892b475a1770f18328158be7039fd.asciidoc
+++ b/docs/examples/35f892b475a1770f18328158be7039fd.asciidoc
@@ -1,20 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/dense-vector.asciidoc:72
[source, python]
----
resp = client.indices.create(
index="my-index-2",
- body={
- "mappings": {
- "properties": {
- "my_vector": {
- "type": "dense_vector",
- "dims": 3,
- "similarity": "dot_product",
- }
+ mappings={
+ "properties": {
+ "my_vector": {
+ "type": "dense_vector",
+ "dims": 3,
+ "similarity": "dot_product"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/35fc63cbefce7bc131ad467b5ba209ef.asciidoc b/docs/examples/35fc63cbefce7bc131ad467b5ba209ef.asciidoc
new file mode 100644
index 000000000..7237145cc
--- /dev/null
+++ b/docs/examples/35fc63cbefce7bc131ad467b5ba209ef.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/disk/decrease-data-node-disk-usage.asciidoc:79
+
+[source, python]
+----
+resp = client.cat.allocation(
+ v=True,
+ s="disk.avail",
+ h="node,disk.percent,disk.avail,disk.total,disk.used,disk.indices,shards",
+)
+print(resp)
+----
diff --git a/docs/examples/35fd9549350926f8d57dc1765e2f40d3.asciidoc b/docs/examples/35fd9549350926f8d57dc1765e2f40d3.asciidoc
new file mode 100644
index 000000000..f70f2943f
--- /dev/null
+++ b/docs/examples/35fd9549350926f8d57dc1765e2f40d3.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/attachment.asciidoc:53
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="attachment",
+ description="Extract attachment information",
+ processors=[
+ {
+ "attachment": {
+ "field": "data",
+ "remove_binary": False
+ }
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="my_id",
+ pipeline="attachment",
+ document={
+ "data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
+ },
+)
+print(resp1)
+
+resp2 = client.get(
+ index="my-index-000001",
+ id="my_id",
+)
+print(resp2)
+----
diff --git a/docs/examples/36063ff9a318dba7bb0be3a230655dc8.asciidoc b/docs/examples/36063ff9a318dba7bb0be3a230655dc8.asciidoc
index 1c8891952..6ece85e77 100644
--- a/docs/examples/36063ff9a318dba7bb0be3a230655dc8.asciidoc
+++ b/docs/examples/36063ff9a318dba7bb0be3a230655dc8.asciidoc
@@ -1,22 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/numeric.asciidoc:259
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"long": {"type": "long"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "long": {
+ "type": "long"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"long": [0, 0, -123466, 87612]},
+ document={
+ "long": [
+ 0,
+ 0,
+ -123466,
+ 87612
+ ]
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/3608e4fcd17dd8d5f88ec9a3db2f5d89.asciidoc b/docs/examples/3608e4fcd17dd8d5f88ec9a3db2f5d89.asciidoc
new file mode 100644
index 000000000..5c0875fce
--- /dev/null
+++ b/docs/examples/3608e4fcd17dd8d5f88ec9a3db2f5d89.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// synonyms/apis/put-synonyms-set.asciidoc:83
+
+[source, python]
+----
+resp = client.synonyms.put_synonym(
+ id="my-synonyms-set",
+ synonyms_set=[
+ {
+ "synonyms": "hello => hi => howdy"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/360b3cef34bbddc5d9579ca95f0cb061.asciidoc b/docs/examples/360b3cef34bbddc5d9579ca95f0cb061.asciidoc
new file mode 100644
index 000000000..5391122c2
--- /dev/null
+++ b/docs/examples/360b3cef34bbddc5d9579ca95f0cb061.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:155
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my-data-stream",
+ write_index_only=True,
+ properties={
+ "message": {
+ "type": "text"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/360c4f373e72ba861584ee85bd218124.asciidoc b/docs/examples/360c4f373e72ba861584ee85bd218124.asciidoc
index 3e11c6c84..84fc9f694 100644
--- a/docs/examples/360c4f373e72ba861584ee85bd218124.asciidoc
+++ b/docs/examples/360c4f373e72ba861584ee85bd218124.asciidoc
@@ -1,27 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:262
[source, python]
----
resp = client.indices.create(
index="test_index",
- body={
- "settings": {
- "analysis": {
- "analyzer": {
- "my_analyzer": {
- "tokenizer": "standard",
- "filter": ["lowercase", "porter_stem"],
- }
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "porter_stem"
+ ]
}
}
- },
- "mappings": {
- "properties": {
- "query": {"type": "percolator"},
- "body": {"type": "text", "analyzer": "my_analyzer"},
+ }
+ },
+ mappings={
+ "properties": {
+ "query": {
+ "type": "percolator"
+ },
+ "body": {
+ "type": "text",
+ "analyzer": "my_analyzer"
}
- },
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3613f402ee63f0efb6b8d9c6a919b410.asciidoc b/docs/examples/3613f402ee63f0efb6b8d9c6a919b410.asciidoc
new file mode 100644
index 000000000..d15b39d6a
--- /dev/null
+++ b/docs/examples/3613f402ee63f0efb6b8d9c6a919b410.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-rest.asciidoc:133
+
+[source, python]
+----
+resp = client.esql.query(
+ format="txt",
+ query="\n FROM library\n | KEEP author, name, page_count, release_date\n | SORT page_count DESC\n | LIMIT 5\n ",
+ filter={
+ "range": {
+ "page_count": {
+ "gte": 100,
+ "lte": 200
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/362dfccdb6f7933b22c909542e0b4e0a.asciidoc b/docs/examples/362dfccdb6f7933b22c909542e0b4e0a.asciidoc
new file mode 100644
index 000000000..47ed0975e
--- /dev/null
+++ b/docs/examples/362dfccdb6f7933b22c909542e0b4e0a.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:221
+
+[source, python]
+----
+resp = client.update_by_query(
+ index="my-data-stream",
+ query={
+ "match": {
+ "user.id": "l7gk7f82"
+ }
+ },
+ script={
+ "source": "ctx._source.user.id = params.new_id",
+ "params": {
+ "new_id": "XgdX0NoX"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/365256ebdfa47b449780771d9beba8d9.asciidoc b/docs/examples/365256ebdfa47b449780771d9beba8d9.asciidoc
new file mode 100644
index 000000000..0cd8f33d6
--- /dev/null
+++ b/docs/examples/365256ebdfa47b449780771d9beba8d9.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/check-in-connector-sync-job-api.asciidoc:49
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_connector/_sync_job/my-connector-sync-job/_check_in",
+)
+print(resp)
+----
diff --git a/docs/examples/36962727b806315b221e8a63e05caddc.asciidoc b/docs/examples/36962727b806315b221e8a63e05caddc.asciidoc
index 20d76e8ba..9b8852236 100644
--- a/docs/examples/36962727b806315b221e8a63e05caddc.asciidoc
+++ b/docs/examples/36962727b806315b221e8a63e05caddc.asciidoc
@@ -1,12 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/explicit-mapping.asciidoc:49
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "properties": {"employee-id": {"type": "keyword", "index": False}}
+ properties={
+ "employee-id": {
+ "type": "keyword",
+ "index": False
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/36b26905c5f96d0b785c3267fb63838d.asciidoc b/docs/examples/36b26905c5f96d0b785c3267fb63838d.asciidoc
new file mode 100644
index 000000000..b91b2f402
--- /dev/null
+++ b/docs/examples/36b26905c5f96d0b785c3267fb63838d.asciidoc
@@ -0,0 +1,609 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:422
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "ip": {
+ "type": "ip"
+ },
+ "version": {
+ "type": "version"
+ },
+ "missing_keyword": {
+ "type": "keyword"
+ },
+ "@timestamp": {
+ "type": "date"
+ },
+ "type_test": {
+ "type": "keyword"
+ },
+ "@timestamp_pretty": {
+ "type": "date",
+ "format": "dd-MM-yyyy"
+ },
+ "event_type": {
+ "type": "keyword"
+ },
+ "event": {
+ "properties": {
+ "category": {
+ "type": "alias",
+ "path": "event_type"
+ }
+ }
+ },
+ "host": {
+ "type": "keyword"
+ },
+ "os": {
+ "type": "keyword"
+ },
+ "bool": {
+ "type": "boolean"
+ },
+ "uptime": {
+ "type": "long"
+ },
+ "port": {
+ "type": "long"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.create(
+ index="my-index-000002",
+ mappings={
+ "properties": {
+ "ip": {
+ "type": "ip"
+ },
+ "@timestamp": {
+ "type": "date"
+ },
+ "@timestamp_pretty": {
+ "type": "date",
+ "format": "yyyy-MM-dd"
+ },
+ "type_test": {
+ "type": "keyword"
+ },
+ "event_type": {
+ "type": "keyword"
+ },
+ "event": {
+ "properties": {
+ "category": {
+ "type": "alias",
+ "path": "event_type"
+ }
+ }
+ },
+ "host": {
+ "type": "keyword"
+ },
+ "op_sys": {
+ "type": "keyword"
+ },
+ "bool": {
+ "type": "boolean"
+ },
+ "uptime": {
+ "type": "long"
+ },
+ "port": {
+ "type": "long"
+ }
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.indices.create(
+ index="my-index-000003",
+ mappings={
+ "properties": {
+ "host_ip": {
+ "type": "ip"
+ },
+ "@timestamp": {
+ "type": "date"
+ },
+ "date": {
+ "type": "date"
+ },
+ "event_type": {
+ "type": "keyword"
+ },
+ "event": {
+ "properties": {
+ "category": {
+ "type": "alias",
+ "path": "event_type"
+ }
+ }
+ },
+ "missing_keyword": {
+ "type": "keyword"
+ },
+ "host": {
+ "type": "keyword"
+ },
+ "os": {
+ "type": "keyword"
+ },
+ "bool": {
+ "type": "boolean"
+ },
+ "uptime": {
+ "type": "long"
+ },
+ "port": {
+ "type": "long"
+ }
+ }
+ },
+)
+print(resp2)
+
+resp3 = client.bulk(
+ index="my-index-000001",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "@timestamp": "1234567891",
+ "@timestamp_pretty": "12-12-2022",
+ "missing_keyword": "test",
+ "type_test": "abc",
+ "ip": "10.0.0.1",
+ "event_type": "alert",
+ "host": "doom",
+ "uptime": 0,
+ "port": 1234,
+ "os": "win10",
+ "version": "1.0.0",
+ "id": 11
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "@timestamp": "1234567892",
+ "@timestamp_pretty": "13-12-2022",
+ "event_type": "alert",
+ "type_test": "abc",
+ "host": "CS",
+ "uptime": 5,
+ "port": 1,
+ "os": "win10",
+ "version": "1.2.0",
+ "id": 12
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "@timestamp": "1234567893",
+ "@timestamp_pretty": "12-12-2022",
+ "event_type": "alert",
+ "type_test": "abc",
+ "host": "farcry",
+ "uptime": 1,
+ "port": 1234,
+ "bool": False,
+ "os": "win10",
+ "version": "2.0.0",
+ "id": 13
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "@timestamp": "1234567894",
+ "@timestamp_pretty": "13-12-2022",
+ "event_type": "alert",
+ "type_test": "abc",
+ "host": "GTA",
+ "uptime": 3,
+ "port": 12,
+ "os": "slack",
+ "version": "10.0.0",
+ "id": 14
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "@timestamp": "1234567895",
+ "@timestamp_pretty": "17-12-2022",
+ "event_type": "alert",
+ "host": "sniper 3d",
+ "uptime": 6,
+ "port": 1234,
+ "os": "fedora",
+ "version": "20.1.0",
+ "id": 15
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "@timestamp": "1234568896",
+ "@timestamp_pretty": "17-12-2022",
+ "event_type": "alert",
+ "host": "doom",
+ "port": 65123,
+ "bool": True,
+ "os": "redhat",
+ "version": "20.10.0",
+ "id": 16
+ },
+ {
+ "index": {
+ "_id": 7
+ }
+ },
+ {
+ "@timestamp": "1234567897",
+ "@timestamp_pretty": "17-12-2022",
+ "missing_keyword": "yyy",
+ "event_type": "failure",
+ "host": "doom",
+ "uptime": 15,
+ "port": 1234,
+ "bool": True,
+ "os": "redhat",
+ "version": "20.2.0",
+ "id": 17
+ },
+ {
+ "index": {
+ "_id": 8
+ }
+ },
+ {
+ "@timestamp": "1234567898",
+ "@timestamp_pretty": "12-12-2022",
+ "missing_keyword": "test",
+ "event_type": "success",
+ "host": "doom",
+ "uptime": 16,
+ "port": 512,
+ "os": "win10",
+ "version": "1.2.3",
+ "id": 18
+ },
+ {
+ "index": {
+ "_id": 9
+ }
+ },
+ {
+ "@timestamp": "1234567899",
+ "@timestamp_pretty": "15-12-2022",
+ "missing_keyword": "test",
+ "event_type": "success",
+ "host": "GTA",
+ "port": 12,
+ "bool": True,
+ "os": "win10",
+ "version": "1.2.3",
+ "id": 19
+ },
+ {
+ "index": {
+ "_id": 10
+ }
+ },
+ {
+ "@timestamp": "1234567893",
+ "missing_keyword": None,
+ "ip": "10.0.0.5",
+ "event_type": "alert",
+ "host": "farcry",
+ "uptime": 1,
+ "port": 1234,
+ "bool": True,
+ "os": "win10",
+ "version": "1.2.3",
+ "id": 110
+ }
+ ],
+)
+print(resp3)
+
+resp4 = client.bulk(
+ index="my-index-000002",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "@timestamp": "1234567991",
+ "type_test": "abc",
+ "ip": "10.0.0.1",
+ "event_type": "alert",
+ "host": "doom",
+ "uptime": 0,
+ "port": 1234,
+ "op_sys": "win10",
+ "id": 21
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "@timestamp": "1234567992",
+ "type_test": "abc",
+ "event_type": "alert",
+ "host": "CS",
+ "uptime": 5,
+ "port": 1,
+ "op_sys": "win10",
+ "id": 22
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "@timestamp": "1234567993",
+ "type_test": "abc",
+ "@timestamp_pretty": "2022-12-17",
+ "event_type": "alert",
+ "host": "farcry",
+ "uptime": 1,
+ "port": 1234,
+ "bool": False,
+ "op_sys": "win10",
+ "id": 23
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "@timestamp": "1234567994",
+ "event_type": "alert",
+ "host": "GTA",
+ "uptime": 3,
+ "port": 12,
+ "op_sys": "slack",
+ "id": 24
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "@timestamp": "1234567995",
+ "event_type": "alert",
+ "host": "sniper 3d",
+ "uptime": 6,
+ "port": 1234,
+ "op_sys": "fedora",
+ "id": 25
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "@timestamp": "1234568996",
+ "@timestamp_pretty": "2022-12-17",
+ "ip": "10.0.0.5",
+ "event_type": "alert",
+ "host": "doom",
+ "port": 65123,
+ "bool": True,
+ "op_sys": "redhat",
+ "id": 26
+ },
+ {
+ "index": {
+ "_id": 7
+ }
+ },
+ {
+ "@timestamp": "1234567997",
+ "@timestamp_pretty": "2022-12-17",
+ "event_type": "failure",
+ "host": "doom",
+ "uptime": 15,
+ "port": 1234,
+ "bool": True,
+ "op_sys": "redhat",
+ "id": 27
+ },
+ {
+ "index": {
+ "_id": 8
+ }
+ },
+ {
+ "@timestamp": "1234567998",
+ "ip": "10.0.0.1",
+ "event_type": "success",
+ "host": "doom",
+ "uptime": 16,
+ "port": 512,
+ "op_sys": "win10",
+ "id": 28
+ },
+ {
+ "index": {
+ "_id": 9
+ }
+ },
+ {
+ "@timestamp": "1234567999",
+ "ip": "10.0.0.1",
+ "event_type": "success",
+ "host": "GTA",
+ "port": 12,
+ "bool": False,
+ "op_sys": "win10",
+ "id": 29
+ }
+ ],
+)
+print(resp4)
+
+resp5 = client.bulk(
+ index="my-index-000003",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "@timestamp": "1334567891",
+ "host_ip": "10.0.0.1",
+ "event_type": "alert",
+ "host": "doom",
+ "uptime": 0,
+ "port": 12,
+ "os": "win10",
+ "id": 31
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "@timestamp": "1334567892",
+ "event_type": "alert",
+ "host": "CS",
+ "os": "win10",
+ "id": 32
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "@timestamp": "1334567893",
+ "event_type": "alert",
+ "host": "farcry",
+ "bool": True,
+ "os": "win10",
+ "id": 33
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "@timestamp": "1334567894",
+ "event_type": "alert",
+ "host": "GTA",
+ "os": "slack",
+ "bool": True,
+ "id": 34
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "@timestamp": "1234567895",
+ "event_type": "alert",
+ "host": "sniper 3d",
+ "os": "fedora",
+ "id": 35
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "@timestamp": "1234578896",
+ "host_ip": "10.0.0.1",
+ "event_type": "alert",
+ "host": "doom",
+ "bool": True,
+ "os": "redhat",
+ "id": 36
+ },
+ {
+ "index": {
+ "_id": 7
+ }
+ },
+ {
+ "@timestamp": "1234567897",
+ "event_type": "failure",
+ "missing_keyword": "test",
+ "host": "doom",
+ "bool": True,
+ "os": "redhat",
+ "id": 37
+ },
+ {
+ "index": {
+ "_id": 8
+ }
+ },
+ {
+ "@timestamp": "1234577898",
+ "event_type": "success",
+ "host": "doom",
+ "os": "win10",
+ "id": 38,
+ "date": "1671235200000"
+ },
+ {
+ "index": {
+ "_id": 9
+ }
+ },
+ {
+ "@timestamp": "1234577899",
+ "host_ip": "10.0.0.5",
+ "event_type": "success",
+ "host": "GTA",
+ "bool": True,
+ "os": "win10",
+ "id": 39
+ }
+ ],
+)
+print(resp5)
+----
diff --git a/docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc b/docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc
new file mode 100644
index 000000000..22d10734a
--- /dev/null
+++ b/docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// quickstart/getting-started.asciidoc:244
+
+[source, python]
+----
+resp = client.search(
+ index="books",
+ query={
+ "match": {
+ "name": "brave"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/36d229f734adcdab00be266a7ce038b1.asciidoc b/docs/examples/36d229f734adcdab00be266a7ce038b1.asciidoc
index 2f6634de0..f4c484a27 100644
--- a/docs/examples/36d229f734adcdab00be266a7ce038b1.asciidoc
+++ b/docs/examples/36d229f734adcdab00be266a7ce038b1.asciidoc
@@ -1,20 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/dense-vector.asciidoc:375
[source, python]
----
resp = client.indices.create(
index="my-bit-vectors",
- body={
- "mappings": {
- "properties": {
- "my_vector": {
- "type": "dense_vector",
- "dims": 40,
- "element_type": "bit",
- }
+ mappings={
+ "properties": {
+ "my_vector": {
+ "type": "dense_vector",
+ "dims": 40,
+ "element_type": "bit"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/36da9668fef56910370f16bfb772cc40.asciidoc b/docs/examples/36da9668fef56910370f16bfb772cc40.asciidoc
index 9ab22b1ad..a2f05d6e8 100644
--- a/docs/examples/36da9668fef56910370f16bfb772cc40.asciidoc
+++ b/docs/examples/36da9668fef56910370f16bfb772cc40.asciidoc
@@ -1,10 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
// modules/indices/request_cache.asciidoc:139
[source, python]
----
resp = client.indices.stats(
metric="request_cache",
- human="true",
+ human=True,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/36e09bbd5896498ede0f5d37a18eae2c.asciidoc b/docs/examples/36e09bbd5896498ede0f5d37a18eae2c.asciidoc
new file mode 100644
index 000000000..39ac8f0e8
--- /dev/null
+++ b/docs/examples/36e09bbd5896498ede0f5d37a18eae2c.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/parent-id-query.asciidoc:60
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="2",
+ routing="1",
+ refresh=True,
+ document={
+ "text": "This is a child document.",
+ "my-join-field": {
+ "name": "my-child",
+ "parent": "1"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/36fae9dfc0b815546b45745bac054b67.asciidoc b/docs/examples/36fae9dfc0b815546b45745bac054b67.asciidoc
index d4cac7801..069aefc78 100644
--- a/docs/examples/36fae9dfc0b815546b45745bac054b67.asciidoc
+++ b/docs/examples/36fae9dfc0b815546b45745bac054b67.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:496
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={"query": {"match": {"model_number": "HG537PU"}}},
+ query={
+ "match": {
+ "model_number": "HG537PU"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/370b297ed3433577adf53e64f572d89d.asciidoc b/docs/examples/370b297ed3433577adf53e64f572d89d.asciidoc
new file mode 100644
index 000000000..c294fea7b
--- /dev/null
+++ b/docs/examples/370b297ed3433577adf53e64f572d89d.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/delete-connector-sync-job-api.asciidoc:45
+
+[source, python]
+----
+resp = client.perform_request(
+ "DELETE",
+ "/_connector/_sync_job/my-connector-sync-job-id",
+)
+print(resp)
+----
diff --git a/docs/examples/371962cf63e65c10026177c6a1bad0b6.asciidoc b/docs/examples/371962cf63e65c10026177c6a1bad0b6.asciidoc
new file mode 100644
index 000000000..b46d30acf
--- /dev/null
+++ b/docs/examples/371962cf63e65c10026177c6a1bad0b6.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// slm/apis/slm-start.asciidoc:41
+
+[source, python]
+----
+resp = client.slm.start()
+print(resp)
+----
diff --git a/docs/examples/37530f35f315b9f35e3e6a13cf2a1ccd.asciidoc b/docs/examples/37530f35f315b9f35e3e6a13cf2a1ccd.asciidoc
index cfce9ed03..c0192e151 100644
--- a/docs/examples/37530f35f315b9f35e3e6a13cf2a1ccd.asciidoc
+++ b/docs/examples/37530f35f315b9f35e3e6a13cf2a1ccd.asciidoc
@@ -1,22 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:731
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "actors": {
- "terms": {
- "field": "actors",
- "size": 10,
- "collect_mode": "breadth_first",
- },
- "aggs": {
- "costars": {"terms": {"field": "actors", "size": 5}}
- },
+ aggs={
+ "actors": {
+ "terms": {
+ "field": "actors",
+ "size": 10,
+ "collect_mode": "breadth_first"
+ },
+ "aggs": {
+ "costars": {
+ "terms": {
+ "field": "actors",
+ "size": 5
+ }
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3758b8f2ab9f6f28a764ee6c42c85766.asciidoc b/docs/examples/3758b8f2ab9f6f28a764ee6c42c85766.asciidoc
new file mode 100644
index 000000000..d0744c6b3
--- /dev/null
+++ b/docs/examples/3758b8f2ab9f6f28a764ee6c42c85766.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:548
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ scroll="1m",
+ slice={
+ "id": 0,
+ "max": 2
+ },
+ query={
+ "match": {
+ "message": "foo"
+ }
+ },
+)
+print(resp)
+
+resp1 = client.search(
+ index="my-index-000001",
+ scroll="1m",
+ slice={
+ "id": 1,
+ "max": 2
+ },
+ query={
+ "match": {
+ "message": "foo"
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/3759ca688c4bd3c838780a9aad63258b.asciidoc b/docs/examples/3759ca688c4bd3c838780a9aad63258b.asciidoc
new file mode 100644
index 000000000..4d7be2d86
--- /dev/null
+++ b/docs/examples/3759ca688c4bd3c838780a9aad63258b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-index-template.asciidoc:35
+
+[source, python]
+----
+resp = client.indices.get_index_template(
+ name="template_1",
+)
+print(resp)
+----
diff --git a/docs/examples/375bf2c51ce6cc386f9d4d635d5e84a7.asciidoc b/docs/examples/375bf2c51ce6cc386f9d4d635d5e84a7.asciidoc
new file mode 100644
index 000000000..bec272d90
--- /dev/null
+++ b/docs/examples/375bf2c51ce6cc386f9d4d635d5e84a7.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-grid-query.asciidoc:345
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "geo_grid": {
+ "location": {
+ "geohex": "811fbffffffffff"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/376fbc965e1b093f6dbc198a94c83aa9.asciidoc b/docs/examples/376fbc965e1b093f6dbc198a94c83aa9.asciidoc
new file mode 100644
index 000000000..89ba18b22
--- /dev/null
+++ b/docs/examples/376fbc965e1b093f6dbc198a94c83aa9.asciidoc
@@ -0,0 +1,49 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/common-script-uses.asciidoc:260
+
+[source, python]
+----
+resp = client.bulk(
+ index="my-index",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "gc": "[2021-04-27T16:16:34.699+0000][82460][gc,heap,exit] class space used 266K, capacity 384K, committed 384K, reserved 1048576K"
+ },
+ {
+ "index": {}
+ },
+ {
+ "gc": "[2021-03-24T20:27:24.184+0000][90239][gc,heap,exit] class space used 15255K, capacity 16726K, committed 16844K, reserved 1048576K"
+ },
+ {
+ "index": {}
+ },
+ {
+ "gc": "[2021-03-24T20:27:24.184+0000][90239][gc,heap,exit] Metaspace used 115409K, capacity 119541K, committed 120248K, reserved 1153024K"
+ },
+ {
+ "index": {}
+ },
+ {
+ "gc": "[2021-04-19T15:03:21.735+0000][84408][gc,heap,exit] class space used 14503K, capacity 15894K, committed 15948K, reserved 1048576K"
+ },
+ {
+ "index": {}
+ },
+ {
+ "gc": "[2021-04-19T15:03:21.735+0000][84408][gc,heap,exit] Metaspace used 107719K, capacity 111775K, committed 112724K, reserved 1146880K"
+ },
+ {
+ "index": {}
+ },
+ {
+ "gc": "[2021-04-27T16:16:34.699+0000][82460][gc,heap,exit] class space used 266K, capacity 367K, committed 384K, reserved 1048576K"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/376ff4b2b5f657481af78a778aaab57f.asciidoc b/docs/examples/376ff4b2b5f657481af78a778aaab57f.asciidoc
new file mode 100644
index 000000000..df69c85ea
--- /dev/null
+++ b/docs/examples/376ff4b2b5f657481af78a778aaab57f.asciidoc
@@ -0,0 +1,74 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/top-metrics-aggregation.asciidoc:154
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index",
+ mappings={
+ "properties": {
+ "nr": {
+ "type": "integer"
+ },
+ "state": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="my-index",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "nr": 1,
+ "state": "started"
+ },
+ {
+ "index": {}
+ },
+ {
+ "nr": 2,
+ "state": "stopped"
+ },
+ {
+ "index": {}
+ },
+ {
+ "nr": 3,
+ "state": "N/A"
+ },
+ {
+ "index": {}
+ },
+ {
+ "nr": 4
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index",
+ filter_path="aggregations",
+ aggs={
+ "my_top_metrics": {
+ "top_metrics": {
+ "metrics": {
+ "field": "state",
+ "missing": "N/A"
+ },
+ "sort": {
+ "nr": "desc"
+ }
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/377af0ea9b19c113f224d8150890b41b.asciidoc b/docs/examples/377af0ea9b19c113f224d8150890b41b.asciidoc
new file mode 100644
index 000000000..630ebda72
--- /dev/null
+++ b/docs/examples/377af0ea9b19c113f224d8150890b41b.asciidoc
@@ -0,0 +1,74 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significantterms-aggregation.asciidoc:412
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "bool": {
+ "filter": [
+ {
+ "term": {
+ "event.outcome": "failure"
+ }
+ },
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "2021-02-01",
+ "lt": "2021-02-04"
+ }
+ }
+ },
+ {
+ "term": {
+ "service.name": {
+ "value": "frontend-node"
+ }
+ }
+ }
+ ]
+ }
+ },
+ aggs={
+ "failure_p_value": {
+ "significant_terms": {
+ "field": "user_agent.version",
+ "background_filter": {
+ "bool": {
+ "must_not": [
+ {
+ "term": {
+ "event.outcome": "failure"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "2021-02-01",
+ "lt": "2021-02-04"
+ }
+ }
+ },
+ {
+ "term": {
+ "service.name": {
+ "value": "frontend-node"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "p_value": {
+ "background_is_superset": False,
+ "normalize_above": 1000
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/378e55f78fa13578a1302bae8d479765.asciidoc b/docs/examples/378e55f78fa13578a1302bae8d479765.asciidoc
index d9133a1f6..6cc82e427 100644
--- a/docs/examples/378e55f78fa13578a1302bae8d479765.asciidoc
+++ b/docs/examples/378e55f78fa13578a1302bae8d479765.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/terms-query.asciidoc:134
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"color": {"type": "keyword"}}}},
+ mappings={
+ "properties": {
+ "color": {
+ "type": "keyword"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/37983daac3d9c8582583a507b3adb7f2.asciidoc b/docs/examples/37983daac3d9c8582583a507b3adb7f2.asciidoc
new file mode 100644
index 000000000..2086a8afc
--- /dev/null
+++ b/docs/examples/37983daac3d9c8582583a507b3adb7f2.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// shutdown/apis/shutdown-delete.asciidoc:51
+
+[source, python]
+----
+resp = client.shutdown.put_node(
+ node_id="USpTGYaBSIKbgSUJR2Z9lg",
+ type="restart",
+ reason="Demonstrating how the node shutdown API works",
+)
+print(resp)
+----
diff --git a/docs/examples/37ae7c3e4d6d954487ec4185fe7d9ec8.asciidoc b/docs/examples/37ae7c3e4d6d954487ec4185fe7d9ec8.asciidoc
new file mode 100644
index 000000000..d929d0a74
--- /dev/null
+++ b/docs/examples/37ae7c3e4d6d954487ec4185fe7d9ec8.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significantterms-aggregation.asciidoc:130
+
+[source, python]
+----
+resp = client.search(
+ aggregations={
+ "forces": {
+ "terms": {
+ "field": "force"
+ },
+ "aggregations": {
+ "significant_crime_types": {
+ "significant_terms": {
+ "field": "crime_type"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/37b84f2ab7c2f6b4fe0e14cc7e018b1f.asciidoc b/docs/examples/37b84f2ab7c2f6b4fe0e14cc7e018b1f.asciidoc
new file mode 100644
index 000000000..dcac95dd4
--- /dev/null
+++ b/docs/examples/37b84f2ab7c2f6b4fe0e14cc7e018b1f.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/bi-directional-disaster-recovery.asciidoc:41
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster": {
+ "remote": {
+ "clusterB": {
+ "mode": "proxy",
+ "skip_unavailable": True,
+ "server_name": "clusterb.es.region-b.gcp.elastic-cloud.com",
+ "proxy_socket_connections": 18,
+ "proxy_address": "clusterb.es.region-b.gcp.elastic-cloud.com:9400"
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.cluster.put_settings(
+ persistent={
+ "cluster": {
+ "remote": {
+ "clusterA": {
+ "mode": "proxy",
+ "skip_unavailable": True,
+ "server_name": "clustera.es.region-a.gcp.elastic-cloud.com",
+ "proxy_socket_connections": 18,
+ "proxy_address": "clustera.es.region-a.gcp.elastic-cloud.com:9400"
+ }
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/37c73410bf13429279cbc61a413957d8.asciidoc b/docs/examples/37c73410bf13429279cbc61a413957d8.asciidoc
new file mode 100644
index 000000000..0e6b22cd1
--- /dev/null
+++ b/docs/examples/37c73410bf13429279cbc61a413957d8.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/size-your-shards.asciidoc:555
+
+[source, python]
+----
+resp = client.cluster.stats(
+ filter_path="indices.shards.total",
+)
+print(resp)
+----
diff --git a/docs/examples/37eaab0630976d3dee90a52011342883.asciidoc b/docs/examples/37eaab0630976d3dee90a52011342883.asciidoc
new file mode 100644
index 000000000..f75bd7b22
--- /dev/null
+++ b/docs/examples/37eaab0630976d3dee90a52011342883.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/stop-tokenfilter.asciidoc:106
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "stop"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/37f1f2e75ed95308ae436bbbb8d5645e.asciidoc b/docs/examples/37f1f2e75ed95308ae436bbbb8d5645e.asciidoc
new file mode 100644
index 000000000..fb0162dbe
--- /dev/null
+++ b/docs/examples/37f1f2e75ed95308ae436bbbb8d5645e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// licensing/start-trial.asciidoc:44
+
+[source, python]
+----
+resp = client.license.post_start_trial(
+ acknowledge=True,
+)
+print(resp)
+----
diff --git a/docs/examples/3819d0a5c2eed635c88e9e7bf2e81584.asciidoc b/docs/examples/3819d0a5c2eed635c88e9e7bf2e81584.asciidoc
new file mode 100644
index 000000000..b5ef17a87
--- /dev/null
+++ b/docs/examples/3819d0a5c2eed635c88e9e7bf2e81584.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/revert-snapshot.asciidoc:78
+
+[source, python]
+----
+resp = client.ml.revert_model_snapshot(
+ job_id="low_request_rate",
+ snapshot_id="1637092688",
+ delete_intervening_results=True,
+)
+print(resp)
+----
diff --git a/docs/examples/386eb7dcd3149db82605bf22c5d851bf.asciidoc b/docs/examples/386eb7dcd3149db82605bf22c5d851bf.asciidoc
new file mode 100644
index 000000000..ad82daded
--- /dev/null
+++ b/docs/examples/386eb7dcd3149db82605bf22c5d851bf.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-api-key.asciidoc:368
+
+[source, python]
+----
+resp = client.security.create_api_key(
+ name="application-key-1",
+ metadata={
+ "application": "my-application"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/388d3eda4f792d3fce044777739217e6.asciidoc b/docs/examples/388d3eda4f792d3fce044777739217e6.asciidoc
new file mode 100644
index 000000000..14dd866c0
--- /dev/null
+++ b/docs/examples/388d3eda4f792d3fce044777739217e6.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/evaluate-dfanalytics.asciidoc:436
+
+[source, python]
+----
+resp = client.ml.evaluate_data_frame(
+ index="animal_classification",
+ evaluation={
+ "classification": {
+ "actual_field": "animal_class",
+ "predicted_field": "ml.animal_class_prediction",
+ "metrics": {
+ "multiclass_confusion_matrix": {}
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/388ec2b038d3ad69378f4c2e5bc36dce.asciidoc b/docs/examples/388ec2b038d3ad69378f4c2e5bc36dce.asciidoc
new file mode 100644
index 000000000..58a5ee4e1
--- /dev/null
+++ b/docs/examples/388ec2b038d3ad69378f4c2e5bc36dce.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-field-masking-query.asciidoc:16
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_near": {
+ "clauses": [
+ {
+ "span_term": {
+ "text": "quick brown"
+ }
+ },
+ {
+ "span_field_masking": {
+ "query": {
+ "span_term": {
+ "text.stems": "fox"
+ }
+ },
+ "field": "text"
+ }
+ }
+ ],
+ "slop": 5,
+ "in_order": False
+ }
+ },
+ highlight={
+ "require_field_match": False,
+ "fields": {
+ "*": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/38af4a55c1ea0f908dc7b06d680d2789.asciidoc b/docs/examples/38af4a55c1ea0f908dc7b06d680d2789.asciidoc
new file mode 100644
index 000000000..13322f19b
--- /dev/null
+++ b/docs/examples/38af4a55c1ea0f908dc7b06d680d2789.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:507
+
+[source, python]
+----
+resp = client.indices.create_data_stream(
+ name="new-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/38b20fe981605e80a41517e9aa13134a.asciidoc b/docs/examples/38b20fe981605e80a41517e9aa13134a.asciidoc
new file mode 100644
index 000000000..b65ee9117
--- /dev/null
+++ b/docs/examples/38b20fe981605e80a41517e9aa13134a.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/bucket-selector-aggregation.asciidoc:51
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "total_sales": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "sales_bucket_filter": {
+ "bucket_selector": {
+ "buckets_path": {
+ "totalSales": "total_sales"
+ },
+ "script": "params.totalSales > 200"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/38ba93890494bfa7beece58dffa44f98.asciidoc b/docs/examples/38ba93890494bfa7beece58dffa44f98.asciidoc
index 730df1577..b82fab19a 100644
--- a/docs/examples/38ba93890494bfa7beece58dffa44f98.asciidoc
+++ b/docs/examples/38ba93890494bfa7beece58dffa44f98.asciidoc
@@ -1,18 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/semantic-text.asciidoc:177
[source, python]
----
resp = client.bulk(
index="test-index",
- body=[
- {"update": {"_id": "1"}},
+ operations=[
+ {
+ "update": {
+ "_id": "1"
+ }
+ },
{
"doc": {
"infer_field": "updated inference field",
- "source_field": "updated source field",
+ "source_field": "updated source field"
}
- },
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/38eed000de433b540116928681c520d3.asciidoc b/docs/examples/38eed000de433b540116928681c520d3.asciidoc
new file mode 100644
index 000000000..dc8c501d5
--- /dev/null
+++ b/docs/examples/38eed000de433b540116928681c520d3.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/preview-datafeed.asciidoc:110
+
+[source, python]
+----
+resp = client.ml.preview_datafeed(
+ datafeed_id="datafeed-high_sum_total_sales",
+)
+print(resp)
+----
diff --git a/docs/examples/38f7739f750f1411bccf511a0abaaea3.asciidoc b/docs/examples/38f7739f750f1411bccf511a0abaaea3.asciidoc
new file mode 100644
index 000000000..148e2b226
--- /dev/null
+++ b/docs/examples/38f7739f750f1411bccf511a0abaaea3.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/field-caps.asciidoc:13
+
+[source, python]
+----
+resp = client.field_caps(
+ fields="rating",
+)
+print(resp)
+----
diff --git a/docs/examples/38ffa96674b5fd4042589af0ebb0437b.asciidoc b/docs/examples/38ffa96674b5fd4042589af0ebb0437b.asciidoc
new file mode 100644
index 000000000..8f28385ce
--- /dev/null
+++ b/docs/examples/38ffa96674b5fd4042589af0ebb0437b.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/configuring-ldap-realm.asciidoc:152
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="basic_users",
+ roles=[
+ "user"
+ ],
+ rules={
+ "field": {
+ "groups": "cn=users,dc=example,dc=com"
+ }
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/3924ee252581ebb96ac0e60046125ae8.asciidoc b/docs/examples/3924ee252581ebb96ac0e60046125ae8.asciidoc
new file mode 100644
index 000000000..c4035e5f0
--- /dev/null
+++ b/docs/examples/3924ee252581ebb96ac0e60046125ae8.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-users.asciidoc:63
+
+[source, python]
+----
+resp = client.security.get_user(
+ username="jacknich",
+)
+print(resp)
+----
diff --git a/docs/examples/3951d7fcd7f849fa278daf342872125a.asciidoc b/docs/examples/3951d7fcd7f849fa278daf342872125a.asciidoc
new file mode 100644
index 000000000..86b07b0f5
--- /dev/null
+++ b/docs/examples/3951d7fcd7f849fa278daf342872125a.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:372
+
+[source, python]
+----
+resp = client.indices.analyze(
+ index="analyze_sample",
+ text="this is a test",
+)
+print(resp)
+----
diff --git a/docs/examples/39760996f94ad34aaceaa16a5cc97993.asciidoc b/docs/examples/39760996f94ad34aaceaa16a5cc97993.asciidoc
new file mode 100644
index 000000000..a7560e618
--- /dev/null
+++ b/docs/examples/39760996f94ad34aaceaa16a5cc97993.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// shutdown/apis/shutdown-get.asciidoc:61
+
+[source, python]
+----
+resp = client.shutdown.get_node(
+ node_id="USpTGYaBSIKbgSUJR2Z9lg",
+)
+print(resp)
+----
diff --git a/docs/examples/397ab5f9ea0b69ae85038bb0b9915180.asciidoc b/docs/examples/397ab5f9ea0b69ae85038bb0b9915180.asciidoc
new file mode 100644
index 000000000..404236df4
--- /dev/null
+++ b/docs/examples/397ab5f9ea0b69ae85038bb0b9915180.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-ilm.asciidoc:512
+
+[source, python]
+----
+resp = client.indices.data_streams_stats(
+ name="datastream",
+ human=True,
+)
+print(resp)
+----
diff --git a/docs/examples/397bdb40d0146102f1f4c6a35675e16a.asciidoc b/docs/examples/397bdb40d0146102f1f4c6a35675e16a.asciidoc
new file mode 100644
index 000000000..45f26e300
--- /dev/null
+++ b/docs/examples/397bdb40d0146102f1f4c6a35675e16a.asciidoc
@@ -0,0 +1,59 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/recipes/stemming.asciidoc:11
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "english_exact": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase"
+ ]
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "body": {
+ "type": "text",
+ "analyzer": "english",
+ "fields": {
+ "exact": {
+ "type": "text",
+ "analyzer": "english_exact"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="index",
+ id="1",
+ document={
+ "body": "Ski resort"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="index",
+ id="2",
+ document={
+ "body": "A pair of skis"
+ },
+)
+print(resp2)
+
+resp3 = client.indices.refresh(
+ index="index",
+)
+print(resp3)
+----
diff --git a/docs/examples/398389933901b572a06a752bc780af7c.asciidoc b/docs/examples/398389933901b572a06a752bc780af7c.asciidoc
new file mode 100644
index 000000000..8855fa937
--- /dev/null
+++ b/docs/examples/398389933901b572a06a752bc780af7c.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-anthropic.asciidoc:111
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="completion",
+ inference_id="anthropic_completion",
+ inference_config={
+ "service": "anthropic",
+ "service_settings": {
+ "api_key": "",
+ "model_id": ""
+ },
+ "task_settings": {
+ "max_tokens": 1024
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/39963032d423e2f20f53c4621b6ca3c6.asciidoc b/docs/examples/39963032d423e2f20f53c4621b6ca3c6.asciidoc
new file mode 100644
index 000000000..0b0ce0988
--- /dev/null
+++ b/docs/examples/39963032d423e2f20f53c4621b6ca3c6.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/ngram-tokenizer.asciidoc:24
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="ngram",
+ text="Quick Fox",
+)
+print(resp)
+----
diff --git a/docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc b/docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc
index 4237f68ad..6886f0a54 100644
--- a/docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc
+++ b/docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc
@@ -1,39 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/bool-query.asciidoc:184
[source, python]
----
resp = client.search(
- include_named_queries_score="true",
- body={
- "query": {
- "bool": {
- "should": [
- {
- "match": {
- "name.first": {
- "query": "shay",
- "_name": "first",
- }
+ include_named_queries_score=True,
+ query={
+ "bool": {
+ "should": [
+ {
+ "match": {
+ "name.first": {
+ "query": "shay",
+ "_name": "first"
}
- },
- {
- "match": {
- "name.last": {
- "query": "banon",
- "_name": "last",
- }
- }
- },
- ],
- "filter": {
- "terms": {
- "name.last": ["banon", "kimchy"],
- "_name": "test",
}
},
+ {
+ "match": {
+ "name.last": {
+ "query": "banon",
+ "_name": "last"
+ }
+ }
+ }
+ ],
+ "filter": {
+ "terms": {
+ "name.last": [
+ "banon",
+ "kimchy"
+ ],
+ "_name": "test"
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/39d6f575c9458d9c941364dfd0493fa0.asciidoc b/docs/examples/39d6f575c9458d9c941364dfd0493fa0.asciidoc
new file mode 100644
index 000000000..fc9b88784
--- /dev/null
+++ b/docs/examples/39d6f575c9458d9c941364dfd0493fa0.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-calendar-event.asciidoc:112
+
+[source, python]
+----
+resp = client.ml.get_calendar_events(
+ calendar_id="planned-outages",
+)
+print(resp)
+----
diff --git a/docs/examples/3a12feb0de224bfaaf518d95b9f516ff.asciidoc b/docs/examples/3a12feb0de224bfaaf518d95b9f516ff.asciidoc
new file mode 100644
index 000000000..aea9c1758
--- /dev/null
+++ b/docs/examples/3a12feb0de224bfaaf518d95b9f516ff.asciidoc
@@ -0,0 +1,58 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/put-watch.asciidoc:120
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="my-watch",
+ trigger={
+ "schedule": {
+ "cron": "0 0/1 * * * ?"
+ }
+ },
+ input={
+ "search": {
+ "request": {
+ "indices": [
+ "logstash*"
+ ],
+ "body": {
+ "query": {
+ "bool": {
+ "must": {
+ "match": {
+ "response": 404
+ }
+ },
+ "filter": {
+ "range": {
+ "@timestamp": {
+ "from": "{{ctx.trigger.scheduled_time}}||-5m",
+ "to": "{{ctx.trigger.triggered_time}}"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ condition={
+ "compare": {
+ "ctx.payload.hits.total": {
+ "gt": 0
+ }
+ }
+ },
+ actions={
+ "email_admin": {
+ "email": {
+ "to": "admin@domain.host.com",
+ "subject": "404 recently encountered"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3a2953fd81d65118a776c87a81530e15.asciidoc b/docs/examples/3a2953fd81d65118a776c87a81530e15.asciidoc
new file mode 100644
index 000000000..1264164ad
--- /dev/null
+++ b/docs/examples/3a2953fd81d65118a776c87a81530e15.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:593
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ highlight={
+ "order": "score",
+ "fields": {
+ "comment": {
+ "fragment_size": 150,
+ "number_of_fragments": 3
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3a2f37f8f32b1aa6bcfb252b9e00f904.asciidoc b/docs/examples/3a2f37f8f32b1aa6bcfb252b9e00f904.asciidoc
new file mode 100644
index 000000000..8b4e3c4e5
--- /dev/null
+++ b/docs/examples/3a2f37f8f32b1aa6bcfb252b9e00f904.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// index-modules.asciidoc:95
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "index": {
+ "mode": "standard"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3a3adae6dbb2c0316a7d98d0a6c1d4f8.asciidoc b/docs/examples/3a3adae6dbb2c0316a7d98d0a6c1d4f8.asciidoc
new file mode 100644
index 000000000..5d4e6a35e
--- /dev/null
+++ b/docs/examples/3a3adae6dbb2c0316a7d98d0a6c1d4f8.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:342
+
+[source, python]
+----
+resp = client.search(
+ index="quantized-image-index",
+ knn={
+ "field": "image-vector",
+ "query_vector": [
+ 0.1,
+ -2
+ ],
+ "k": 15,
+ "num_candidates": 100
+ },
+ fields=[
+ "title"
+ ],
+ rescore={
+ "window_size": 10,
+ "query": {
+ "rescore_query": {
+ "script_score": {
+ "query": {
+ "match_all": {}
+ },
+ "script": {
+ "source": "cosineSimilarity(params.query_vector, 'image-vector') + 1.0",
+ "params": {
+ "query_vector": [
+ 0.1,
+ -2
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3a3e6e2627cafa08e4402a0de95785cc.asciidoc b/docs/examples/3a3e6e2627cafa08e4402a0de95785cc.asciidoc
new file mode 100644
index 000000000..69082c4d5
--- /dev/null
+++ b/docs/examples/3a3e6e2627cafa08e4402a0de95785cc.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/collapse-search-results.asciidoc:207
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "message": "you know for search"
+ }
+ },
+ collapse={
+ "field": "user.id"
+ },
+ rescore={
+ "window_size": 50,
+ "query": {
+ "rescore_query": {
+ "match_phrase": {
+ "message": "you know for search"
+ }
+ },
+ "query_weight": 0.3,
+ "rescore_query_weight": 1.4
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3a5f2e2313614ea9693545edee22ac43.asciidoc b/docs/examples/3a5f2e2313614ea9693545edee22ac43.asciidoc
new file mode 100644
index 000000000..51594a734
--- /dev/null
+++ b/docs/examples/3a5f2e2313614ea9693545edee22ac43.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/delete-service-token.asciidoc:47
+
+[source, python]
+----
+resp = client.security.delete_service_token(
+ namespace="elastic",
+ service="fleet-server",
+ name="token42",
+)
+print(resp)
+----
diff --git a/docs/examples/3a6238835c7d9f51e6d91f92885fadeb.asciidoc b/docs/examples/3a6238835c7d9f51e6d91f92885fadeb.asciidoc
new file mode 100644
index 000000000..d35ef64ac
--- /dev/null
+++ b/docs/examples/3a6238835c7d9f51e6d91f92885fadeb.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:11
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "post_date": {
+ "type": "date"
+ },
+ "user": {
+ "type": "keyword"
+ },
+ "name": {
+ "type": "keyword"
+ },
+ "age": {
+ "type": "integer"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3a64ae799cc03fadbb802794730c23da.asciidoc b/docs/examples/3a64ae799cc03fadbb802794730c23da.asciidoc
new file mode 100644
index 000000000..d46d81647
--- /dev/null
+++ b/docs/examples/3a64ae799cc03fadbb802794730c23da.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-shape-query.asciidoc:86
+
+[source, python]
+----
+resp = client.indices.create(
+ index="example_points",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="example_points",
+ id="1",
+ refresh=True,
+ document={
+ "name": "Wind & Wetter, Berlin, Germany",
+ "location": [
+ 13.400544,
+ 52.530286
+ ]
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/3a7a6ab88a49b484fafb10c8eb09b562.asciidoc b/docs/examples/3a7a6ab88a49b484fafb10c8eb09b562.asciidoc
new file mode 100644
index 000000000..3ee86992c
--- /dev/null
+++ b/docs/examples/3a7a6ab88a49b484fafb10c8eb09b562.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc:15
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="cohere_embeddings",
+ processors=[
+ {
+ "inference": {
+ "model_id": "cohere_embeddings",
+ "input_output": {
+ "input_field": "content",
+ "output_field": "content_embedding"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/3aa0e2d25a51bf5f3f0bda7fd8403bf2.asciidoc b/docs/examples/3aa0e2d25a51bf5f3f0bda7fd8403bf2.asciidoc
new file mode 100644
index 000000000..a70f68f80
--- /dev/null
+++ b/docs/examples/3aa0e2d25a51bf5f3f0bda7fd8403bf2.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/stop-tokenfilter.asciidoc:183
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "default": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "my_custom_stop_words_filter"
+ ]
+ }
+ },
+ "filter": {
+ "my_custom_stop_words_filter": {
+ "type": "stop",
+ "ignore_case": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3abedc1d68fe1d20621157406b2b1de0.asciidoc b/docs/examples/3abedc1d68fe1d20621157406b2b1de0.asciidoc
new file mode 100644
index 000000000..0a703cce4
--- /dev/null
+++ b/docs/examples/3abedc1d68fe1d20621157406b2b1de0.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/word-delimiter-tokenfilter.asciidoc:359
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "keyword",
+ "filter": [
+ "my_custom_word_delimiter_filter"
+ ]
+ }
+ },
+ "filter": {
+ "my_custom_word_delimiter_filter": {
+ "type": "word_delimiter",
+ "type_table": [
+ "- => ALPHA"
+ ],
+ "split_on_case_change": False,
+ "split_on_numerics": False,
+ "stem_english_possessive": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3ac075c5b5bbe648d40d06cce3061367.asciidoc b/docs/examples/3ac075c5b5bbe648d40d06cce3061367.asciidoc
new file mode 100644
index 000000000..6f4df4700
--- /dev/null
+++ b/docs/examples/3ac075c5b5bbe648d40d06cce3061367.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:577
+
+[source, python]
+----
+resp = client.render_search_template(
+ source="{ \"query\": { \"bool\": { \"filter\": [ {{#year_scope}} { \"range\": { \"@timestamp\": { \"gte\": \"now-1y/d\", \"lt\": \"now/d\" } } }, {{/year_scope}} { \"term\": { \"user.id\": \"{{user_id}}\" }}]}}}",
+ params={
+ "year_scope": False,
+ "user_id": "kimchy"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3ac8b5234e9d53859245cf8ab0094ca5.asciidoc b/docs/examples/3ac8b5234e9d53859245cf8ab0094ca5.asciidoc
new file mode 100644
index 000000000..e510a9c1b
--- /dev/null
+++ b/docs/examples/3ac8b5234e9d53859245cf8ab0094ca5.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/delete-job.asciidoc:68
+
+[source, python]
+----
+resp = client.ml.delete_job(
+ job_id="total-requests",
+)
+print(resp)
+----
diff --git a/docs/examples/3af10fde8138d9d95df127d39d9a0ed2.asciidoc b/docs/examples/3af10fde8138d9d95df127d39d9a0ed2.asciidoc
new file mode 100644
index 000000000..98671cac7
--- /dev/null
+++ b/docs/examples/3af10fde8138d9d95df127d39d9a0ed2.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/troubleshooting-shards-capacity.asciidoc:223
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.max_shards_per_node": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3afc6dacf90b42900ab571aad8a61d75.asciidoc b/docs/examples/3afc6dacf90b42900ab571aad8a61d75.asciidoc
new file mode 100644
index 000000000..9168398c6
--- /dev/null
+++ b/docs/examples/3afc6dacf90b42900ab571aad8a61d75.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1598
+
+[source, python]
+----
+resp = client.indices.create(
+ index="serbian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "serbian_stop": {
+ "type": "stop",
+ "stopwords": "_serbian_"
+ },
+ "serbian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "пример"
+ ]
+ },
+ "serbian_stemmer": {
+ "type": "stemmer",
+ "language": "serbian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_serbian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "serbian_stop",
+ "serbian_keywords",
+ "serbian_stemmer",
+ "serbian_normalization"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3b0475515ee692a2d9850c2bd7cdb895.asciidoc b/docs/examples/3b0475515ee692a2d9850c2bd7cdb895.asciidoc
index 0eea5d248..42e766857 100644
--- a/docs/examples/3b0475515ee692a2d9850c2bd7cdb895.asciidoc
+++ b/docs/examples/3b0475515ee692a2d9850c2bd7cdb895.asciidoc
@@ -1,27 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:648
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "unindexed_longs": {
- "match_mapping_type": "long",
- "mapping": {"type": "long", "index": False},
+ mappings={
+ "dynamic_templates": [
+ {
+ "unindexed_longs": {
+ "match_mapping_type": "long",
+ "mapping": {
+ "type": "long",
+ "index": False
}
- },
- {
- "unindexed_doubles": {
- "match_mapping_type": "double",
- "mapping": {"type": "float", "index": False},
+ }
+ },
+ {
+ "unindexed_doubles": {
+ "match_mapping_type": "double",
+ "mapping": {
+ "type": "float",
+ "index": False
}
- },
- ]
- }
+ }
+ }
+ ]
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3b04cc894e6a47d57983484010feac0c.asciidoc b/docs/examples/3b04cc894e6a47d57983484010feac0c.asciidoc
index 37d831202..7cc78c0b8 100644
--- a/docs/examples/3b04cc894e6a47d57983484010feac0c.asciidoc
+++ b/docs/examples/3b04cc894e6a47d57983484010feac0c.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:863
[source, python]
@@ -8,9 +9,9 @@ resp = client.get(
)
print(resp)
-resp = client.get(
+resp1 = client.get(
index="metricbeat-2016.05.31-1",
id="1",
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/3b05128cba6852e79a905bcdd5a8ebc0.asciidoc b/docs/examples/3b05128cba6852e79a905bcdd5a8ebc0.asciidoc
new file mode 100644
index 000000000..a14bbf5cd
--- /dev/null
+++ b/docs/examples/3b05128cba6852e79a905bcdd5a8ebc0.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/common-options.asciidoc:374
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ size="surprise_me",
+ error_trace=True,
+)
+print(resp)
+----
diff --git a/docs/examples/3b162509ed14eda44a9681cd1108fa39.asciidoc b/docs/examples/3b162509ed14eda44a9681cd1108fa39.asciidoc
new file mode 100644
index 000000000..8301ebafd
--- /dev/null
+++ b/docs/examples/3b162509ed14eda44a9681cd1108fa39.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/phrase-suggest.asciidoc:80
+
+[source, python]
+----
+resp = client.search(
+ index="test",
+ suggest={
+ "text": "noble prize",
+ "simple_phrase": {
+ "phrase": {
+ "field": "title.trigram",
+ "size": 1,
+ "gram_size": 3,
+ "direct_generator": [
+ {
+ "field": "title.trigram",
+ "suggest_mode": "always"
+ }
+ ],
+ "highlight": {
+ "pre_tag": "",
+ "post_tag": ""
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3b18e9de638ff0b1c7a1f1f6bf1c24f3.asciidoc b/docs/examples/3b18e9de638ff0b1c7a1f1f6bf1c24f3.asciidoc
new file mode 100644
index 000000000..4e2dc399f
--- /dev/null
+++ b/docs/examples/3b18e9de638ff0b1c7a1f1f6bf1c24f3.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-app-privileges.asciidoc:88
+
+[source, python]
+----
+resp = client.security.get_privileges(
+ application="myapp",
+)
+print(resp)
+----
diff --git a/docs/examples/3b1ff884f3bab390ae357e622c0544a9.asciidoc b/docs/examples/3b1ff884f3bab390ae357e622c0544a9.asciidoc
new file mode 100644
index 000000000..7dfe089db
--- /dev/null
+++ b/docs/examples/3b1ff884f3bab390ae357e622c0544a9.asciidoc
@@ -0,0 +1,95 @@
+// This file is autogenerated, DO NOT EDIT
+// search/rrf.asciidoc:182
+
+[source, python]
+----
+resp = client.indices.create(
+ index="example-index",
+ mappings={
+ "properties": {
+ "text": {
+ "type": "text"
+ },
+ "vector": {
+ "type": "dense_vector",
+ "dims": 1,
+ "index": True,
+ "similarity": "l2_norm",
+ "index_options": {
+ "type": "hnsw"
+ }
+ },
+ "integer": {
+ "type": "integer"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="example-index",
+ id="1",
+ document={
+ "text": "rrf",
+ "vector": [
+ 5
+ ],
+ "integer": 1
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="example-index",
+ id="2",
+ document={
+ "text": "rrf rrf",
+ "vector": [
+ 4
+ ],
+ "integer": 2
+ },
+)
+print(resp2)
+
+resp3 = client.index(
+ index="example-index",
+ id="3",
+ document={
+ "text": "rrf rrf rrf",
+ "vector": [
+ 3
+ ],
+ "integer": 1
+ },
+)
+print(resp3)
+
+resp4 = client.index(
+ index="example-index",
+ id="4",
+ document={
+ "text": "rrf rrf rrf rrf",
+ "integer": 2
+ },
+)
+print(resp4)
+
+resp5 = client.index(
+ index="example-index",
+ id="5",
+ document={
+ "vector": [
+ 0
+ ],
+ "integer": 1
+ },
+)
+print(resp5)
+
+resp6 = client.indices.refresh(
+ index="example-index",
+)
+print(resp6)
+----
diff --git a/docs/examples/3b40db1c5c6b36f087d7a09a4ce285c6.asciidoc b/docs/examples/3b40db1c5c6b36f087d7a09a4ce285c6.asciidoc
new file mode 100644
index 000000000..1bdcf73a4
--- /dev/null
+++ b/docs/examples/3b40db1c5c6b36f087d7a09a4ce285c6.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-index-template.asciidoc:87
+
+[source, python]
+----
+resp = client.indices.get_index_template()
+print(resp)
+----
diff --git a/docs/examples/3b606631284877f9bca15051630995ad.asciidoc b/docs/examples/3b606631284877f9bca15051630995ad.asciidoc
new file mode 100644
index 000000000..ccbcc0ec2
--- /dev/null
+++ b/docs/examples/3b606631284877f9bca15051630995ad.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:436
+
+[source, python]
+----
+resp = client.search(
+ index="my_test_scores",
+ query={
+ "term": {
+ "grad_year": "2099"
+ }
+ },
+ sort=[
+ {
+ "_script": {
+ "type": "number",
+ "script": {
+ "source": "doc['math_score'].value + doc['verbal_score'].value"
+ },
+ "order": "desc"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/3b64821fe9db73eb03860c60d775d7ff.asciidoc b/docs/examples/3b64821fe9db73eb03860c60d775d7ff.asciidoc
new file mode 100644
index 000000000..e8fb70a41
--- /dev/null
+++ b/docs/examples/3b64821fe9db73eb03860c60d775d7ff.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/update-cross-cluster-api-key.asciidoc:191
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_security/cross_cluster/api_key/VuaCfGcBCdbkQm-e5aOx",
+ headers={"Content-Type": "application/json"},
+ body={
+ "access": {
+ "replication": [
+ {
+ "names": [
+ "archive"
+ ]
+ }
+ ]
+ },
+ "metadata": {
+ "application": "replication"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3b6718257421b5419bf4cd6a7303c57e.asciidoc b/docs/examples/3b6718257421b5419bf4cd6a7303c57e.asciidoc
new file mode 100644
index 000000000..0bea327f3
--- /dev/null
+++ b/docs/examples/3b6718257421b5419bf4cd6a7303c57e.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/get-geoip-database.asciidoc:55
+
+[source, python]
+----
+resp = client.perform_request(
+ "GET",
+ "/_ingest/geoip/database/my-database-id",
+)
+print(resp)
+----
diff --git a/docs/examples/3b8ab7027e0d616fb432acd8813e086c.asciidoc b/docs/examples/3b8ab7027e0d616fb432acd8813e086c.asciidoc
index 1ba4988d4..d7909425e 100644
--- a/docs/examples/3b8ab7027e0d616fb432acd8813e086c.asciidoc
+++ b/docs/examples/3b8ab7027e0d616fb432acd8813e086c.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/index_.asciidoc:544
[source, python]
@@ -5,11 +6,13 @@
resp = client.index(
index="my-index-000001",
id="1",
- body={
+ document={
"@timestamp": "2099-11-15T13:12:00",
"message": "GET /search HTTP/1.1 200 1070000",
- "user": {"id": "kimchy"},
+ "user": {
+ "id": "kimchy"
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3b9c54604535d97e8368d47148aecc6f.asciidoc b/docs/examples/3b9c54604535d97e8368d47148aecc6f.asciidoc
new file mode 100644
index 000000000..8f8853fb3
--- /dev/null
+++ b/docs/examples/3b9c54604535d97e8368d47148aecc6f.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/update-snapshot.asciidoc:49
+
+[source, python]
+----
+resp = client.ml.update_model_snapshot(
+ job_id="it_ops_new_logs",
+ snapshot_id="1491852978",
+ description="Snapshot 1",
+ retain=True,
+)
+print(resp)
+----
diff --git a/docs/examples/3ba2896bcc724c27be8f0decf6f81813.asciidoc b/docs/examples/3ba2896bcc724c27be8f0decf6f81813.asciidoc
new file mode 100644
index 000000000..9b0f4b908
--- /dev/null
+++ b/docs/examples/3ba2896bcc724c27be8f0decf6f81813.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// monitoring/indices.asciidoc:126
+
+[source, python]
+----
+resp = client.indices.put_template(
+ name="custom_monitoring",
+ index_patterns=[
+ ".monitoring-beats-7-*",
+ ".monitoring-es-7-*",
+ ".monitoring-kibana-7-*",
+ ".monitoring-logstash-7-*"
+ ],
+ order=1,
+ settings={
+ "number_of_shards": 5,
+ "number_of_replicas": 2
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3bb491db29deba25e1cc82bcaa1aa1a1.asciidoc b/docs/examples/3bb491db29deba25e1cc82bcaa1aa1a1.asciidoc
index 9bb3ffd31..8520d79fc 100644
--- a/docs/examples/3bb491db29deba25e1cc82bcaa1aa1a1.asciidoc
+++ b/docs/examples/3bb491db29deba25e1cc82bcaa1aa1a1.asciidoc
@@ -1,15 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:775
[source, python]
----
resp = client.reindex(
- body={
- "source": {"index": "my-index-000001"},
- "dest": {"index": "my-new-index-000001"},
- "script": {
- "source": 'ctx._source.tag = ctx._source.remove("flag")'
- },
+ source={
+ "index": "my-index-000001"
+ },
+ dest={
+ "index": "my-new-index-000001"
+ },
+ script={
+ "source": "ctx._source.tag = ctx._source.remove(\"flag\")"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3bb5951a9e1186af5d154f56ffc13502.asciidoc b/docs/examples/3bb5951a9e1186af5d154f56ffc13502.asciidoc
new file mode 100644
index 000000000..06169b805
--- /dev/null
+++ b/docs/examples/3bb5951a9e1186af5d154f56ffc13502.asciidoc
@@ -0,0 +1,48 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/ignore-above.asciidoc:10
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "message": {
+ "type": "keyword",
+ "ignore_above": 20
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "message": "Syntax error"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="my-index-000001",
+ id="2",
+ document={
+ "message": "Syntax error with some long stacktrace"
+ },
+)
+print(resp2)
+
+resp3 = client.search(
+ index="my-index-000001",
+ aggs={
+ "messages": {
+ "terms": {
+ "field": "message"
+ }
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/3bc872dbcdad8ff02cbaea39e7f38352.asciidoc b/docs/examples/3bc872dbcdad8ff02cbaea39e7f38352.asciidoc
new file mode 100644
index 000000000..e1218aca3
--- /dev/null
+++ b/docs/examples/3bc872dbcdad8ff02cbaea39e7f38352.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:202
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index_double",
+ mappings={
+ "properties": {
+ "field": {
+ "type": "date"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3bfa2362add163802fc2210cc2f37ba2.asciidoc b/docs/examples/3bfa2362add163802fc2210cc2f37ba2.asciidoc
new file mode 100644
index 000000000..d5d96fb70
--- /dev/null
+++ b/docs/examples/3bfa2362add163802fc2210cc2f37ba2.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/clone-snapshot-api.asciidoc:10
+
+[source, python]
+----
+resp = client.snapshot.clone(
+ repository="my_repository",
+ snapshot="source_snapshot",
+ target_snapshot="target_snapshot",
+ indices="index_a,index_b",
+)
+print(resp)
+----
diff --git a/docs/examples/3c04f75bcbb07125d51b21b9b2c9f6f0.asciidoc b/docs/examples/3c04f75bcbb07125d51b21b9b2c9f6f0.asciidoc
new file mode 100644
index 000000000..f4da7d85f
--- /dev/null
+++ b/docs/examples/3c04f75bcbb07125d51b21b9b2c9f6f0.asciidoc
@@ -0,0 +1,60 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/index-field.asciidoc:11
+
+[source, python]
+----
+resp = client.index(
+ index="index_1",
+ id="1",
+ document={
+ "text": "Document in index 1"
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="index_2",
+ id="2",
+ refresh=True,
+ document={
+ "text": "Document in index 2"
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="index_1,index_2",
+ query={
+ "terms": {
+ "_index": [
+ "index_1",
+ "index_2"
+ ]
+ }
+ },
+ aggs={
+ "indices": {
+ "terms": {
+ "field": "_index",
+ "size": 10
+ }
+ }
+ },
+ sort=[
+ {
+ "_index": {
+ "order": "asc"
+ }
+ }
+ ],
+ script_fields={
+ "index_name": {
+ "script": {
+ "lang": "painless",
+ "source": "doc['_index']"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/3c09ca91057216125ed0e3856a91ff95.asciidoc b/docs/examples/3c09ca91057216125ed0e3856a91ff95.asciidoc
new file mode 100644
index 000000000..966ed36ed
--- /dev/null
+++ b/docs/examples/3c09ca91057216125ed0e3856a91ff95.asciidoc
@@ -0,0 +1,151 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-ilm.asciidoc:91
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="datastream_template",
+ index_patterns=[
+ "datastream*"
+ ],
+ data_stream={},
+ template={
+ "settings": {
+ "index": {
+ "mode": "time_series",
+ "number_of_replicas": 0,
+ "number_of_shards": 2
+ },
+ "index.lifecycle.name": "datastream_policy"
+ },
+ "mappings": {
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ },
+ "kubernetes": {
+ "properties": {
+ "container": {
+ "properties": {
+ "cpu": {
+ "properties": {
+ "usage": {
+ "properties": {
+ "core": {
+ "properties": {
+ "ns": {
+ "type": "long"
+ }
+ }
+ },
+ "limit": {
+ "properties": {
+ "pct": {
+ "type": "float"
+ }
+ }
+ },
+ "nanocores": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ },
+ "node": {
+ "properties": {
+ "pct": {
+ "type": "float"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "memory": {
+ "properties": {
+ "available": {
+ "properties": {
+ "bytes": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ }
+ }
+ },
+ "majorpagefaults": {
+ "type": "long"
+ },
+ "pagefaults": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ },
+ "rss": {
+ "properties": {
+ "bytes": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ }
+ }
+ },
+ "usage": {
+ "properties": {
+ "bytes": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ },
+ "limit": {
+ "properties": {
+ "pct": {
+ "type": "float"
+ }
+ }
+ },
+ "node": {
+ "properties": {
+ "pct": {
+ "type": "float"
+ }
+ }
+ }
+ }
+ },
+ "workingset": {
+ "properties": {
+ "bytes": {
+ "type": "long",
+ "time_series_metric": "gauge"
+ }
+ }
+ }
+ }
+ },
+ "name": {
+ "type": "keyword"
+ },
+ "start_time": {
+ "type": "date"
+ }
+ }
+ },
+ "host": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "namespace": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "node": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "pod": {
+ "type": "keyword",
+ "time_series_dimension": True
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3c345feb7c52fd54bcb5d5505fd8bc3b.asciidoc b/docs/examples/3c345feb7c52fd54bcb5d5505fd8bc3b.asciidoc
index 6e2840b65..e7a52923d 100644
--- a/docs/examples/3c345feb7c52fd54bcb5d5505fd8bc3b.asciidoc
+++ b/docs/examples/3c345feb7c52fd54bcb5d5505fd8bc3b.asciidoc
@@ -1,15 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/infer-trained-model.asciidoc:1008
[source, python]
----
resp = client.ml.infer_trained_model(
model_id="model2",
- body={
- "docs": [{"text_field": ""}],
- "inference_config": {
- "question_answering": {"question": ""}
- },
+ docs=[
+ {
+ "text_field": ""
+ }
+ ],
+ inference_config={
+ "question_answering": {
+ "question": ""
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3c36dc17359c6b6b6a40d04da9293fa7.asciidoc b/docs/examples/3c36dc17359c6b6b6a40d04da9293fa7.asciidoc
new file mode 100644
index 000000000..38d6308d5
--- /dev/null
+++ b/docs/examples/3c36dc17359c6b6b6a40d04da9293fa7.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/movfn-aggregation.asciidoc:393
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "the_movavg": {
+ "moving_fn": {
+ "buckets_path": "the_sum",
+ "window": 10,
+ "script": "MovingFunctions.unweightedAvg(values)"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3c5d5a5c34a62724942329658c688f5e.asciidoc b/docs/examples/3c5d5a5c34a62724942329658c688f5e.asciidoc
index 1366c2005..a6a41a73e 100644
--- a/docs/examples/3c5d5a5c34a62724942329658c688f5e.asciidoc
+++ b/docs/examples/3c5d5a5c34a62724942329658c688f5e.asciidoc
@@ -1,9 +1,10 @@
-// setup/restart-cluster.asciidoc:162
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:480
[source, python]
----
resp = client.ml.set_upgrade_mode(
- enabled="false",
+ enabled=False,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3c65cb58e131ef46f4dd081683b970ac.asciidoc b/docs/examples/3c65cb58e131ef46f4dd081683b970ac.asciidoc
new file mode 100644
index 000000000..85d2a9531
--- /dev/null
+++ b/docs/examples/3c65cb58e131ef46f4dd081683b970ac.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-distance-query.asciidoc:125
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations,my_geoshapes",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_distance": {
+ "distance": "200km",
+ "pin.location": {
+ "lat": 40,
+ "lon": -70
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3c6abb9885cb1a997fcdd16f7fa4f673.asciidoc b/docs/examples/3c6abb9885cb1a997fcdd16f7fa4f673.asciidoc
new file mode 100644
index 000000000..e56708bad
--- /dev/null
+++ b/docs/examples/3c6abb9885cb1a997fcdd16f7fa4f673.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/shrink-index.asciidoc:11
+
+[source, python]
+----
+resp = client.indices.shrink(
+ index="my-index-000001",
+ target="shrunk-my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/3c7621a81fa982b79f040a6d2611530e.asciidoc b/docs/examples/3c7621a81fa982b79f040a6d2611530e.asciidoc
new file mode 100644
index 000000000..8b35b2a9b
--- /dev/null
+++ b/docs/examples/3c7621a81fa982b79f040a6d2611530e.asciidoc
@@ -0,0 +1,50 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/simulate-template.asciidoc:151
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="ct1",
+ template={
+ "settings": {
+ "index.number_of_shards": 2
+ }
+ },
+)
+print(resp)
+
+resp1 = client.cluster.put_component_template(
+ name="ct2",
+ template={
+ "settings": {
+ "index.number_of_replicas": 0
+ },
+ "mappings": {
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ }
+ }
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.indices.put_index_template(
+ name="final-template",
+ index_patterns=[
+ "my-index-*"
+ ],
+ composed_of=[
+ "ct1",
+ "ct2"
+ ],
+ priority=5,
+)
+print(resp2)
+
+resp3 = client.indices.simulate_template(
+ name="final-template",
+)
+print(resp3)
+----
diff --git a/docs/examples/3cd2f7f9096a8e8180f27b6c30e71840.asciidoc b/docs/examples/3cd2f7f9096a8e8180f27b6c30e71840.asciidoc
new file mode 100644
index 000000000..19cc94aa1
--- /dev/null
+++ b/docs/examples/3cd2f7f9096a8e8180f27b6c30e71840.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/filters-aggregation.asciidoc:76
+
+[source, python]
+----
+resp = client.search(
+ index="logs",
+ size=0,
+ aggs={
+ "messages": {
+ "filters": {
+ "filters": [
+ {
+ "match": {
+ "body": "error"
+ }
+ },
+ {
+ "match": {
+ "body": "warning"
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3cd93a48906069709b76420c66930c01.asciidoc b/docs/examples/3cd93a48906069709b76420c66930c01.asciidoc
new file mode 100644
index 000000000..fffdc26dd
--- /dev/null
+++ b/docs/examples/3cd93a48906069709b76420c66930c01.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/stemmer-tokenfilter.asciidoc:265
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "my_stemmer"
+ ]
+ }
+ },
+ "filter": {
+ "my_stemmer": {
+ "type": "stemmer",
+ "language": "light_german"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3d05fa99ba8e1f2c3f3dfe59e4ee60f6.asciidoc b/docs/examples/3d05fa99ba8e1f2c3f3dfe59e4ee60f6.asciidoc
new file mode 100644
index 000000000..53f7a6681
--- /dev/null
+++ b/docs/examples/3d05fa99ba8e1f2c3f3dfe59e4ee60f6.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:24
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "content": "kimchy"
+ }
+ },
+ highlight={
+ "fields": {
+ "content": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3d1a0e1dc5310544d032108ae0b3f099.asciidoc b/docs/examples/3d1a0e1dc5310544d032108ae0b3f099.asciidoc
index be1ee4666..108db592e 100644
--- a/docs/examples/3d1a0e1dc5310544d032108ae0b3f099.asciidoc
+++ b/docs/examples/3d1a0e1dc5310544d032108ae0b3f099.asciidoc
@@ -1,9 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/match-all-query.asciidoc:23
[source, python]
----
resp = client.search(
- body={"query": {"match_all": {"boost": 1.2}}},
+ query={
+ "match_all": {
+ "boost": 1.2
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3d1ff6097e2359f927c88c2ccdb36252.asciidoc b/docs/examples/3d1ff6097e2359f927c88c2ccdb36252.asciidoc
new file mode 100644
index 000000000..2ae1accfc
--- /dev/null
+++ b/docs/examples/3d1ff6097e2359f927c88c2ccdb36252.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/root.asciidoc:11
+
+[source, python]
+----
+resp = client.info()
+print(resp)
+----
diff --git a/docs/examples/3d316bddd8503a6cc10566630a4155d3.asciidoc b/docs/examples/3d316bddd8503a6cc10566630a4155d3.asciidoc
new file mode 100644
index 000000000..8f6c809f3
--- /dev/null
+++ b/docs/examples/3d316bddd8503a6cc10566630a4155d3.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/get-settings.asciidoc:16
+
+[source, python]
+----
+resp = client.perform_request(
+ "GET",
+ "/_watcher/settings",
+)
+print(resp)
+----
diff --git a/docs/examples/3d48d1ba49f680aac32177d653944623.asciidoc b/docs/examples/3d48d1ba49f680aac32177d653944623.asciidoc
new file mode 100644
index 000000000..231cce08d
--- /dev/null
+++ b/docs/examples/3d48d1ba49f680aac32177d653944623.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/actions.asciidoc:186
+
+[source, python]
+----
+resp = client.watcher.ack_watch(
+ watch_id="",
+ action_id="",
+)
+print(resp)
+----
diff --git a/docs/examples/3d6935e04de21ab2f103e5b61cfd7a5b.asciidoc b/docs/examples/3d6935e04de21ab2f103e5b61cfd7a5b.asciidoc
new file mode 100644
index 000000000..f4b471a4d
--- /dev/null
+++ b/docs/examples/3d6935e04de21ab2f103e5b61cfd7a5b.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:647
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "rename": {
+ "description": "Rename 'provider' to 'cloud.provider'",
+ "field": "provider",
+ "target_field": "cloud.provider",
+ "ignore_failure": True
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/3d6a56dd3d93ece0e3da3fb66b4696d3.asciidoc b/docs/examples/3d6a56dd3d93ece0e3da3fb66b4696d3.asciidoc
new file mode 100644
index 000000000..04eade572
--- /dev/null
+++ b/docs/examples/3d6a56dd3d93ece0e3da3fb66b4696d3.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/nodes-usage.asciidoc:66
+
+[source, python]
+----
+resp = client.nodes.usage()
+print(resp)
+----
diff --git a/docs/examples/3d82257167e8a14a7f474848b32da128.asciidoc b/docs/examples/3d82257167e8a14a7f474848b32da128.asciidoc
new file mode 100644
index 000000000..ae669f2d0
--- /dev/null
+++ b/docs/examples/3d82257167e8a14a7f474848b32da128.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/set.asciidoc:157
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="set_bar",
+ description="sets the value of bar from the field foo",
+ processors=[
+ {
+ "set": {
+ "field": "bar",
+ "copy_from": "foo"
+ }
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.ingest.simulate(
+ id="set_bar",
+ docs=[
+ {
+ "_source": {
+ "foo": [
+ "foo1",
+ "foo2"
+ ]
+ }
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/3da35090e093c2d83c3b7d0d83bcb4ae.asciidoc b/docs/examples/3da35090e093c2d83c3b7d0d83bcb4ae.asciidoc
new file mode 100644
index 000000000..e76879c83
--- /dev/null
+++ b/docs/examples/3da35090e093c2d83c3b7d0d83bcb4ae.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// setup/important-settings/path-settings.asciidoc:71
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.exclude._name": "target-node-name"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3db2b5a6424aa92ecab7a8640c38685a.asciidoc b/docs/examples/3db2b5a6424aa92ecab7a8640c38685a.asciidoc
index b90ceeae4..51ec05d35 100644
--- a/docs/examples/3db2b5a6424aa92ecab7a8640c38685a.asciidoc
+++ b/docs/examples/3db2b5a6424aa92ecab7a8640c38685a.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete.asciidoc:180
[source, python]
@@ -7,4 +8,4 @@ resp = client.delete(
id="1",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3dd45f65e7bfe207e8d796118f25613c.asciidoc b/docs/examples/3dd45f65e7bfe207e8d796118f25613c.asciidoc
new file mode 100644
index 000000000..c311368c4
--- /dev/null
+++ b/docs/examples/3dd45f65e7bfe207e8d796118f25613c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/increase-cluster-shard-limit.asciidoc:147
+
+[source, python]
+----
+resp = client.cluster.get_settings(
+ flat_settings=True,
+)
+print(resp)
+----
diff --git a/docs/examples/3e121b43773cbb6dffa9b483c86a1f8d.asciidoc b/docs/examples/3e121b43773cbb6dffa9b483c86a1f8d.asciidoc
new file mode 100644
index 000000000..12737c951
--- /dev/null
+++ b/docs/examples/3e121b43773cbb6dffa9b483c86a1f8d.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/bulk-update-api-keys.asciidoc:81
+
+[source, python]
+----
+resp = client.security.create_api_key(
+ name="my-api-key",
+ role_descriptors={
+ "role-a": {
+ "cluster": [
+ "all"
+ ],
+ "indices": [
+ {
+ "names": [
+ "index-a*"
+ ],
+ "privileges": [
+ "read"
+ ]
+ }
+ ]
+ }
+ },
+ metadata={
+ "application": "my-application",
+ "environment": {
+ "level": 1,
+ "trusted": True,
+ "tags": [
+ "dev",
+ "staging"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3e13c8a81f40a537eddc0b57633b45f8.asciidoc b/docs/examples/3e13c8a81f40a537eddc0b57633b45f8.asciidoc
index baf074634..fae8da0a5 100644
--- a/docs/examples/3e13c8a81f40a537eddc0b57633b45f8.asciidoc
+++ b/docs/examples/3e13c8a81f40a537eddc0b57633b45f8.asciidoc
@@ -1,10 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:295
[source, python]
----
resp = client.indices.analyze(
index="test_index",
- body={"analyzer": "my_analyzer", "text": "missing bicycles"},
+ analyzer="my_analyzer",
+ text="missing bicycles",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3e1cb34fd6e510c79c2fff2126ac1c61.asciidoc b/docs/examples/3e1cb34fd6e510c79c2fff2126ac1c61.asciidoc
new file mode 100644
index 000000000..5e02a4299
--- /dev/null
+++ b/docs/examples/3e1cb34fd6e510c79c2fff2126ac1c61.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/meta-field.asciidoc:9
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "_meta": {
+ "class": "MyApp::User",
+ "version": {
+ "min": "1.0",
+ "max": "1.3"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3e278e6c193b4c17dbdc70670e15d78c.asciidoc b/docs/examples/3e278e6c193b4c17dbdc70670e15d78c.asciidoc
new file mode 100644
index 000000000..5d41900e4
--- /dev/null
+++ b/docs/examples/3e278e6c193b4c17dbdc70670e15d78c.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:642
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ highlight={
+ "fields": {
+ "comment": {
+ "fragment_size": 150,
+ "number_of_fragments": 3,
+ "no_match_size": 150
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3e33c1a4298ea6a0dec65a3ebf9ba973.asciidoc b/docs/examples/3e33c1a4298ea6a0dec65a3ebf9ba973.asciidoc
new file mode 100644
index 000000000..657a6b6c1
--- /dev/null
+++ b/docs/examples/3e33c1a4298ea6a0dec65a3ebf9ba973.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/termvectors.asciidoc:333
+
+[source, python]
+----
+resp = client.termvectors(
+ index="my-index-000001",
+ doc={
+ "fullname": "John Doe",
+ "text": "test test test"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3e4227250d49e81df48773f8ba803ea7.asciidoc b/docs/examples/3e4227250d49e81df48773f8ba803ea7.asciidoc
new file mode 100644
index 000000000..a6d0ba00d
--- /dev/null
+++ b/docs/examples/3e4227250d49e81df48773f8ba803ea7.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:134
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my-data-stream",
+ properties={
+ "message": {
+ "type": "text"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3e6db3d80439c2c176dbd1bb1296b6cf.asciidoc b/docs/examples/3e6db3d80439c2c176dbd1bb1296b6cf.asciidoc
new file mode 100644
index 000000000..403a71e60
--- /dev/null
+++ b/docs/examples/3e6db3d80439c2c176dbd1bb1296b6cf.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:1010
+
+[source, python]
+----
+resp = client.render_search_template(
+ id="my-search-template",
+ params={
+ "query_string": "hello world"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3e8ed6ae016eb823cb00d9035b8ac459.asciidoc b/docs/examples/3e8ed6ae016eb823cb00d9035b8ac459.asciidoc
index 196072d9b..50e9dce77 100644
--- a/docs/examples/3e8ed6ae016eb823cb00d9035b8ac459.asciidoc
+++ b/docs/examples/3e8ed6ae016eb823cb00d9035b8ac459.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// search/search.asciidoc:10
[source, python]
@@ -6,4 +7,4 @@ resp = client.search(
index="my-index-000001",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3ea33023474e77d73ac0540e3a02b0b2.asciidoc b/docs/examples/3ea33023474e77d73ac0540e3a02b0b2.asciidoc
new file mode 100644
index 000000000..2cf4f388c
--- /dev/null
+++ b/docs/examples/3ea33023474e77d73ac0540e3a02b0b2.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/mapping-roles.asciidoc:148
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="basic_users",
+ roles=[
+ "user"
+ ],
+ rules={
+ "any": [
+ {
+ "field": {
+ "dn": "cn=John Doe,cn=contractors,dc=example,dc=com"
+ }
+ },
+ {
+ "field": {
+ "groups": "cn=users,dc=example,dc=com"
+ }
+ }
+ ]
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/3eb4cdd4a799a117ac1ff5f02b18a512.asciidoc b/docs/examples/3eb4cdd4a799a117ac1ff5f02b18a512.asciidoc
index 40e57524b..94c757385 100644
--- a/docs/examples/3eb4cdd4a799a117ac1ff5f02b18a512.asciidoc
+++ b/docs/examples/3eb4cdd4a799a117ac1ff5f02b18a512.asciidoc
@@ -1,30 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:70
[source, python]
----
resp = client.indices.create(
index="index",
- body={
- "mappings": {
- "properties": {
- "query": {"type": "percolator"},
- "body": {"type": "text"},
+ mappings={
+ "properties": {
+ "query": {
+ "type": "percolator"
+ },
+ "body": {
+ "type": "text"
}
}
},
)
print(resp)
-resp = client.indices.update_aliases(
- body={"actions": [{"add": {"index": "index", "alias": "queries"}}]},
+resp1 = client.indices.update_aliases(
+ actions=[
+ {
+ "add": {
+ "index": "index",
+ "alias": "queries"
+ }
+ }
+ ],
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="queries",
id="1",
- refresh="true",
- body={"query": {"match": {"body": "quick brown fox"}}},
+ refresh=True,
+ document={
+ "query": {
+ "match": {
+ "body": "quick brown fox"
+ }
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/3ec95ba697ff97ee2d1a721a393b5926.asciidoc b/docs/examples/3ec95ba697ff97ee2d1a721a393b5926.asciidoc
new file mode 100644
index 000000000..dddb5320b
--- /dev/null
+++ b/docs/examples/3ec95ba697ff97ee2d1a721a393b5926.asciidoc
@@ -0,0 +1,75 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/analyzer.asciidoc:38
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase"
+ ]
+ },
+ "my_stop_analyzer": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "english_stop"
+ ]
+ }
+ },
+ "filter": {
+ "english_stop": {
+ "type": "stop",
+ "stopwords": "_english_"
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "title": {
+ "type": "text",
+ "analyzer": "my_analyzer",
+ "search_analyzer": "my_stop_analyzer",
+ "search_quote_analyzer": "my_analyzer"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "title": "The Quick Brown Fox"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="my-index-000001",
+ id="2",
+ document={
+ "title": "A Quick Brown Fox"
+ },
+)
+print(resp2)
+
+resp3 = client.search(
+ index="my-index-000001",
+ query={
+ "query_string": {
+ "query": "\"the quick brown fox\""
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/3eca58ef7592b3a857ea3a9898de5997.asciidoc b/docs/examples/3eca58ef7592b3a857ea3a9898de5997.asciidoc
new file mode 100644
index 000000000..fffe3e5e9
--- /dev/null
+++ b/docs/examples/3eca58ef7592b3a857ea3a9898de5997.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geohashgrid-aggregation.asciidoc:99
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggregations={
+ "zoomed-in": {
+ "filter": {
+ "geo_bounding_box": {
+ "location": {
+ "top_left": "POINT (4.9 52.4)",
+ "bottom_right": "POINT (5.0 52.3)"
+ }
+ }
+ },
+ "aggregations": {
+ "zoom1": {
+ "geohash_grid": {
+ "field": "location",
+ "precision": 8
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3ed39eb60fbfafb70f7825b8d103bf17.asciidoc b/docs/examples/3ed39eb60fbfafb70f7825b8d103bf17.asciidoc
new file mode 100644
index 000000000..35d48c1f8
--- /dev/null
+++ b/docs/examples/3ed39eb60fbfafb70f7825b8d103bf17.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-distance-query.asciidoc:75
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_distance": {
+ "distance": "200km",
+ "pin.location": {
+ "lat": 40,
+ "lon": -70
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3ed79871d956bfb2d6d2721d7272520c.asciidoc b/docs/examples/3ed79871d956bfb2d6d2721d7272520c.asciidoc
new file mode 100644
index 000000000..c7be516e2
--- /dev/null
+++ b/docs/examples/3ed79871d956bfb2d6d2721d7272520c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/stats.asciidoc:112
+
+[source, python]
+----
+resp = client.watcher.stats(
+ metric="current_watches",
+)
+print(resp)
+----
diff --git a/docs/examples/3ee232bcb2281a12b33cd9764ee4081a.asciidoc b/docs/examples/3ee232bcb2281a12b33cd9764ee4081a.asciidoc
new file mode 100644
index 000000000..38f758e43
--- /dev/null
+++ b/docs/examples/3ee232bcb2281a12b33cd9764ee4081a.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/geo-grid.asciidoc:174
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="geohex2shape",
+ description="translate H3 cell to polygon with enriched fields",
+ processors=[
+ {
+ "geo_grid": {
+ "description": "Ingest H3 cells like '811fbffffffffff' and create polygons",
+ "field": "geocell",
+ "tile_type": "geohex",
+ "target_format": "wkt",
+ "target_field": "shape",
+ "parent_field": "parent",
+ "children_field": "children",
+ "non_children_field": "nonChildren",
+ "precision_field": "precision"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc b/docs/examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc
new file mode 100644
index 000000000..680282f79
--- /dev/null
+++ b/docs/examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-async-query-api.asciidoc:17
+
+[source, python]
+----
+resp = client.esql.async_query(
+ body={
+ "query": "\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ",
+ "wait_for_completion_timeout": "2s"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3f20459d358611793272f63dc596e889.asciidoc b/docs/examples/3f20459d358611793272f63dc596e889.asciidoc
new file mode 100644
index 000000000..eb671efbf
--- /dev/null
+++ b/docs/examples/3f20459d358611793272f63dc596e889.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significanttext-aggregation.asciidoc:455
+
+[source, python]
+----
+resp = client.search(
+ index="news",
+ query={
+ "match": {
+ "custom_all": "elasticsearch"
+ }
+ },
+ aggs={
+ "tags": {
+ "significant_text": {
+ "field": "custom_all",
+ "source_fields": [
+ "content",
+ "title"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3f292a5f67e20f91bf18f5c2412a07bf.asciidoc b/docs/examples/3f292a5f67e20f91bf18f5c2412a07bf.asciidoc
new file mode 100644
index 000000000..80b24b920
--- /dev/null
+++ b/docs/examples/3f292a5f67e20f91bf18f5c2412a07bf.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/match-enrich-policy-type-ex.asciidoc:79
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="user_lookup",
+ processors=[
+ {
+ "enrich": {
+ "description": "Add 'user' data based on 'email'",
+ "policy_name": "users-policy",
+ "field": "email",
+ "target_field": "user",
+ "max_matches": "1"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/3f2e5132e35b9e8b3203a4a0541cf0d4.asciidoc b/docs/examples/3f2e5132e35b9e8b3203a4a0541cf0d4.asciidoc
new file mode 100644
index 000000000..6c2756e0b
--- /dev/null
+++ b/docs/examples/3f2e5132e35b9e8b3203a4a0541cf0d4.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-searchable-snapshot.asciidoc:93
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "cold": {
+ "actions": {
+ "searchable_snapshot": {
+ "snapshot_repository": "backing_repo"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3f30310cc6d0adae6b0f61705624a695.asciidoc b/docs/examples/3f30310cc6d0adae6b0f61705624a695.asciidoc
new file mode 100644
index 000000000..b8624b2ff
--- /dev/null
+++ b/docs/examples/3f30310cc6d0adae6b0f61705624a695.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/create-snapshot-api.asciidoc:160
+
+[source, python]
+----
+resp = client.snapshot.create(
+ repository="my_repository",
+ snapshot="snapshot_2",
+ wait_for_completion=True,
+ indices="index_1,index_2",
+ ignore_unavailable=True,
+ include_global_state=False,
+ metadata={
+ "taken_by": "user123",
+ "taken_because": "backup before upgrading"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3f5b5bee692e7d4b0992dc0a64e95a60.asciidoc b/docs/examples/3f5b5bee692e7d4b0992dc0a64e95a60.asciidoc
new file mode 100644
index 000000000..aef1b49b3
--- /dev/null
+++ b/docs/examples/3f5b5bee692e7d4b0992dc0a64e95a60.asciidoc
@@ -0,0 +1,62 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-inner-hits.asciidoc:442
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test",
+ mappings={
+ "properties": {
+ "my_join_field": {
+ "type": "join",
+ "relations": {
+ "my_parent": "my_child"
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="test",
+ id="1",
+ refresh=True,
+ document={
+ "number": 1,
+ "my_join_field": "my_parent"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="test",
+ id="2",
+ routing="1",
+ refresh=True,
+ document={
+ "number": 1,
+ "my_join_field": {
+ "name": "my_child",
+ "parent": "1"
+ }
+ },
+)
+print(resp2)
+
+resp3 = client.search(
+ index="test",
+ query={
+ "has_child": {
+ "type": "my_child",
+ "query": {
+ "match": {
+ "number": 1
+ }
+ },
+ "inner_hits": {}
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/3f60a892bed18151b7baac6cc712576a.asciidoc b/docs/examples/3f60a892bed18151b7baac6cc712576a.asciidoc
new file mode 100644
index 000000000..ab1f541d1
--- /dev/null
+++ b/docs/examples/3f60a892bed18151b7baac6cc712576a.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/kstem-tokenfilter.asciidoc:98
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "lowercase",
+ "kstem"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3f669878713a14dfba251c7ce74dd5c4.asciidoc b/docs/examples/3f669878713a14dfba251c7ce74dd5c4.asciidoc
new file mode 100644
index 000000000..e7fde7d14
--- /dev/null
+++ b/docs/examples/3f669878713a14dfba251c7ce74dd5c4.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/examples.asciidoc:640
+
+[source, python]
+----
+resp = client.transform.preview_transform(
+ source={
+ "index": "kibana_sample_data_ecommerce"
+ },
+ pivot={
+ "group_by": {
+ "customer_id": {
+ "terms": {
+ "field": "customer_id"
+ }
+ }
+ },
+ "aggregations": {
+ "last": {
+ "top_metrics": {
+ "metrics": [
+ {
+ "field": "email"
+ },
+ {
+ "field": "customer_first_name.keyword"
+ },
+ {
+ "field": "customer_last_name.keyword"
+ }
+ ],
+ "sort": {
+ "order_date": "desc"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3f8dc309b63fa0437898107b0d964217.asciidoc b/docs/examples/3f8dc309b63fa0437898107b0d964217.asciidoc
new file mode 100644
index 000000000..d97f352cd
--- /dev/null
+++ b/docs/examples/3f8dc309b63fa0437898107b0d964217.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/anomaly-detectors.asciidoc:281
+
+[source, python]
+----
+resp = client.cat.ml_jobs(
+ h="id,s,dpr,mb",
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/3f94ed945ae6416a0eb372c2db14d7e0.asciidoc b/docs/examples/3f94ed945ae6416a0eb372c2db14d7e0.asciidoc
new file mode 100644
index 000000000..336b70bbb
--- /dev/null
+++ b/docs/examples/3f94ed945ae6416a0eb372c2db14d7e0.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/recipes/stemming.asciidoc:116
+
+[source, python]
+----
+resp = client.search(
+ index="index",
+ query={
+ "simple_query_string": {
+ "fields": [
+ "body.exact"
+ ],
+ "query": "ski"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3fab530a2e43807929c0ef3ebf7d268c.asciidoc b/docs/examples/3fab530a2e43807929c0ef3ebf7d268c.asciidoc
new file mode 100644
index 000000000..1d8590c21
--- /dev/null
+++ b/docs/examples/3fab530a2e43807929c0ef3ebf7d268c.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/geoip.asciidoc:134
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="geoip",
+ description="Add geoip info",
+ processors=[
+ {
+ "geoip": {
+ "field": "ip",
+ "target_field": "geo",
+ "database_file": "GeoLite2-Country.mmdb"
+ }
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="my_id",
+ pipeline="geoip",
+ document={
+ "ip": "89.160.20.128"
+ },
+)
+print(resp1)
+
+resp2 = client.get(
+ index="my-index-000001",
+ id="my_id",
+)
+print(resp2)
+----
diff --git a/docs/examples/3faec4ca15d8c2fbbd16781b1c8693d6.asciidoc b/docs/examples/3faec4ca15d8c2fbbd16781b1c8693d6.asciidoc
new file mode 100644
index 000000000..39d544366
--- /dev/null
+++ b/docs/examples/3faec4ca15d8c2fbbd16781b1c8693d6.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-search.asciidoc:408
+
+[source, python]
+----
+resp = client.search(
+ index="mistral-embeddings",
+ knn={
+ "field": "content_embedding",
+ "query_vector_builder": {
+ "text_embedding": {
+ "model_id": "mistral_embeddings",
+ "model_text": "Calculate fuel cost"
+ }
+ },
+ "k": 10,
+ "num_candidates": 100
+ },
+ source=[
+ "id",
+ "content"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/3faf5e2873de340acfe0a617017db784.asciidoc b/docs/examples/3faf5e2873de340acfe0a617017db784.asciidoc
index 8b63eedcf..b8b84cc75 100644
--- a/docs/examples/3faf5e2873de340acfe0a617017db784.asciidoc
+++ b/docs/examples/3faf5e2873de340acfe0a617017db784.asciidoc
@@ -1,15 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:283
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {
- "query": "(content:this OR name:this) AND (content:that OR name:that)"
- }
+ query={
+ "query_string": {
+ "query": "(content:this OR name:this) AND (content:that OR name:that)"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/3fb1289c80a354da66693bfb25d7b412.asciidoc b/docs/examples/3fb1289c80a354da66693bfb25d7b412.asciidoc
new file mode 100644
index 000000000..8b3eeb644
--- /dev/null
+++ b/docs/examples/3fb1289c80a354da66693bfb25d7b412.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:514
+
+[source, python]
+----
+resp = client.slm.put_lifecycle(
+ policy_id="nightly-snapshots",
+ schedule="0 30 2 * * ?",
+ name="",
+ repository="my_repository",
+ config={
+ "include_global_state": False,
+ "indices": "*"
+ },
+ retention={
+ "expire_after": "30d",
+ "min_count": 5,
+ "max_count": 50
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3fb2f41ad229a31ad3ae408cc50cbed5.asciidoc b/docs/examples/3fb2f41ad229a31ad3ae408cc50cbed5.asciidoc
new file mode 100644
index 000000000..b1a9d5098
--- /dev/null
+++ b/docs/examples/3fb2f41ad229a31ad3ae408cc50cbed5.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-api.asciidoc:234
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ timeout="2s",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3fe0fb38f75d2a34fb1e6ac9bedbcdbc.asciidoc b/docs/examples/3fe0fb38f75d2a34fb1e6ac9bedbcdbc.asciidoc
new file mode 100644
index 000000000..0db3c9493
--- /dev/null
+++ b/docs/examples/3fe0fb38f75d2a34fb1e6ac9bedbcdbc.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/ignored-field.asciidoc:21
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "exists": {
+ "field": "_ignored"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3fe4264ace04405989141c43aadfff81.asciidoc b/docs/examples/3fe4264ace04405989141c43aadfff81.asciidoc
new file mode 100644
index 000000000..dc3644d3d
--- /dev/null
+++ b/docs/examples/3fe4264ace04405989141c43aadfff81.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-roles.asciidoc:154
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="cli_or_drivers_minimal",
+ cluster=[
+ "cluster:monitor/main"
+ ],
+ indices=[
+ {
+ "names": [
+ "test"
+ ],
+ "privileges": [
+ "read",
+ "indices:admin/get"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/3fe5e6c0d5ea4586aa04f989ae54b72e.asciidoc b/docs/examples/3fe5e6c0d5ea4586aa04f989ae54b72e.asciidoc
new file mode 100644
index 000000000..e8e5b0d59
--- /dev/null
+++ b/docs/examples/3fe5e6c0d5ea4586aa04f989ae54b72e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/verify-repo-api.asciidoc:25
+
+[source, python]
+----
+resp = client.snapshot.verify_repository(
+ name="my_repository",
+)
+print(resp)
+----
diff --git a/docs/examples/3fe79ed63195c5f8018648a5a6d645f6.asciidoc b/docs/examples/3fe79ed63195c5f8018648a5a6d645f6.asciidoc
new file mode 100644
index 000000000..8f0e33e71
--- /dev/null
+++ b/docs/examples/3fe79ed63195c5f8018648a5a6d645f6.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/routing-field.asciidoc:87
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000002",
+ mappings={
+ "_routing": {
+ "required": True
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000002",
+ id="1",
+ document={
+ "text": "No routing value provided"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/3fe9006f6c7faea162e43fb250f4da38.asciidoc b/docs/examples/3fe9006f6c7faea162e43fb250f4da38.asciidoc
new file mode 100644
index 000000000..794a4efca
--- /dev/null
+++ b/docs/examples/3fe9006f6c7faea162e43fb250f4da38.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:483
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "set": {
+ "field": "_source.my-long-field",
+ "value": 10
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/3fecd5c6d0c172566da4a54320e1cff3.asciidoc b/docs/examples/3fecd5c6d0c172566da4a54320e1cff3.asciidoc
new file mode 100644
index 000000000..8810c0f02
--- /dev/null
+++ b/docs/examples/3fecd5c6d0c172566da4a54320e1cff3.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/dictionary-decompounder-tokenfilter.asciidoc:32
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ {
+ "type": "dictionary_decompounder",
+ "word_list": [
+ "Donau",
+ "dampf",
+ "meer",
+ "schiff"
+ ]
+ }
+ ],
+ text="Donaudampfschiff",
+)
+print(resp)
+----
diff --git a/docs/examples/3ff634a50e2e4556bad7ea8553576992.asciidoc b/docs/examples/3ff634a50e2e4556bad7ea8553576992.asciidoc
new file mode 100644
index 000000000..fd08ed485
--- /dev/null
+++ b/docs/examples/3ff634a50e2e4556bad7ea8553576992.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/snowball-tokenfilter.asciidoc:17
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "my_snow"
+ ]
+ }
+ },
+ "filter": {
+ "my_snow": {
+ "type": "snowball",
+ "language": "Lovins"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/3ffe9952786ab258bb6ab928b03148a2.asciidoc b/docs/examples/3ffe9952786ab258bb6ab928b03148a2.asciidoc
new file mode 100644
index 000000000..6634d4062
--- /dev/null
+++ b/docs/examples/3ffe9952786ab258bb6ab928b03148a2.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/rare-terms-aggregation.asciidoc:92
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "genres": {
+ "rare_terms": {
+ "field": "genre"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/400e89eb46ead8e9c9e40f123fd5e590.asciidoc b/docs/examples/400e89eb46ead8e9c9e40f123fd5e590.asciidoc
index 99d9138f9..8e863d72b 100644
--- a/docs/examples/400e89eb46ead8e9c9e40f123fd5e590.asciidoc
+++ b/docs/examples/400e89eb46ead8e9c9e40f123fd5e590.asciidoc
@@ -1,12 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:428
[source, python]
----
resp = client.reindex(
- body={
- "source": {"index": "source", "size": 100},
- "dest": {"index": "dest", "routing": "=cat"},
+ source={
+ "index": "source",
+ "size": 100
+ },
+ dest={
+ "index": "dest",
+ "routing": "=cat"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/402092585940953420404c2884a47e59.asciidoc b/docs/examples/402092585940953420404c2884a47e59.asciidoc
new file mode 100644
index 000000000..df7b97f45
--- /dev/null
+++ b/docs/examples/402092585940953420404c2884a47e59.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:860
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "date": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "1d",
+ "order": "desc"
+ }
+ }
+ },
+ {
+ "product": {
+ "terms": {
+ "field": "product"
+ }
+ }
+ }
+ ]
+ },
+ "aggregations": {
+ "the_avg": {
+ "avg": {
+ "field": "price"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4029af36cb3f8202549017f7378803b4.asciidoc b/docs/examples/4029af36cb3f8202549017f7378803b4.asciidoc
index 8319dd6ce..215136b33 100644
--- a/docs/examples/4029af36cb3f8202549017f7378803b4.asciidoc
+++ b/docs/examples/4029af36cb3f8202549017f7378803b4.asciidoc
@@ -1,7 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
// cluster/get-settings.asciidoc:10
[source, python]
----
resp = client.cluster.get_settings()
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4053de806dfd9172167999ce098107c4.asciidoc b/docs/examples/4053de806dfd9172167999ce098107c4.asciidoc
new file mode 100644
index 000000000..d1dddf7a3
--- /dev/null
+++ b/docs/examples/4053de806dfd9172167999ce098107c4.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/constant-score-query.asciidoc:12
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "constant_score": {
+ "filter": {
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
+ "boost": 1.2
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc b/docs/examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc
new file mode 100644
index 000000000..500d3e1c5
--- /dev/null
+++ b/docs/examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-async-query-get-api.asciidoc:11
+
+[source, python]
+----
+resp = client.esql.async_query_get(
+ id="FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
+ body=None,
+)
+print(resp)
+----
diff --git a/docs/examples/405ac843a9156d3cab374e199cac87fb.asciidoc b/docs/examples/405ac843a9156d3cab374e199cac87fb.asciidoc
new file mode 100644
index 000000000..fa979e0df
--- /dev/null
+++ b/docs/examples/405ac843a9156d3cab374e199cac87fb.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/create-connector-sync-job-api.asciidoc:15
+
+[source, python]
+----
+resp = client.perform_request(
+ "POST",
+ "/_connector/_sync_job",
+ headers={"Content-Type": "application/json"},
+ body={
+ "id": "connector-id",
+ "job_type": "full",
+ "trigger_method": "on_demand"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/405db6f3a01eceacfaa8b0ed3e4b3ac2.asciidoc b/docs/examples/405db6f3a01eceacfaa8b0ed3e4b3ac2.asciidoc
new file mode 100644
index 000000000..33c666fed
--- /dev/null
+++ b/docs/examples/405db6f3a01eceacfaa8b0ed3e4b3ac2.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-overall-buckets.asciidoc:175
+
+[source, python]
+----
+resp = client.ml.get_overall_buckets(
+ job_id="job-*",
+ top_n=2,
+ overall_score=50,
+ start="1403532000000",
+)
+print(resp)
+----
diff --git a/docs/examples/4061fd5ba7221ca85805ed14d59a6bc5.asciidoc b/docs/examples/4061fd5ba7221ca85805ed14d59a6bc5.asciidoc
new file mode 100644
index 000000000..62d2fd139
--- /dev/null
+++ b/docs/examples/4061fd5ba7221ca85805ed14d59a6bc5.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:266
+
+[source, python]
+----
+resp = client.delete_script(
+ id="calculate-score",
+)
+print(resp)
+----
diff --git a/docs/examples/406a0f1c1aac947bcee58f86b6d036c1.asciidoc b/docs/examples/406a0f1c1aac947bcee58f86b6d036c1.asciidoc
new file mode 100644
index 000000000..8dfddaea1
--- /dev/null
+++ b/docs/examples/406a0f1c1aac947bcee58f86b6d036c1.asciidoc
@@ -0,0 +1,64 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/actions.asciidoc:112
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="log_event_watch",
+ trigger={
+ "schedule": {
+ "interval": "5m"
+ }
+ },
+ input={
+ "search": {
+ "request": {
+ "indices": "log-events",
+ "body": {
+ "size": 0,
+ "query": {
+ "match": {
+ "status": "error"
+ }
+ }
+ }
+ }
+ }
+ },
+ condition={
+ "compare": {
+ "ctx.payload.hits.total": {
+ "gt": 5
+ }
+ }
+ },
+ throttle_period="15m",
+ actions={
+ "email_administrator": {
+ "email": {
+ "to": "sys.admino@host.domain",
+ "subject": "Encountered {{ctx.payload.hits.total}} errors",
+ "body": "Too many error in the system, see attached data",
+ "attachments": {
+ "attached_data": {
+ "data": {
+ "format": "json"
+ }
+ }
+ },
+ "priority": "high"
+ }
+ },
+ "notify_pager": {
+ "webhook": {
+ "method": "POST",
+ "host": "pager.service.domain",
+ "port": 1234,
+ "path": "/{{watch_id}}",
+ "body": "Encountered {{ctx.payload.hits.total}} errors"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/408060f0c52300588a6dee774f4fd6a5.asciidoc b/docs/examples/408060f0c52300588a6dee774f4fd6a5.asciidoc
new file mode 100644
index 000000000..71728aef6
--- /dev/null
+++ b/docs/examples/408060f0c52300588a6dee774f4fd6a5.asciidoc
@@ -0,0 +1,533 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-ilm.asciidoc:260
+
+[source, python]
+----
+resp = client.bulk(
+ index="datastream",
+ refresh=True,
+ operations=[
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:49:00Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 91153,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 463314616
+ },
+ "usage": {
+ "bytes": 307007078,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 585236
+ },
+ "rss": {
+ "bytes": 102728
+ },
+ "pagefaults": 120901,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:45:50Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 124501,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 982546514
+ },
+ "usage": {
+ "bytes": 360035574,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 1339884
+ },
+ "rss": {
+ "bytes": 381174
+ },
+ "pagefaults": 178473,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:44:50Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 38907,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 862723768
+ },
+ "usage": {
+ "bytes": 379572388,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 431227
+ },
+ "rss": {
+ "bytes": 386580
+ },
+ "pagefaults": 233166,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:44:40Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 86706,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 567160996
+ },
+ "usage": {
+ "bytes": 103266017,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 1724908
+ },
+ "rss": {
+ "bytes": 105431
+ },
+ "pagefaults": 233166,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:44:00Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 150069,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 639054643
+ },
+ "usage": {
+ "bytes": 265142477,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 1786511
+ },
+ "rss": {
+ "bytes": 189235
+ },
+ "pagefaults": 138172,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:42:40Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 82260,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 854735585
+ },
+ "usage": {
+ "bytes": 309798052,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 924058
+ },
+ "rss": {
+ "bytes": 110838
+ },
+ "pagefaults": 259073,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:42:10Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 153404,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 279586406
+ },
+ "usage": {
+ "bytes": 214904955,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 1047265
+ },
+ "rss": {
+ "bytes": 91914
+ },
+ "pagefaults": 302252,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:40:20Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 125613,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 822782853
+ },
+ "usage": {
+ "bytes": 100475044,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 2109932
+ },
+ "rss": {
+ "bytes": 278446
+ },
+ "pagefaults": 74843,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:40:10Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 100046,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 567160996
+ },
+ "usage": {
+ "bytes": 362826547,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 1986724
+ },
+ "rss": {
+ "bytes": 402801
+ },
+ "pagefaults": 296495,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:38:30Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 40018,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 1062428344
+ },
+ "usage": {
+ "bytes": 265142477,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 2294743
+ },
+ "rss": {
+ "bytes": 340623
+ },
+ "pagefaults": 224530,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/40a42f005144cfed3dd1dcf2638e8211.asciidoc b/docs/examples/40a42f005144cfed3dd1dcf2638e8211.asciidoc
new file mode 100644
index 000000000..b0a59fd71
--- /dev/null
+++ b/docs/examples/40a42f005144cfed3dd1dcf2638e8211.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:774
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my_search_application",
+ params={
+ "field": "price",
+ "operator": "gte",
+ "value": 500
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/40b73b5c7ca144dc3f63f5b741f33d80.asciidoc b/docs/examples/40b73b5c7ca144dc3f63f5b741f33d80.asciidoc
new file mode 100644
index 000000000..0b7604dc6
--- /dev/null
+++ b/docs/examples/40b73b5c7ca144dc3f63f5b741f33d80.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:157
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "constant_score": {
+ "filter": {
+ "percolate": {
+ "field": "query",
+ "document": {
+ "message": "A new bonsai tree in the office"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/40bd86e400d27e68b8f0ae580c29d32d.asciidoc b/docs/examples/40bd86e400d27e68b8f0ae580c29d32d.asciidoc
new file mode 100644
index 000000000..041873ae6
--- /dev/null
+++ b/docs/examples/40bd86e400d27e68b8f0ae580c29d32d.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/size-your-shards.asciidoc:277
+
+[source, python]
+----
+resp = client.cluster.stats(
+ human=True,
+ filter_path="indices.mappings.total_deduplicated_mapping_size*",
+)
+print(resp)
+----
diff --git a/docs/examples/40c3e7bb1fdc125a1ab21bd7d7326694.asciidoc b/docs/examples/40c3e7bb1fdc125a1ab21bd7d7326694.asciidoc
new file mode 100644
index 000000000..7aeed7da6
--- /dev/null
+++ b/docs/examples/40c3e7bb1fdc125a1ab21bd7d7326694.asciidoc
@@ -0,0 +1,51 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/multivalued-fields.asciidoc:133
+
+[source, python]
+----
+resp = client.indices.create(
+ index="mv",
+ mappings={
+ "properties": {
+ "b": {
+ "type": "long"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="mv",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "a": 1,
+ "b": [
+ 2,
+ 2,
+ 1
+ ]
+ },
+ {
+ "index": {}
+ },
+ {
+ "a": 2,
+ "b": [
+ 1,
+ 1
+ ]
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.esql.query(
+ query="FROM mv | EVAL b=TO_STRING(b) | LIMIT 2",
+)
+print(resp2)
+----
diff --git a/docs/examples/40d88d4f53343ef663c89ba488ab8001.asciidoc b/docs/examples/40d88d4f53343ef663c89ba488ab8001.asciidoc
index 56962de87..0eb88d6b1 100644
--- a/docs/examples/40d88d4f53343ef663c89ba488ab8001.asciidoc
+++ b/docs/examples/40d88d4f53343ef663c89ba488ab8001.asciidoc
@@ -1,15 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:412
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "envelope",
- "coordinates": [[1000, 100], [1001, 100]],
+ "coordinates": [
+ [
+ 1000,
+ 100
+ ],
+ [
+ 1001,
+ 100
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/40d90d9dc6f4942bf92d88bfc5a34672.asciidoc b/docs/examples/40d90d9dc6f4942bf92d88bfc5a34672.asciidoc
new file mode 100644
index 000000000..599bad4d7
--- /dev/null
+++ b/docs/examples/40d90d9dc6f4942bf92d88bfc5a34672.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/match-bool-prefix-query.asciidoc:59
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match_bool_prefix": {
+ "message": {
+ "query": "quick brown f",
+ "analyzer": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/40f97f70e8e743c6a6296c81b920aeb0.asciidoc b/docs/examples/40f97f70e8e743c6a6296c81b920aeb0.asciidoc
new file mode 100644
index 000000000..90049bc1f
--- /dev/null
+++ b/docs/examples/40f97f70e8e743c6a6296c81b920aeb0.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/size-your-shards.asciidoc:312
+
+[source, python]
+----
+resp = client.nodes.stats(
+ human=True,
+ filter_path="nodes.*.name,nodes.*.indices.mappings.total_estimated_overhead*,nodes.*.jvm.mem.heap_max*",
+)
+print(resp)
+----
diff --git a/docs/examples/4113c57384aa37c58d11579e20c00760.asciidoc b/docs/examples/4113c57384aa37c58d11579e20c00760.asciidoc
index 9e387857f..b76e6d369 100644
--- a/docs/examples/4113c57384aa37c58d11579e20c00760.asciidoc
+++ b/docs/examples/4113c57384aa37c58d11579e20c00760.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:59
[source, python]
@@ -5,7 +6,7 @@
resp = client.get(
index="my-index-000001",
id="0",
- _source="false",
+ source=False,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/41175d304e660da2931764f9a4418fd3.asciidoc b/docs/examples/41175d304e660da2931764f9a4418fd3.asciidoc
new file mode 100644
index 000000000..d58c99075
--- /dev/null
+++ b/docs/examples/41175d304e660da2931764f9a4418fd3.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-pipeline-api.asciidoc:87
+
+[source, python]
+----
+resp = client.connector.update_pipeline(
+ connector_id="my-connector",
+ pipeline={
+ "extract_binary_content": True,
+ "name": "my-connector-pipeline",
+ "reduce_whitespace": True,
+ "run_ml_inference": True
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/41195ef13af0465cdee1ae18f6c00fde.asciidoc b/docs/examples/41195ef13af0465cdee1ae18f6c00fde.asciidoc
new file mode 100644
index 000000000..3febeb06c
--- /dev/null
+++ b/docs/examples/41195ef13af0465cdee1ae18f6c00fde.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// slm/apis/slm-stop.asciidoc:47
+
+[source, python]
+----
+resp = client.slm.stop()
+print(resp)
+----
diff --git a/docs/examples/412f8238ab5182678f1d8f6383031b11.asciidoc b/docs/examples/412f8238ab5182678f1d8f6383031b11.asciidoc
new file mode 100644
index 000000000..c57e81fa5
--- /dev/null
+++ b/docs/examples/412f8238ab5182678f1d8f6383031b11.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-alias.asciidoc:10
+
+[source, python]
+----
+resp = client.indices.get_alias(
+ index="my-data-stream",
+ name="my-alias",
+)
+print(resp)
+----
diff --git a/docs/examples/413fdcc7c437775a16bb55b81c2bbe2b.asciidoc b/docs/examples/413fdcc7c437775a16bb55b81c2bbe2b.asciidoc
index 5d917b1ec..fa73e0203 100644
--- a/docs/examples/413fdcc7c437775a16bb55b81c2bbe2b.asciidoc
+++ b/docs/examples/413fdcc7c437775a16bb55b81c2bbe2b.asciidoc
@@ -1,17 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1618
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "runtime": {
- "http.client.ip": {
- "type": "ip",
- "script": '\n String clientip=dissect(\'%{clientip} %{ident} %{auth} [%{@timestamp}] "%{verb} %{request} HTTP/%{httpversion}" %{status} %{size}\').extract(doc["message"].value)?.clientip;\n if (clientip != null) emit(clientip);\n ',
- }
+ runtime={
+ "http.client.ip": {
+ "type": "ip",
+ "script": "\n String clientip=dissect('%{clientip} %{ident} %{auth} [%{@timestamp}] \"%{verb} %{request} HTTP/%{httpversion}\" %{status} %{size}').extract(doc[\"message\"].value)?.clientip;\n if (clientip != null) emit(clientip);\n "
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/415b46bc2b7a7b4dcf9a73ac67ea20e9.asciidoc b/docs/examples/415b46bc2b7a7b4dcf9a73ac67ea20e9.asciidoc
new file mode 100644
index 000000000..77ac377aa
--- /dev/null
+++ b/docs/examples/415b46bc2b7a7b4dcf9a73ac67ea20e9.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/circle.asciidoc:99
+
+[source, python]
+----
+resp = client.index(
+ index="circles",
+ id="2",
+ pipeline="polygonize_circles",
+ document={
+ "circle": {
+ "type": "circle",
+ "radius": "40m",
+ "coordinates": [
+ 30,
+ 10
+ ]
+ }
+ },
+)
+print(resp)
+
+resp1 = client.get(
+ index="circles",
+ id="2",
+)
+print(resp1)
+----
diff --git a/docs/examples/416a3ba11232d3c078c1c31340cf356f.asciidoc b/docs/examples/416a3ba11232d3c078c1c31340cf356f.asciidoc
new file mode 100644
index 000000000..e8318037b
--- /dev/null
+++ b/docs/examples/416a3ba11232d3c078c1c31340cf356f.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:475
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ highlight={
+ "tags_schema": "styled",
+ "fields": {
+ "comment": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/41ad6077f9c1b8d8fefab6ea1660edcd.asciidoc b/docs/examples/41ad6077f9c1b8d8fefab6ea1660edcd.asciidoc
index 03f1cd9d0..2999bc280 100644
--- a/docs/examples/41ad6077f9c1b8d8fefab6ea1660edcd.asciidoc
+++ b/docs/examples/41ad6077f9c1b8d8fefab6ea1660edcd.asciidoc
@@ -1,16 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/params/format.asciidoc:13
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "date": {"type": "date", "format": "yyyy-MM-dd"}
+ mappings={
+ "properties": {
+ "date": {
+ "type": "date",
+ "format": "yyyy-MM-dd"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/41dbd79f624b998d01c10921e9a35c4b.asciidoc b/docs/examples/41dbd79f624b998d01c10921e9a35c4b.asciidoc
index 1d3d6190b..6f7efef11 100644
--- a/docs/examples/41dbd79f624b998d01c10921e9a35c4b.asciidoc
+++ b/docs/examples/41dbd79f624b998d01c10921e9a35c4b.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:290
[source, python]
@@ -5,7 +6,10 @@
resp = client.update(
index="test",
id="1",
- body={"doc": {"name": "new_name"}, "detect_noop": False},
+ doc={
+ "name": "new_name"
+ },
+ detect_noop=False,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/41fd33a293a575bd71a1fac7bcc8b47c.asciidoc b/docs/examples/41fd33a293a575bd71a1fac7bcc8b47c.asciidoc
new file mode 100644
index 000000000..234b4b474
--- /dev/null
+++ b/docs/examples/41fd33a293a575bd71a1fac7bcc8b47c.asciidoc
@@ -0,0 +1,50 @@
+// This file is autogenerated, DO NOT EDIT
+// search-application/apis/put-search-application.asciidoc:148
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my-app",
+ search_application={
+ "indices": [
+ "index1",
+ "index2"
+ ],
+ "template": {
+ "script": {
+ "source": {
+ "query": {
+ "query_string": {
+ "query": "{{query_string}}",
+ "default_field": "{{default_field}}"
+ }
+ }
+ },
+ "params": {
+ "query_string": "*",
+ "default_field": "*"
+ }
+ },
+ "dictionary": {
+ "properties": {
+ "query_string": {
+ "type": "string"
+ },
+ "default_field": {
+ "type": "string",
+ "enum": [
+ "title",
+ "description"
+ ]
+ },
+ "additionalProperties": False
+ },
+ "required": [
+ "query_string"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4207219a892339e8f3abe0df8723dd27.asciidoc b/docs/examples/4207219a892339e8f3abe0df8723dd27.asciidoc
index a0a0f679d..92314f5f5 100644
--- a/docs/examples/4207219a892339e8f3abe0df8723dd27.asciidoc
+++ b/docs/examples/4207219a892339e8f3abe0df8723dd27.asciidoc
@@ -1,13 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// modules/cluster/misc.asciidoc:133
[source, python]
----
resp = client.cluster.put_settings(
- body={
- "persistent": {
- "cluster.metadata.administrator": "sysadmin@example.com"
- }
+ persistent={
+ "cluster.metadata.administrator": "sysadmin@example.com"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/421e68e2b9789f0e8c08760d9e685d1c.asciidoc b/docs/examples/421e68e2b9789f0e8c08760d9e685d1c.asciidoc
new file mode 100644
index 000000000..bede87f1a
--- /dev/null
+++ b/docs/examples/421e68e2b9789f0e8c08760d9e685d1c.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/update-job.asciidoc:243
+
+[source, python]
+----
+resp = client.ml.update_job(
+ job_id="low_request_rate",
+ description="An updated job",
+ detectors={
+ "detector_index": 0,
+ "description": "An updated detector description"
+ },
+ groups=[
+ "kibana_sample_data",
+ "kibana_sample_web_logs"
+ ],
+ model_plot_config={
+ "enabled": True
+ },
+ renormalization_window_days=30,
+ background_persist_interval="2h",
+ model_snapshot_retention_days=7,
+ results_retention_days=60,
+)
+print(resp)
+----
diff --git a/docs/examples/424fbf082cd4affb84439abfc916b597.asciidoc b/docs/examples/424fbf082cd4affb84439abfc916b597.asciidoc
new file mode 100644
index 000000000..c09038abb
--- /dev/null
+++ b/docs/examples/424fbf082cd4affb84439abfc916b597.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/downsample-data-stream.asciidoc:59
+
+[source, python]
+----
+resp = client.indices.downsample(
+ index="my-time-series-index",
+ target_index="my-downsampled-time-series-index",
+ config={
+ "fixed_interval": "1d"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/425eaaf9c7e3b1e77a3474fbab4183b4.asciidoc b/docs/examples/425eaaf9c7e3b1e77a3474fbab4183b4.asciidoc
new file mode 100644
index 000000000..3f7f7db24
--- /dev/null
+++ b/docs/examples/425eaaf9c7e3b1e77a3474fbab4183b4.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/task-queue-backlog.asciidoc:22
+
+[source, python]
+----
+resp = client.cat.thread_pool(
+ v=True,
+ s="t,n",
+ h="type,name,node_name,active,queue,rejected,completed",
+)
+print(resp)
+----
diff --git a/docs/examples/4275ecbe4aa68d43a8a7139866610a27.asciidoc b/docs/examples/4275ecbe4aa68d43a8a7139866610a27.asciidoc
new file mode 100644
index 000000000..edaf441ca
--- /dev/null
+++ b/docs/examples/4275ecbe4aa68d43a8a7139866610a27.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/weighted-avg-aggregation.asciidoc:55
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size=0,
+ aggs={
+ "weighted_grade": {
+ "weighted_avg": {
+ "value": {
+ "field": "grade"
+ },
+ "weight": {
+ "field": "weight"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/42ba7c1d13aee91fe6f0a8a42c30eb74.asciidoc b/docs/examples/42ba7c1d13aee91fe6f0a8a42c30eb74.asciidoc
new file mode 100644
index 000000000..32b030aba
--- /dev/null
+++ b/docs/examples/42ba7c1d13aee91fe6f0a8a42c30eb74.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:132
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="my-data-stream",
+ lazy=True,
+)
+print(resp)
+----
diff --git a/docs/examples/42bc7608bb675dd6238e2fecbb758d06.asciidoc b/docs/examples/42bc7608bb675dd6238e2fecbb758d06.asciidoc
new file mode 100644
index 000000000..d08ed2b11
--- /dev/null
+++ b/docs/examples/42bc7608bb675dd6238e2fecbb758d06.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/geo-match-enrich-policy-type-ex.asciidoc:36
+
+[source, python]
+----
+resp = client.index(
+ index="postal_codes",
+ id="1",
+ refresh="wait_for",
+ document={
+ "location": {
+ "type": "envelope",
+ "coordinates": [
+ [
+ 13,
+ 53
+ ],
+ [
+ 14,
+ 52
+ ]
+ ]
+ },
+ "postal_code": "96598"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/42d02087f1c8ab0452ef373079a76843.asciidoc b/docs/examples/42d02087f1c8ab0452ef373079a76843.asciidoc
new file mode 100644
index 000000000..f0e728900
--- /dev/null
+++ b/docs/examples/42d02087f1c8ab0452ef373079a76843.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/stop-analyzer.asciidoc:15
+
+[source, python]
+----
+resp = client.indices.analyze(
+ analyzer="stop",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/42deb4fe32afbe0f94185e256a79c447.asciidoc b/docs/examples/42deb4fe32afbe0f94185e256a79c447.asciidoc
new file mode 100644
index 000000000..1510d64b1
--- /dev/null
+++ b/docs/examples/42deb4fe32afbe0f94185e256a79c447.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/stop-analyzer.asciidoc:249
+
+[source, python]
+----
+resp = client.indices.create(
+ index="stop_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "english_stop": {
+ "type": "stop",
+ "stopwords": "_english_"
+ }
+ },
+ "analyzer": {
+ "rebuilt_stop": {
+ "tokenizer": "lowercase",
+ "filter": [
+ "english_stop"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4301cb9d970ec65778f91ce1f438e0d5.asciidoc b/docs/examples/4301cb9d970ec65778f91ce1f438e0d5.asciidoc
new file mode 100644
index 000000000..87313bc14
--- /dev/null
+++ b/docs/examples/4301cb9d970ec65778f91ce1f438e0d5.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:289
+
+[source, python]
+----
+resp = client.indices.update_aliases(
+ actions=[
+ {
+ "add": {
+ "index": "logs-nginx.access-prod",
+ "alias": "logs"
+ }
+ },
+ {
+ "add": {
+ "index": "logs-my_app-default",
+ "alias": "logs",
+ "is_write_index": True
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/430705509f8367aef92be413f702520b.asciidoc b/docs/examples/430705509f8367aef92be413f702520b.asciidoc
new file mode 100644
index 000000000..2bf5117b8
--- /dev/null
+++ b/docs/examples/430705509f8367aef92be413f702520b.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-status-api.asciidoc:75
+
+[source, python]
+----
+resp = client.connector.update_status(
+ connector_id="my-connector",
+ status="needs_configuration",
+)
+print(resp)
+----
diff --git a/docs/examples/4310869b97d4224acaa6d66b1e196048.asciidoc b/docs/examples/4310869b97d4224acaa6d66b1e196048.asciidoc
new file mode 100644
index 000000000..cab2434e0
--- /dev/null
+++ b/docs/examples/4310869b97d4224acaa6d66b1e196048.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-elser.asciidoc:172
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "sparse_vector": {
+ "field": "content_embedding",
+ "inference_id": "my-elser-endpoint",
+ "query": "How to avoid muscle soreness after running?"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4323f6d224847eccdce59c23e33fda0a.asciidoc b/docs/examples/4323f6d224847eccdce59c23e33fda0a.asciidoc
new file mode 100644
index 000000000..480cad05a
--- /dev/null
+++ b/docs/examples/4323f6d224847eccdce59c23e33fda0a.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/cjk-bigram-tokenfilter.asciidoc:126
+
+[source, python]
+----
+resp = client.indices.create(
+ index="cjk_bigram_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_cjk_bigram": {
+ "tokenizer": "standard",
+ "filter": [
+ "cjk_bigram"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/433cf45a23decdf3a096016ffaaf26ba.asciidoc b/docs/examples/433cf45a23decdf3a096016ffaaf26ba.asciidoc
new file mode 100644
index 000000000..5302d44a4
--- /dev/null
+++ b/docs/examples/433cf45a23decdf3a096016ffaaf26ba.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:394
+
+[source, python]
+----
+resp = client.indices.update_aliases(
+ actions=[
+ {
+ "add": {
+ "index": "my-index-2099.05.06-000001",
+ "alias": "my-alias",
+ "search_routing": "1",
+ "index_routing": "2"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/4342ccf6cc24fd80bd3cd1f9a4c2ef8e.asciidoc b/docs/examples/4342ccf6cc24fd80bd3cd1f9a4c2ef8e.asciidoc
new file mode 100644
index 000000000..65a28ff70
--- /dev/null
+++ b/docs/examples/4342ccf6cc24fd80bd3cd1f9a4c2ef8e.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:513
+
+[source, python]
+----
+resp = client.clear_scroll(
+ scroll_id=[
+ "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==",
+ "DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAABFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAAAxZrUllkUVlCa1NqNmRMaUhiQlZkMWFBAAAAAAAAAAIWa1JZZFFZQmtTajZkTGlIYkJWZDFhQQAAAAAAAAAFFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAABBZrUllkUVlCa1NqNmRMaUhiQlZkMWFB"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/435e0d6a7d86e074d572d9671b7b9676.asciidoc b/docs/examples/435e0d6a7d86e074d572d9671b7b9676.asciidoc
index 2401940db..d6cbafe37 100644
--- a/docs/examples/435e0d6a7d86e074d572d9671b7b9676.asciidoc
+++ b/docs/examples/435e0d6a7d86e074d572d9671b7b9676.asciidoc
@@ -1,17 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:227
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "Polygon",
"coordinates": [
- [[100, 0], [101, 0], [101, 1], [100, 1], [100, 0]]
- ],
+ [
+ [
+ 100,
+ 0
+ ],
+ [
+ 101,
+ 0
+ ],
+ [
+ 101,
+ 1
+ ],
+ [
+ 100,
+ 1
+ ],
+ [
+ 100,
+ 0
+ ]
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/436d50b85fc8f0977d02059eec00719b.asciidoc b/docs/examples/436d50b85fc8f0977d02059eec00719b.asciidoc
index 3b2e7c75e..041633ca9 100644
--- a/docs/examples/436d50b85fc8f0977d02059eec00719b.asciidoc
+++ b/docs/examples/436d50b85fc8f0977d02059eec00719b.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:309
[source, python]
@@ -5,14 +6,16 @@
resp = client.update(
index="test",
id="1",
- body={
- "script": {
- "source": "ctx._source.counter += params.count",
- "lang": "painless",
- "params": {"count": 4},
- },
- "upsert": {"counter": 1},
+ script={
+ "source": "ctx._source.counter += params.count",
+ "lang": "painless",
+ "params": {
+ "count": 4
+ }
+ },
+ upsert={
+ "counter": 1
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/43854be6aae61edbea5f9ab988cb4ce5.asciidoc b/docs/examples/43854be6aae61edbea5f9ab988cb4ce5.asciidoc
new file mode 100644
index 000000000..71ee348f6
--- /dev/null
+++ b/docs/examples/43854be6aae61edbea5f9ab988cb4ce5.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// security/using-ip-filtering.asciidoc:146
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "xpack.security.transport.filter.allow": "172.16.0.0/24"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/43e86fbaeed068dcc981214338559b5a.asciidoc b/docs/examples/43e86fbaeed068dcc981214338559b5a.asciidoc
new file mode 100644
index 000000000..254f835ae
--- /dev/null
+++ b/docs/examples/43e86fbaeed068dcc981214338559b5a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/resolve-cluster.asciidoc:58
+
+[source, python]
+----
+resp = client.indices.resolve_cluster(
+ name="my-index-*,cluster*:my-index-*",
+)
+print(resp)
+----
diff --git a/docs/examples/43f77ddf1ed8106d4f47a12d39df8e3b.asciidoc b/docs/examples/43f77ddf1ed8106d4f47a12d39df8e3b.asciidoc
new file mode 100644
index 000000000..9e1b7cf5e
--- /dev/null
+++ b/docs/examples/43f77ddf1ed8106d4f47a12d39df8e3b.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/range-enrich-policy-type-ex.asciidoc:113
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="my_id",
+ pipeline="networks_lookup",
+ document={
+ "ip": "10.100.34.1"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/43fe75fa9f3fca846598fdad58fd98cb.asciidoc b/docs/examples/43fe75fa9f3fca846598fdad58fd98cb.asciidoc
new file mode 100644
index 000000000..a5f3ab8d5
--- /dev/null
+++ b/docs/examples/43fe75fa9f3fca846598fdad58fd98cb.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/usage.asciidoc:38
+
+[source, python]
+----
+resp = client.xpack.usage()
+print(resp)
+----
diff --git a/docs/examples/441be98c597698bb2809372abf086c3e.asciidoc b/docs/examples/441be98c597698bb2809372abf086c3e.asciidoc
new file mode 100644
index 000000000..3e30222ff
--- /dev/null
+++ b/docs/examples/441be98c597698bb2809372abf086c3e.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/doc-count-field.asciidoc:80
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "histogram_titles": {
+ "terms": {
+ "field": "my_text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/441f330f6872f995769db1ce2b9627e2.asciidoc b/docs/examples/441f330f6872f995769db1ce2b9627e2.asciidoc
new file mode 100644
index 000000000..8f969a49b
--- /dev/null
+++ b/docs/examples/441f330f6872f995769db1ce2b9627e2.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:686
+
+[source, python]
+----
+resp = client.search(
+ stored_fields=[],
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/44231f7cdd5c3a21025861cdef31e355.asciidoc b/docs/examples/44231f7cdd5c3a21025861cdef31e355.asciidoc
new file mode 100644
index 000000000..d4067263d
--- /dev/null
+++ b/docs/examples/44231f7cdd5c3a21025861cdef31e355.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:201
+
+[source, python]
+----
+resp = client.indices.shrink(
+ index="my-index",
+ target="my-shrunken-index",
+)
+print(resp)
+----
diff --git a/docs/examples/4427517dcd8ec9997541150cdc11a0de.asciidoc b/docs/examples/4427517dcd8ec9997541150cdc11a0de.asciidoc
new file mode 100644
index 000000000..0f2f72665
--- /dev/null
+++ b/docs/examples/4427517dcd8ec9997541150cdc11a0de.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/snapshot/corrupt-repository.asciidoc:116
+
+[source, python]
+----
+resp = client.snapshot.delete_repository(
+ name="my-repo",
+)
+print(resp)
+----
diff --git a/docs/examples/4435b654994b575ba181ea679871c78c.asciidoc b/docs/examples/4435b654994b575ba181ea679871c78c.asciidoc
new file mode 100644
index 000000000..457b08316
--- /dev/null
+++ b/docs/examples/4435b654994b575ba181ea679871c78c.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-api.asciidoc:26
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/44385b61342e20ea05f254015b2b04d7.asciidoc b/docs/examples/44385b61342e20ea05f254015b2b04d7.asciidoc
new file mode 100644
index 000000000..54d047589
--- /dev/null
+++ b/docs/examples/44385b61342e20ea05f254015b2b04d7.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/bulk-delete-roles.asciidoc:49
+
+[source, python]
+----
+resp = client.security.bulk_delete_role(
+ names=[
+ "my_admin_role",
+ "my_user_role"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/443dd902f64b3217505c9595839c3b2d.asciidoc b/docs/examples/443dd902f64b3217505c9595839c3b2d.asciidoc
new file mode 100644
index 000000000..44612024a
--- /dev/null
+++ b/docs/examples/443dd902f64b3217505c9595839c3b2d.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-multiple-indices.asciidoc:104
+
+[source, python]
+----
+resp = client.search(
+ indices_boost=[
+ {
+ "my-alias": 1.4
+ },
+ {
+ "my-index*": 1.3
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/443e8da9968f1c65f46a2a65a1e1e078.asciidoc b/docs/examples/443e8da9968f1c65f46a2a65a1e1e078.asciidoc
new file mode 100644
index 000000000..d6f42c8fb
--- /dev/null
+++ b/docs/examples/443e8da9968f1c65f46a2a65a1e1e078.asciidoc
@@ -0,0 +1,47 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-tsds.asciidoc:146
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my-weather-sensor-index-template",
+ index_patterns=[
+ "metrics-weather_sensors-*"
+ ],
+ data_stream={},
+ template={
+ "settings": {
+ "index.mode": "time_series",
+ "index.lifecycle.name": "my-lifecycle-policy"
+ },
+ "mappings": {
+ "properties": {
+ "sensor_id": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "location": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "temperature": {
+ "type": "half_float",
+ "time_series_metric": "gauge"
+ },
+ "humidity": {
+ "type": "half_float",
+ "time_series_metric": "gauge"
+ },
+ "@timestamp": {
+ "type": "date"
+ }
+ }
+ }
+ },
+ priority=500,
+ meta={
+ "description": "Template for my weather sensor data"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/443f0e8fbba83777b2df624879d188d5.asciidoc b/docs/examples/443f0e8fbba83777b2df624879d188d5.asciidoc
new file mode 100644
index 000000000..19b41f3a9
--- /dev/null
+++ b/docs/examples/443f0e8fbba83777b2df624879d188d5.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-reindex.asciidoc:106
+
+[source, python]
+----
+resp = client.reindex(
+ wait_for_completion=False,
+ source={
+ "index": "test-data",
+ "size": 50
+ },
+ dest={
+ "index": "azure-openai-embeddings",
+ "pipeline": "azure_openai_embeddings"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/445f8a6ef75fb43da52990b3a9063c78.asciidoc b/docs/examples/445f8a6ef75fb43da52990b3a9063c78.asciidoc
index 856f4780a..b91e1f5cf 100644
--- a/docs/examples/445f8a6ef75fb43da52990b3a9063c78.asciidoc
+++ b/docs/examples/445f8a6ef75fb43da52990b3a9063c78.asciidoc
@@ -1,13 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1658
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "query": {"match": {"http.responses": "304"}},
- "fields": ["http.client_ip", "timestamp", "http.verb"],
+ query={
+ "match": {
+ "http.responses": "304"
+ }
},
+ fields=[
+ "http.client_ip",
+ "timestamp",
+ "http.verb"
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/446e8fc8ccfb13bb5ec64e32a5676d18.asciidoc b/docs/examples/446e8fc8ccfb13bb5ec64e32a5676d18.asciidoc
new file mode 100644
index 000000000..5c708c78b
--- /dev/null
+++ b/docs/examples/446e8fc8ccfb13bb5ec64e32a5676d18.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/elision-tokenfilter.asciidoc:34
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "elision"
+ ],
+ text="j’examine près du wharf",
+)
+print(resp)
+----
diff --git a/docs/examples/4479e8c63a04fa22207a6a8803eadcad.asciidoc b/docs/examples/4479e8c63a04fa22207a6a8803eadcad.asciidoc
new file mode 100644
index 000000000..b5d3ca633
--- /dev/null
+++ b/docs/examples/4479e8c63a04fa22207a6a8803eadcad.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/cluster/allocation_awareness.asciidoc:67
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.awareness.attributes": "rack_id"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/44939997b0f2601f82a93585a879f65a.asciidoc b/docs/examples/44939997b0f2601f82a93585a879f65a.asciidoc
new file mode 100644
index 000000000..8d45ee69c
--- /dev/null
+++ b/docs/examples/44939997b0f2601f82a93585a879f65a.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/simplepatternsplit-tokenizer.asciidoc:40
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "my_tokenizer"
+ }
+ },
+ "tokenizer": {
+ "my_tokenizer": {
+ "type": "simple_pattern_split",
+ "pattern": "_"
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="an_underscored_phrase",
+)
+print(resp1)
+----
diff --git a/docs/examples/4498b9d3b0c77e1b9ef6664ff5963ce2.asciidoc b/docs/examples/4498b9d3b0c77e1b9ef6664ff5963ce2.asciidoc
index 7e4927bd4..8d22ea53a 100644
--- a/docs/examples/4498b9d3b0c77e1b9ef6664ff5963ce2.asciidoc
+++ b/docs/examples/4498b9d3b0c77e1b9ef6664ff5963ce2.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// modules/indices/request_cache.asciidoc:59
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"settings": {"index.requests.cache.enable": False}},
+ settings={
+ "index.requests.cache.enable": False
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/44b8a236d7cfb31c43c6d066ae16d8cd.asciidoc b/docs/examples/44b8a236d7cfb31c43c6d066ae16d8cd.asciidoc
new file mode 100644
index 000000000..db0e61236
--- /dev/null
+++ b/docs/examples/44b8a236d7cfb31c43c6d066ae16d8cd.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/profile.asciidoc:35
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ profile=True,
+ query={
+ "match": {
+ "message": "GET /search"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/44bca3f17d403517af3616754dc795bb.asciidoc b/docs/examples/44bca3f17d403517af3616754dc795bb.asciidoc
new file mode 100644
index 000000000..948217540
--- /dev/null
+++ b/docs/examples/44bca3f17d403517af3616754dc795bb.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/script-score-query.asciidoc:345
+
+[source, python]
+----
+resp = client.explain(
+ index="my-index-000001",
+ id="0",
+ query={
+ "script_score": {
+ "query": {
+ "match": {
+ "message": "elasticsearch"
+ }
+ },
+ "script": {
+ "source": "\n long count = doc['count'].value;\n double normalizedCount = count / 10;\n if (explanation != null) {\n explanation.set('normalized count = count / 10 = ' + count + ' / 10 = ' + normalizedCount);\n }\n return normalizedCount;\n "
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/44da736ce0e1587c1e7c45eee606ead7.asciidoc b/docs/examples/44da736ce0e1587c1e7c45eee606ead7.asciidoc
index 3f25dc2cf..f41b42c8d 100644
--- a/docs/examples/44da736ce0e1587c1e7c45eee606ead7.asciidoc
+++ b/docs/examples/44da736ce0e1587c1e7c45eee606ead7.asciidoc
@@ -1,13 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:403
[source, python]
----
resp = client.update_by_query(
index="my-index-000001",
- body={
- "script": {"source": "ctx._source.count++", "lang": "painless"},
- "query": {"term": {"user.id": "kimchy"}},
+ script={
+ "source": "ctx._source.count++",
+ "lang": "painless"
+ },
+ query={
+ "term": {
+ "user.id": "kimchy"
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/44db41b8465af951e366da97ade63bc1.asciidoc b/docs/examples/44db41b8465af951e366da97ade63bc1.asciidoc
new file mode 100644
index 000000000..08d8e6708
--- /dev/null
+++ b/docs/examples/44db41b8465af951e366da97ade63bc1.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/apis/reload-analyzers.asciidoc:154
+
+[source, python]
+----
+resp = client.indices.reload_search_analyzers(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/44dd65d69267017fa2fb2cffadef40bb.asciidoc b/docs/examples/44dd65d69267017fa2fb2cffadef40bb.asciidoc
new file mode 100644
index 000000000..8c9302475
--- /dev/null
+++ b/docs/examples/44dd65d69267017fa2fb2cffadef40bb.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/cardinality-aggregation.asciidoc:188
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ runtime_mappings={
+ "type_and_promoted": {
+ "type": "keyword",
+ "script": "emit(doc['type'].value + ' ' + doc['promoted'].value)"
+ }
+ },
+ aggs={
+ "type_promoted_count": {
+ "cardinality": {
+ "field": "type_and_promoted"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/44dfac5bc3131014e2c6bb1ebc76b33d.asciidoc b/docs/examples/44dfac5bc3131014e2c6bb1ebc76b33d.asciidoc
new file mode 100644
index 000000000..f65120117
--- /dev/null
+++ b/docs/examples/44dfac5bc3131014e2c6bb1ebc76b33d.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:144
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index_double",
+ mappings={
+ "properties": {
+ "field": {
+ "type": "double"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/451b441c3311103d0d2bdbab771b26d2.asciidoc b/docs/examples/451b441c3311103d0d2bdbab771b26d2.asciidoc
new file mode 100644
index 000000000..c4f3a6b2b
--- /dev/null
+++ b/docs/examples/451b441c3311103d0d2bdbab771b26d2.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:987
+
+[source, python]
+----
+resp = client.put_script(
+ id="my-search-template",
+ script={
+ "lang": "mustache",
+ "source": "\n {\n \"query\": {\n \"match\": {\n {{=( )=}}\n \"message\": \"(query_string)\"\n (={{ }}=)\n }\n }\n }\n "
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/451e7c29b2cf738cfc822f7c175bef56.asciidoc b/docs/examples/451e7c29b2cf738cfc822f7c175bef56.asciidoc
new file mode 100644
index 000000000..6aea0efb7
--- /dev/null
+++ b/docs/examples/451e7c29b2cf738cfc822f7c175bef56.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-manage-new-data-stream.asciidoc:29
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my-index-template",
+ index_patterns=[
+ "my-data-stream*"
+ ],
+ data_stream={},
+ priority=500,
+ template={
+ "lifecycle": {
+ "data_retention": "7d"
+ }
+ },
+ meta={
+ "description": "Template with data stream lifecycle"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4527d9bb12cf738111a188af235d5d4c.asciidoc b/docs/examples/4527d9bb12cf738111a188af235d5d4c.asciidoc
new file mode 100644
index 000000000..5cd6e4698
--- /dev/null
+++ b/docs/examples/4527d9bb12cf738111a188af235d5d4c.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/grok-syntax.asciidoc:176
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ runtime_mappings={
+ "http.clientip": {
+ "type": "ip",
+ "script": "\n String clientip=grok('%{COMMONAPACHELOG}').extract(doc[\"message\"].value)?.clientip;\n if (clientip != null) emit(clientip);\n "
+ }
+ },
+ query={
+ "match": {
+ "http.clientip": "40.135.0.0"
+ }
+ },
+ fields=[
+ "http.clientip"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/45499ed1824d1d7cb59972580d2344cb.asciidoc b/docs/examples/45499ed1824d1d7cb59972580d2344cb.asciidoc
index a071af1a1..e971fdfe1 100644
--- a/docs/examples/45499ed1824d1d7cb59972580d2344cb.asciidoc
+++ b/docs/examples/45499ed1824d1d7cb59972580d2344cb.asciidoc
@@ -1,19 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/unsigned_long.asciidoc:68
[source, python]
----
resp = client.search(
index="my_index",
- body={
- "query": {
- "range": {
- "my_counter": {
- "gte": "9223372036854775808",
- "lte": "18446744073709551615",
- }
+ query={
+ "range": {
+ "my_counter": {
+ "gte": "9223372036854775808",
+ "lte": "18446744073709551615"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/455029c3d66306ad5d48f6dbddaf7324.asciidoc b/docs/examples/455029c3d66306ad5d48f6dbddaf7324.asciidoc
new file mode 100644
index 000000000..4b7026213
--- /dev/null
+++ b/docs/examples/455029c3d66306ad5d48f6dbddaf7324.asciidoc
@@ -0,0 +1,83 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/sum-aggregation.asciidoc:140
+
+[source, python]
+----
+resp = client.indices.create(
+ index="metrics_index",
+ mappings={
+ "properties": {
+ "latency_histo": {
+ "type": "histogram"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="metrics_index",
+ id="1",
+ refresh=True,
+ document={
+ "network.name": "net-1",
+ "latency_histo": {
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 3,
+ 7,
+ 23,
+ 12,
+ 6
+ ]
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="metrics_index",
+ id="2",
+ refresh=True,
+ document={
+ "network.name": "net-2",
+ "latency_histo": {
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 8,
+ 17,
+ 8,
+ 7,
+ 6
+ ]
+ }
+ },
+)
+print(resp2)
+
+resp3 = client.search(
+ index="metrics_index",
+ size="0",
+ filter_path="aggregations",
+ aggs={
+ "total_latency": {
+ "sum": {
+ "field": "latency_histo"
+ }
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/4553e0acb6336687d61eaecc73f517b7.asciidoc b/docs/examples/4553e0acb6336687d61eaecc73f517b7.asciidoc
new file mode 100644
index 000000000..0c65ef9d2
--- /dev/null
+++ b/docs/examples/4553e0acb6336687d61eaecc73f517b7.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/charfilters/mapping-charfilter.asciidoc:109
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "char_filter": [
+ "my_mappings_char_filter"
+ ]
+ }
+ },
+ "char_filter": {
+ "my_mappings_char_filter": {
+ "type": "mapping",
+ "mappings": [
+ ":) => _happy_",
+ ":( => _sad_"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/45813d971bfa890ffa2f51f3f480cce5.asciidoc b/docs/examples/45813d971bfa890ffa2f51f3f480cce5.asciidoc
index cb6cefd6d..2c491ef9f 100644
--- a/docs/examples/45813d971bfa890ffa2f51f3f480cce5.asciidoc
+++ b/docs/examples/45813d971bfa890ffa2f51f3f480cce5.asciidoc
@@ -1,17 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:355
[source, python]
----
resp = client.search(
index="test_index",
- body={
- "query": {
- "percolate": {
- "field": "query",
- "document": {"body": "Bycicles are missing"},
+ query={
+ "percolate": {
+ "field": "query",
+ "document": {
+ "body": "Bycicles are missing"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/458b2228aed7464d915a5d73cb6b98f6.asciidoc b/docs/examples/458b2228aed7464d915a5d73cb6b98f6.asciidoc
new file mode 100644
index 000000000..d8d3104df
--- /dev/null
+++ b/docs/examples/458b2228aed7464d915a5d73cb6b98f6.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/snapshots.asciidoc:129
+
+[source, python]
+----
+resp = client.cat.snapshots(
+ repository="repo1",
+ v=True,
+ s="id",
+)
+print(resp)
+----
diff --git a/docs/examples/45b74f1904533fdb37a5a6f3c8f4ec9b.asciidoc b/docs/examples/45b74f1904533fdb37a5a6f3c8f4ec9b.asciidoc
new file mode 100644
index 000000000..c47e5c07e
--- /dev/null
+++ b/docs/examples/45b74f1904533fdb37a5a6f3c8f4ec9b.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/edgengram-tokenizer.asciidoc:144
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "my_tokenizer"
+ }
+ },
+ "tokenizer": {
+ "my_tokenizer": {
+ "type": "edge_ngram",
+ "min_gram": 2,
+ "max_gram": 10,
+ "token_chars": [
+ "letter",
+ "digit"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="2 Quick Foxes.",
+)
+print(resp1)
+----
diff --git a/docs/examples/45c6e54a9c9e08623af96752b4bde346.asciidoc b/docs/examples/45c6e54a9c9e08623af96752b4bde346.asciidoc
new file mode 100644
index 000000000..9fcf023ac
--- /dev/null
+++ b/docs/examples/45c6e54a9c9e08623af96752b4bde346.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-distance-query.asciidoc:213
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_distance": {
+ "distance": "12km",
+ "pin.location": "POINT (-70 40)"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/45ef5156dbd2d3fd4fd22b8d99f7aad4.asciidoc b/docs/examples/45ef5156dbd2d3fd4fd22b8d99f7aad4.asciidoc
index d54c6434d..0a29461b5 100644
--- a/docs/examples/45ef5156dbd2d3fd4fd22b8d99f7aad4.asciidoc
+++ b/docs/examples/45ef5156dbd2d3fd4fd22b8d99f7aad4.asciidoc
@@ -1,9 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// setup/restart-cluster.asciidoc:233
[source, python]
----
resp = client.cluster.put_settings(
- body={"persistent": {"cluster.routing.allocation.enable": None}},
+ persistent={
+ "cluster.routing.allocation.enable": None
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/46025fc47dfbfa410790df0dd6bdad8d.asciidoc b/docs/examples/46025fc47dfbfa410790df0dd6bdad8d.asciidoc
new file mode 100644
index 000000000..09a07d416
--- /dev/null
+++ b/docs/examples/46025fc47dfbfa410790df0dd6bdad8d.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-api.asciidoc:167
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ runtime_mappings={
+ "day_of_week": {
+ "type": "keyword",
+ "script": {
+ "source": "emit(doc['@timestamp'].value.dayOfWeekEnum\n .getDisplayName(TextStyle.FULL, Locale.ROOT))"
+ }
+ }
+ },
+ aggs={
+ "day_of_week": {
+ "terms": {
+ "field": "day_of_week"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/46064e81620162a23e75002a7eeb8b10.asciidoc b/docs/examples/46064e81620162a23e75002a7eeb8b10.asciidoc
new file mode 100644
index 000000000..3c332a0b2
--- /dev/null
+++ b/docs/examples/46064e81620162a23e75002a7eeb8b10.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/apis/move-to-step.asciidoc:188
+
+[source, python]
+----
+resp = client.ilm.move_to_step(
+ index="my-index-000001",
+ current_step={
+ "phase": "hot",
+ "action": "complete",
+ "name": "complete"
+ },
+ next_step={
+ "phase": "warm"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/46103fee3cd5f53dc75123def82d52ad.asciidoc b/docs/examples/46103fee3cd5f53dc75123def82d52ad.asciidoc
new file mode 100644
index 000000000..e05cceea2
--- /dev/null
+++ b/docs/examples/46103fee3cd5f53dc75123def82d52ad.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:293
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my-data-stream-template",
+ index_patterns=[
+ "my-data-stream*"
+ ],
+ data_stream={},
+ priority=500,
+ template={
+ "settings": {
+ "index.refresh_interval": "30s"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/464dffb6a6e24a860223d1c32b232f95.asciidoc b/docs/examples/464dffb6a6e24a860223d1c32b232f95.asciidoc
new file mode 100644
index 000000000..94bf50124
--- /dev/null
+++ b/docs/examples/464dffb6a6e24a860223d1c32b232f95.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/minhash-tokenfilter.asciidoc:134
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "filter": {
+ "my_shingle_filter": {
+ "type": "shingle",
+ "min_shingle_size": 5,
+ "max_shingle_size": 5,
+ "output_unigrams": False
+ },
+ "my_minhash_filter": {
+ "type": "min_hash",
+ "hash_count": 1,
+ "bucket_count": 512,
+ "hash_set_size": 1,
+ "with_rotation": True
+ }
+ },
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "filter": [
+ "my_shingle_filter",
+ "my_minhash_filter"
+ ]
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "fingerprint": {
+ "type": "text",
+ "analyzer": "my_analyzer"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4655c3dea0c61935b7ecf1e57441df66.asciidoc b/docs/examples/4655c3dea0c61935b7ecf1e57441df66.asciidoc
new file mode 100644
index 000000000..98b608366
--- /dev/null
+++ b/docs/examples/4655c3dea0c61935b7ecf1e57441df66.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/rejected-requests.asciidoc:25
+
+[source, python]
+----
+resp = client.cat.thread_pool(
+ v=True,
+ h="id,name,active,rejected,completed",
+)
+print(resp)
+----
diff --git a/docs/examples/4659f639d71a54df571260ee5798dbb3.asciidoc b/docs/examples/4659f639d71a54df571260ee5798dbb3.asciidoc
new file mode 100644
index 000000000..4538d35d6
--- /dev/null
+++ b/docs/examples/4659f639d71a54df571260ee5798dbb3.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geotilegrid-aggregation.asciidoc:114
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggregations={
+ "zoomed-in": {
+ "filter": {
+ "geo_bounding_box": {
+ "location": {
+ "top_left": "POINT (4.9 52.4)",
+ "bottom_right": "POINT (5.0 52.3)"
+ }
+ }
+ },
+ "aggregations": {
+ "zoom1": {
+ "geotile_grid": {
+ "field": "location",
+ "precision": 22
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/46658f00edc4865dfe472a392374cd0f.asciidoc b/docs/examples/46658f00edc4865dfe472a392374cd0f.asciidoc
new file mode 100644
index 000000000..83abbcf70
--- /dev/null
+++ b/docs/examples/46658f00edc4865dfe472a392374cd0f.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template-v1.asciidoc:252
+
+[source, python]
+----
+resp = client.indices.get_template(
+ name="template_1",
+ filter_path="*.version",
+)
+print(resp)
+----
diff --git a/docs/examples/4670dd81a9865e07ae74ae8b0266e384.asciidoc b/docs/examples/4670dd81a9865e07ae74ae8b0266e384.asciidoc
new file mode 100644
index 000000000..bbd442eff
--- /dev/null
+++ b/docs/examples/4670dd81a9865e07ae74ae8b0266e384.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/t-test-aggregation.asciidoc:148
+
+[source, python]
+----
+resp = client.search(
+ index="node_upgrade",
+ size=0,
+ runtime_mappings={
+ "startup_time_before.adjusted": {
+ "type": "long",
+ "script": {
+ "source": "emit(doc['startup_time_before'].value - params.adjustment)",
+ "params": {
+ "adjustment": 10
+ }
+ }
+ }
+ },
+ aggs={
+ "startup_time_ttest": {
+ "t_test": {
+ "a": {
+ "field": "startup_time_before.adjusted"
+ },
+ "b": {
+ "field": "startup_time_after"
+ },
+ "type": "paired"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/467833bd44b35a89a7fe0d7df5f253f1.asciidoc b/docs/examples/467833bd44b35a89a7fe0d7df5f253f1.asciidoc
new file mode 100644
index 000000000..5365ce33c
--- /dev/null
+++ b/docs/examples/467833bd44b35a89a7fe0d7df5f253f1.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/pattern-analyzer.asciidoc:29
+
+[source, python]
+----
+resp = client.indices.analyze(
+ analyzer="pattern",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/468f7ec42cdd8287cdea3ec1cea4a514.asciidoc b/docs/examples/468f7ec42cdd8287cdea3ec1cea4a514.asciidoc
new file mode 100644
index 000000000..20d03bb33
--- /dev/null
+++ b/docs/examples/468f7ec42cdd8287cdea3ec1cea4a514.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:333
+
+[source, python]
+----
+resp = client.update(
+ index="my-index-000001",
+ id="1",
+ script={
+ "source": "if (ctx._source.tags.contains(params['tag'])) { ctx._source.tags.remove(ctx._source.tags.indexOf(params['tag'])) }",
+ "lang": "painless",
+ "params": {
+ "tag": "blue"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/46a0eaaf5c881f1ba716d1812b36c724.asciidoc b/docs/examples/46a0eaaf5c881f1ba716d1812b36c724.asciidoc
new file mode 100644
index 000000000..ab05cde57
--- /dev/null
+++ b/docs/examples/46a0eaaf5c881f1ba716d1812b36c724.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/bi-directional-disaster-recovery.asciidoc:87
+
+[source, python]
+----
+resp = client.ccr.put_auto_follow_pattern(
+ name="logs-generic-default",
+ remote_cluster="clusterB",
+ leader_index_patterns=[
+ ".ds-logs-generic-default-20*"
+ ],
+ leader_index_exclusion_patterns="*-replicated_from_clustera",
+ follow_index_pattern="{{leader_index}}-replicated_from_clusterb",
+)
+print(resp)
+
+resp1 = client.ccr.put_auto_follow_pattern(
+ name="logs-generic-default",
+ remote_cluster="clusterA",
+ leader_index_patterns=[
+ ".ds-logs-generic-default-20*"
+ ],
+ leader_index_exclusion_patterns="*-replicated_from_clusterb",
+ follow_index_pattern="{{leader_index}}-replicated_from_clustera",
+)
+print(resp1)
+----
diff --git a/docs/examples/46b1c1f6e0c86528be84c373eeb8d425.asciidoc b/docs/examples/46b1c1f6e0c86528be84c373eeb8d425.asciidoc
new file mode 100644
index 000000000..a187319f3
--- /dev/null
+++ b/docs/examples/46b1c1f6e0c86528be84c373eeb8d425.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// licensing/update-license.asciidoc:139
+
+[source, python]
+----
+resp = client.license.post(
+ acknowledge=True,
+ licenses=[
+ {
+ "uid": "893361dc-9749-4997-93cb-802e3d7fa4xx",
+ "type": "basic",
+ "issue_date_in_millis": 1411948800000,
+ "expiry_date_in_millis": 1914278399999,
+ "max_nodes": 1,
+ "issued_to": "issuedTo",
+ "issuer": "issuer",
+ "signature": "xx"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/46c5c14f20118dcf519ff6ef21360209.asciidoc b/docs/examples/46c5c14f20118dcf519ff6ef21360209.asciidoc
new file mode 100644
index 000000000..d052ad1fe
--- /dev/null
+++ b/docs/examples/46c5c14f20118dcf519ff6ef21360209.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-downsample.asciidoc:37
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="datastream_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_docs": 1
+ },
+ "downsample": {
+ "fixed_interval": "1h"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/46ce40227fa60aa6ba435f366b3a1f5f.asciidoc b/docs/examples/46ce40227fa60aa6ba435f366b3a1f5f.asciidoc
new file mode 100644
index 000000000..6c39ece1d
--- /dev/null
+++ b/docs/examples/46ce40227fa60aa6ba435f366b3a1f5f.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/uni-directional-disaster-recovery.asciidoc:101
+
+[source, python]
+----
+resp = client.ccr.pause_follow(
+ index="kibana_sample_data_ecommerce2",
+)
+print(resp)
+
+resp1 = client.indices.close(
+ index="kibana_sample_data_ecommerce2",
+)
+print(resp1)
+
+resp2 = client.ccr.unfollow(
+ index="kibana_sample_data_ecommerce2",
+)
+print(resp2)
+
+resp3 = client.indices.open(
+ index="kibana_sample_data_ecommerce2",
+)
+print(resp3)
+----
diff --git a/docs/examples/46ebd468c3f132a4978088964466c5cd.asciidoc b/docs/examples/46ebd468c3f132a4978088964466c5cd.asciidoc
new file mode 100644
index 000000000..3fa3640e9
--- /dev/null
+++ b/docs/examples/46ebd468c3f132a4978088964466c5cd.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/apostrophe-tokenfilter.asciidoc:77
+
+[source, python]
+----
+resp = client.indices.create(
+ index="apostrophe_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_apostrophe": {
+ "tokenizer": "standard",
+ "filter": [
+ "apostrophe"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/472ec8c57fec8457e31fe6dd7f6e3713.asciidoc b/docs/examples/472ec8c57fec8457e31fe6dd7f6e3713.asciidoc
index 5ad5d16e3..09064de43 100644
--- a/docs/examples/472ec8c57fec8457e31fe6dd7f6e3713.asciidoc
+++ b/docs/examples/472ec8c57fec8457e31fe6dd7f6e3713.asciidoc
@@ -1,17 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:448
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {
- "fields": ["title"],
- "query": "this that thus",
- "minimum_should_match": 2,
- }
+ query={
+ "query_string": {
+ "fields": [
+ "title"
+ ],
+ "query": "this that thus",
+ "minimum_should_match": 2
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/473c8ddd4e4b7814a64e5fe40d9d6dca.asciidoc b/docs/examples/473c8ddd4e4b7814a64e5fe40d9d6dca.asciidoc
new file mode 100644
index 000000000..febda3003
--- /dev/null
+++ b/docs/examples/473c8ddd4e4b7814a64e5fe40d9d6dca.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/task-management.asciidoc:31
+
+[source, python]
+----
+resp = client.tasks.cancel(
+ task_id="2j8UKw1bRO283PMwDugNNg:5326",
+)
+print(resp)
+----
diff --git a/docs/examples/4752f82fec8b46e5a4b3788b76e3041f.asciidoc b/docs/examples/4752f82fec8b46e5a4b3788b76e3041f.asciidoc
new file mode 100644
index 000000000..1f7cefde5
--- /dev/null
+++ b/docs/examples/4752f82fec8b46e5a4b3788b76e3041f.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-migrate.asciidoc:84
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "warm": {
+ "actions": {
+ "migrate": {
+ "enabled": False
+ },
+ "allocate": {
+ "include": {
+ "rack_id": "one,two"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/47909e194d10743093f4a22c27a85925.asciidoc b/docs/examples/47909e194d10743093f4a22c27a85925.asciidoc
new file mode 100644
index 000000000..9f07d4aa6
--- /dev/null
+++ b/docs/examples/47909e194d10743093f4a22c27a85925.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:196
+
+[source, python]
+----
+resp = client.search(
+ size=10000,
+ query={
+ "match": {
+ "user.id": "elkbee"
+ }
+ },
+ pit={
+ "id": "46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==",
+ "keep_alive": "1m"
+ },
+ sort=[
+ {
+ "@timestamp": {
+ "order": "asc",
+ "format": "strict_date_optional_time_nanos",
+ "numeric_type": "date_nanos"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/47e6dfb5b09d954c9c0c33fda2b6c66d.asciidoc b/docs/examples/47e6dfb5b09d954c9c0c33fda2b6c66d.asciidoc
new file mode 100644
index 000000000..7bfb185c0
--- /dev/null
+++ b/docs/examples/47e6dfb5b09d954c9c0c33fda2b6c66d.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-user.asciidoc:167
+
+[source, python]
+----
+resp = client.security.put_user(
+ username="jacknich",
+ password="l0ng-r4nd0m-p@ssw0rd",
+ roles=[
+ "admin",
+ "other_role1"
+ ],
+ full_name="Jack Nicholson",
+ email="jacknich@example.com",
+ metadata={
+ "intelligence": 7
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/47fde7874e15a37242993fd69c62063b.asciidoc b/docs/examples/47fde7874e15a37242993fd69c62063b.asciidoc
new file mode 100644
index 000000000..f1691f32d
--- /dev/null
+++ b/docs/examples/47fde7874e15a37242993fd69c62063b.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-rank-aggregation.asciidoc:29
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_ranks": {
+ "percentile_ranks": {
+ "field": "load_time",
+ "values": [
+ 500,
+ 600
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/480e531db799c4c909afd8e2a73a8d0b.asciidoc b/docs/examples/480e531db799c4c909afd8e2a73a8d0b.asciidoc
new file mode 100644
index 000000000..21c1254ff
--- /dev/null
+++ b/docs/examples/480e531db799c4c909afd8e2a73a8d0b.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/forcemerge.asciidoc:193
+
+[source, python]
+----
+resp = client.indices.forcemerge()
+print(resp)
+----
diff --git a/docs/examples/4818a1288ac24a56d6d6a4130ee70202.asciidoc b/docs/examples/4818a1288ac24a56d6d6a4130ee70202.asciidoc
new file mode 100644
index 000000000..6512fb55b
--- /dev/null
+++ b/docs/examples/4818a1288ac24a56d6d6a4130ee70202.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:212
+
+[source, python]
+----
+resp = client.get_script(
+ id="my-search-template",
+)
+print(resp)
+----
diff --git a/docs/examples/4824a823a830a2a5d990eacfd783ac22.asciidoc b/docs/examples/4824a823a830a2a5d990eacfd783ac22.asciidoc
index 2ace6ec00..f2f624548 100644
--- a/docs/examples/4824a823a830a2a5d990eacfd783ac22.asciidoc
+++ b/docs/examples/4824a823a830a2a5d990eacfd783ac22.asciidoc
@@ -1,22 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:448
[source, python]
----
resp = client.delete_by_query(
index="my-index-000001",
- body={
- "slice": {"id": 0, "max": 2},
- "query": {"range": {"http.response.bytes": {"lt": 2000000}}},
+ slice={
+ "id": 0,
+ "max": 2
+ },
+ query={
+ "range": {
+ "http.response.bytes": {
+ "lt": 2000000
+ }
+ }
},
)
print(resp)
-resp = client.delete_by_query(
+resp1 = client.delete_by_query(
index="my-index-000001",
- body={
- "slice": {"id": 1, "max": 2},
- "query": {"range": {"http.response.bytes": {"lt": 2000000}}},
+ slice={
+ "id": 1,
+ "max": 2
+ },
+ query={
+ "range": {
+ "http.response.bytes": {
+ "lt": 2000000
+ }
+ }
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/48313f620c2871b6f4019b66be730109.asciidoc b/docs/examples/48313f620c2871b6f4019b66be730109.asciidoc
new file mode 100644
index 000000000..b0a1eb7f3
--- /dev/null
+++ b/docs/examples/48313f620c2871b6f4019b66be730109.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/filter-search-results.asciidoc:112
+
+[source, python]
+----
+resp = client.search(
+ index="shirts",
+ query={
+ "bool": {
+ "filter": {
+ "term": {
+ "brand": "gucci"
+ }
+ }
+ }
+ },
+ aggs={
+ "colors": {
+ "terms": {
+ "field": "color"
+ }
+ },
+ "color_red": {
+ "filter": {
+ "term": {
+ "color": "red"
+ }
+ },
+ "aggs": {
+ "models": {
+ "terms": {
+ "field": "model"
+ }
+ }
+ }
+ }
+ },
+ post_filter={
+ "term": {
+ "color": "red"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/483d669ec0768bc4e275a568c6164704.asciidoc b/docs/examples/483d669ec0768bc4e275a568c6164704.asciidoc
new file mode 100644
index 000000000..e568ac3f6
--- /dev/null
+++ b/docs/examples/483d669ec0768bc4e275a568c6164704.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/post-pause-follow.asciidoc:29
+
+[source, python]
+----
+resp = client.ccr.pause_follow(
+ index="",
+)
+print(resp)
+----
diff --git a/docs/examples/484e24d1ed1a154ba9753e6090d38d78.asciidoc b/docs/examples/484e24d1ed1a154ba9753e6090d38d78.asciidoc
index 3391f5bf1..a37becfb5 100644
--- a/docs/examples/484e24d1ed1a154ba9753e6090d38d78.asciidoc
+++ b/docs/examples/484e24d1ed1a154ba9753e6090d38d78.asciidoc
@@ -1,15 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:140
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "point",
- "coordinates": [-377.03653, 389.897676],
+ "coordinates": [
+ -377.03653,
+ 389.897676
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/487f0e07fd83c05f9763e0795c525e2e.asciidoc b/docs/examples/487f0e07fd83c05f9763e0795c525e2e.asciidoc
new file mode 100644
index 000000000..16a7cbc8e
--- /dev/null
+++ b/docs/examples/487f0e07fd83c05f9763e0795c525e2e.asciidoc
@@ -0,0 +1,99 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/geoline-aggregation.asciidoc:13
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test",
+ mappings={
+ "properties": {
+ "my_location": {
+ "type": "geo_point"
+ },
+ "group": {
+ "type": "keyword"
+ },
+ "@timestamp": {
+ "type": "date"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="test",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "my_location": {
+ "lat": 52.373184,
+ "lon": 4.889187
+ },
+ "@timestamp": "2023-01-02T09:00:00Z"
+ },
+ {
+ "index": {}
+ },
+ {
+ "my_location": {
+ "lat": 52.370159,
+ "lon": 4.885057
+ },
+ "@timestamp": "2023-01-02T10:00:00Z"
+ },
+ {
+ "index": {}
+ },
+ {
+ "my_location": {
+ "lat": 52.369219,
+ "lon": 4.901618
+ },
+ "@timestamp": "2023-01-02T13:00:00Z"
+ },
+ {
+ "index": {}
+ },
+ {
+ "my_location": {
+ "lat": 52.374081,
+ "lon": 4.91235
+ },
+ "@timestamp": "2023-01-02T16:00:00Z"
+ },
+ {
+ "index": {}
+ },
+ {
+ "my_location": {
+ "lat": 52.371667,
+ "lon": 4.914722
+ },
+ "@timestamp": "2023-01-03T12:00:00Z"
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="test",
+ filter_path="aggregations",
+ aggs={
+ "line": {
+ "geo_line": {
+ "point": {
+ "field": "my_location"
+ },
+ "sort": {
+ "field": "@timestamp"
+ }
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/488f6df1df71972392b670ce557f7ff3.asciidoc b/docs/examples/488f6df1df71972392b670ce557f7ff3.asciidoc
new file mode 100644
index 000000000..f44dfa132
--- /dev/null
+++ b/docs/examples/488f6df1df71972392b670ce557f7ff3.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template-v1.asciidoc:234
+
+[source, python]
+----
+resp = client.indices.put_template(
+ name="template_1",
+ index_patterns=[
+ "my-index-*"
+ ],
+ order=0,
+ settings={
+ "number_of_shards": 1
+ },
+ version=123,
+)
+print(resp)
+----
diff --git a/docs/examples/48d9697a14dfe131325521f48a7adc84.asciidoc b/docs/examples/48d9697a14dfe131325521f48a7adc84.asciidoc
new file mode 100644
index 000000000..b32f98bb4
--- /dev/null
+++ b/docs/examples/48d9697a14dfe131325521f48a7adc84.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:867
+
+[source, python]
+----
+resp = client.render_search_template(
+ id="my-search-template",
+ params={
+ "query_string": "My string",
+ "text_fields": [
+ {
+ "user_name": "John",
+ "last": False
+ },
+ {
+ "user_name": "kimchy",
+ "last": True
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/48de51de87a8ad9fd8b8db1ca25b85c1.asciidoc b/docs/examples/48de51de87a8ad9fd8b8db1ca25b85c1.asciidoc
index f7b97ae7e..55a428d31 100644
--- a/docs/examples/48de51de87a8ad9fd8b8db1ca25b85c1.asciidoc
+++ b/docs/examples/48de51de87a8ad9fd8b8db1ca25b85c1.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/similarity.asciidoc:540
[source, python]
@@ -7,14 +8,22 @@ resp = client.indices.close(
)
print(resp)
-resp = client.indices.put_settings(
+resp1 = client.indices.put_settings(
index="index",
- body={"index": {"similarity": {"default": {"type": "boolean"}}}},
+ settings={
+ "index": {
+ "similarity": {
+ "default": {
+ "type": "boolean"
+ }
+ }
+ }
+ },
)
-print(resp)
+print(resp1)
-resp = client.indices.open(
+resp2 = client.indices.open(
index="index",
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/49100a4f53c0ba345fadacdc4f2f86e4.asciidoc b/docs/examples/49100a4f53c0ba345fadacdc4f2f86e4.asciidoc
new file mode 100644
index 000000000..a96e77d68
--- /dev/null
+++ b/docs/examples/49100a4f53c0ba345fadacdc4f2f86e4.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/common-options.asciidoc:74
+
+[source, python]
+----
+resp = client.search(
+ q="kimchy",
+ filter_path="took,hits.hits._id,hits.hits._score",
+)
+print(resp)
+----
diff --git a/docs/examples/4955bae30f265b9e436f82b015de6d7e.asciidoc b/docs/examples/4955bae30f265b9e436f82b015de6d7e.asciidoc
index 47b3d1541..92d21b1f7 100644
--- a/docs/examples/4955bae30f265b9e436f82b015de6d7e.asciidoc
+++ b/docs/examples/4955bae30f265b9e436f82b015de6d7e.asciidoc
@@ -1,21 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/terms-query.asciidoc:193
[source, python]
----
resp = client.search(
index="my-index-000001",
- pretty="true",
- body={
- "query": {
- "terms": {
- "color": {
- "index": "my-index-000001",
- "id": "2",
- "path": "color",
- }
+ pretty=True,
+ query={
+ "terms": {
+ "color": {
+ "index": "my-index-000001",
+ "id": "2",
+ "path": "color"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/496d35c89dc991a1509f7e8fb93ade45.asciidoc b/docs/examples/496d35c89dc991a1509f7e8fb93ade45.asciidoc
new file mode 100644
index 000000000..da9efdf7f
--- /dev/null
+++ b/docs/examples/496d35c89dc991a1509f7e8fb93ade45.asciidoc
@@ -0,0 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:232
+
+[source, python]
+----
+resp = client.indices.create(
+ index="bengali_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "bengali_stop": {
+ "type": "stop",
+ "stopwords": "_bengali_"
+ },
+ "bengali_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "উদাহরণ"
+ ]
+ },
+ "bengali_stemmer": {
+ "type": "stemmer",
+ "language": "bengali"
+ }
+ },
+ "analyzer": {
+ "rebuilt_bengali": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "decimal_digit",
+ "bengali_keywords",
+ "indic_normalization",
+ "bengali_normalization",
+ "bengali_stop",
+ "bengali_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4980d6fcb369692b0b29ddc6767d4324.asciidoc b/docs/examples/4980d6fcb369692b0b29ddc6767d4324.asciidoc
new file mode 100644
index 000000000..5c293abb5
--- /dev/null
+++ b/docs/examples/4980d6fcb369692b0b29ddc6767d4324.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/diagnose-unassigned-shards.asciidoc:198
+
+[source, python]
+----
+resp = client.cluster.allocation_explain(
+ index="my-index-000001",
+ shard=0,
+ primary=True,
+)
+print(resp)
+----
diff --git a/docs/examples/4982c547be1ad9455ae836990aea92c5.asciidoc b/docs/examples/4982c547be1ad9455ae836990aea92c5.asciidoc
deleted file mode 100644
index 752928e3e..000000000
--- a/docs/examples/4982c547be1ad9455ae836990aea92c5.asciidoc
+++ /dev/null
@@ -1,17 +0,0 @@
-// ml/trained-models/apis/start-trained-model-deployment.asciidoc:222
-
-[source, python]
-----
-resp = client.ml.start_trained_model_deployment(
- model_id="my_model",
- deployment_id="my_model_for_search",
- body={
- "adaptive_allocations": {
- "enabled": True,
- "min_number_of_allocations": 3,
- "max_number_of_allocations": 10,
- }
- },
-)
-print(resp)
-----
\ No newline at end of file
diff --git a/docs/examples/4989cc97ce1c8fff634a10d343031bd0.asciidoc b/docs/examples/4989cc97ce1c8fff634a10d343031bd0.asciidoc
new file mode 100644
index 000000000..9087102b4
--- /dev/null
+++ b/docs/examples/4989cc97ce1c8fff634a10d343031bd0.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/disk/increase-data-node-capacity.asciidoc:104
+
+[source, python]
+----
+resp = client.cat.shards(
+ v=True,
+ h="state,node",
+ s="state",
+)
+print(resp)
+----
diff --git a/docs/examples/49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc b/docs/examples/49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc
new file mode 100644
index 000000000..a3fcb5fab
--- /dev/null
+++ b/docs/examples/49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/knn-search.asciidoc:36
+
+[source, python]
+----
+resp = client.knn_search(
+ index="my-index",
+ knn={
+ "field": "image_vector",
+ "query_vector": [
+ 0.3,
+ 0.1,
+ 1.2
+ ],
+ "k": 10,
+ "num_candidates": 100
+ },
+ source=[
+ "name",
+ "file_type"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/49c052a748c943180db78fee8e144239.asciidoc b/docs/examples/49c052a748c943180db78fee8e144239.asciidoc
new file mode 100644
index 000000000..35f82f055
--- /dev/null
+++ b/docs/examples/49c052a748c943180db78fee8e144239.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-api-key-cache.asciidoc:50
+
+[source, python]
+----
+resp = client.security.clear_api_key_cache(
+ ids="yVGMr3QByxdh1MSaicYx,YoiMaqREw0YVpjn40iMg",
+)
+print(resp)
+----
diff --git a/docs/examples/49c40b51da2469a6e00fea8fa6fbf56e.asciidoc b/docs/examples/49c40b51da2469a6e00fea8fa6fbf56e.asciidoc
new file mode 100644
index 000000000..3211a26f1
--- /dev/null
+++ b/docs/examples/49c40b51da2469a6e00fea8fa6fbf56e.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/task-management.asciidoc:11
+
+[source, python]
+----
+resp = client.tasks.list(
+ pretty=True,
+ detailed=True,
+ group_by="parents",
+ human=True,
+ actions="*data/read/esql",
+)
+print(resp)
+----
diff --git a/docs/examples/49cb3f48a0097bfc597c52fa51c6d379.asciidoc b/docs/examples/49cb3f48a0097bfc597c52fa51c6d379.asciidoc
new file mode 100644
index 000000000..ccfa417be
--- /dev/null
+++ b/docs/examples/49cb3f48a0097bfc597c52fa51c6d379.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/saml-guide.asciidoc:936
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="saml-service-role",
+ cluster=[
+ "manage_saml",
+ "manage_token"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/49d87c2eb7314ed34221c5fb4f21dfcc.asciidoc b/docs/examples/49d87c2eb7314ed34221c5fb4f21dfcc.asciidoc
new file mode 100644
index 000000000..50a554339
--- /dev/null
+++ b/docs/examples/49d87c2eb7314ed34221c5fb4f21dfcc.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:257
+
+[source, python]
+----
+resp = client.indices.analyze(
+ index="analyze_sample",
+ normalizer="my_normalizer",
+ text="BaR",
+)
+print(resp)
+----
diff --git a/docs/examples/49e8773a34fcbf825de38426cff5509c.asciidoc b/docs/examples/49e8773a34fcbf825de38426cff5509c.asciidoc
new file mode 100644
index 000000000..1723f1af4
--- /dev/null
+++ b/docs/examples/49e8773a34fcbf825de38426cff5509c.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/profile.asciidoc:1270
+
+[source, python]
+----
+resp = client.search(
+ index="my-knn-index",
+ profile=True,
+ knn={
+ "field": "my-vector",
+ "query_vector": [
+ -5,
+ 9,
+ -12
+ ],
+ "k": 3,
+ "num_candidates": 100
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/49f4d2a461536d150e16b1e0a3148678.asciidoc b/docs/examples/49f4d2a461536d150e16b1e0a3148678.asciidoc
new file mode 100644
index 000000000..c32439da7
--- /dev/null
+++ b/docs/examples/49f4d2a461536d150e16b1e0a3148678.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/clearcache.asciidoc:110
+
+[source, python]
+----
+resp = client.indices.clear_cache(
+ index="my-index-000001",
+ fielddata=True,
+)
+print(resp)
+
+resp1 = client.indices.clear_cache(
+ index="my-index-000001",
+ query=True,
+)
+print(resp1)
+
+resp2 = client.indices.clear_cache(
+ index="my-index-000001",
+ request=True,
+)
+print(resp2)
+----
diff --git a/docs/examples/4a1951844bd39f26961bfc965f3432b1.asciidoc b/docs/examples/4a1951844bd39f26961bfc965f3432b1.asciidoc
new file mode 100644
index 000000000..ed58cd4a6
--- /dev/null
+++ b/docs/examples/4a1951844bd39f26961bfc965f3432b1.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/multi-get.asciidoc:138
+
+[source, python]
+----
+resp = client.mget(
+ index="my-index-000001",
+ docs=[
+ {
+ "_id": "1"
+ },
+ {
+ "_id": "2"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/4a2080ae55d931eb0643cc3eb91ec524.asciidoc b/docs/examples/4a2080ae55d931eb0643cc3eb91ec524.asciidoc
index 6947c1564..7d1576e38 100644
--- a/docs/examples/4a2080ae55d931eb0643cc3eb91ec524.asciidoc
+++ b/docs/examples/4a2080ae55d931eb0643cc3eb91ec524.asciidoc
@@ -1,17 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/params/multi-fields.asciidoc:82
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "text": {
- "type": "text",
- "fields": {
- "english": {"type": "text", "analyzer": "english"}
- },
+ mappings={
+ "properties": {
+ "text": {
+ "type": "text",
+ "fields": {
+ "english": {
+ "type": "text",
+ "analyzer": "english"
+ }
}
}
}
@@ -19,31 +21,36 @@ resp = client.indices.create(
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"text": "quick brown fox"},
+ document={
+ "text": "quick brown fox"
+ },
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="my-index-000001",
id="2",
- body={"text": "quick brown foxes"},
+ document={
+ "text": "quick brown foxes"
+ },
)
-print(resp)
+print(resp2)
-resp = client.search(
+resp3 = client.search(
index="my-index-000001",
- body={
- "query": {
- "multi_match": {
- "query": "quick brown foxes",
- "fields": ["text", "text.english"],
- "type": "most_fields",
- }
+ query={
+ "multi_match": {
+ "query": "quick brown foxes",
+ "fields": [
+ "text",
+ "text.english"
+ ],
+ "type": "most_fields"
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp3)
+----
diff --git a/docs/examples/4a4b8a406681584a91c0e614c1fa4344.asciidoc b/docs/examples/4a4b8a406681584a91c0e614c1fa4344.asciidoc
new file mode 100644
index 000000000..2b0e13e14
--- /dev/null
+++ b/docs/examples/4a4b8a406681584a91c0e614c1fa4344.asciidoc
@@ -0,0 +1,54 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-api-keys.asciidoc:128
+
+[source, python]
+----
+resp = client.security.create_api_key(
+ name="my-api-key",
+ expiration="1d",
+ role_descriptors={
+ "role-a": {
+ "cluster": [
+ "all"
+ ],
+ "indices": [
+ {
+ "names": [
+ "index-a*"
+ ],
+ "privileges": [
+ "read"
+ ]
+ }
+ ]
+ },
+ "role-b": {
+ "cluster": [
+ "all"
+ ],
+ "indices": [
+ {
+ "names": [
+ "index-b*"
+ ],
+ "privileges": [
+ "all"
+ ]
+ }
+ ]
+ }
+ },
+ metadata={
+ "application": "my-application",
+ "environment": {
+ "level": 1,
+ "trusted": True,
+ "tags": [
+ "dev",
+ "staging"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4a7510a9c0468303658383c00796dad2.asciidoc b/docs/examples/4a7510a9c0468303658383c00796dad2.asciidoc
new file mode 100644
index 000000000..9d2104790
--- /dev/null
+++ b/docs/examples/4a7510a9c0468303658383c00796dad2.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/ignore-malformed.asciidoc:70
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "index.mapping.ignore_malformed": True
+ },
+ mappings={
+ "properties": {
+ "number_one": {
+ "type": "byte"
+ },
+ "number_two": {
+ "type": "integer",
+ "ignore_malformed": False
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4aa81a694266fb634904224d14cd9a87.asciidoc b/docs/examples/4aa81a694266fb634904224d14cd9a87.asciidoc
index c4365adfd..22a5c670e 100644
--- a/docs/examples/4aa81a694266fb634904224d14cd9a87.asciidoc
+++ b/docs/examples/4aa81a694266fb634904224d14cd9a87.asciidoc
@@ -1,17 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:668
[source, python]
----
resp = client.search(
index="my_queries2",
- body={
- "query": {
- "percolate": {
- "field": "query",
- "document": {"my_field": "wxyz"},
+ query={
+ "percolate": {
+ "field": "query",
+ "document": {
+ "my_field": "wxyz"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4ae494d1e62231e832fc0436b04e2014.asciidoc b/docs/examples/4ae494d1e62231e832fc0436b04e2014.asciidoc
new file mode 100644
index 000000000..2aed5eb79
--- /dev/null
+++ b/docs/examples/4ae494d1e62231e832fc0436b04e2014.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/validate.asciidoc:116
+
+[source, python]
+----
+resp = client.indices.validate_query(
+ index="my-index-000001",
+ query={
+ "bool": {
+ "must": {
+ "query_string": {
+ "query": "*:*"
+ }
+ },
+ "filter": {
+ "term": {
+ "user.id": "kimchy"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4af15c4f26ddefb9c350e7a246a66a15.asciidoc b/docs/examples/4af15c4f26ddefb9c350e7a246a66a15.asciidoc
new file mode 100644
index 000000000..6637f7e12
--- /dev/null
+++ b/docs/examples/4af15c4f26ddefb9c350e7a246a66a15.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/top-metrics-aggregation.asciidoc:362
+
+[source, python]
+----
+resp = client.search(
+ index="node",
+ filter_path="aggregations",
+ aggs={
+ "ip": {
+ "terms": {
+ "field": "ip",
+ "order": {
+ "tm.m": "desc"
+ }
+ },
+ "aggs": {
+ "tm": {
+ "top_metrics": {
+ "metrics": {
+ "field": "m"
+ },
+ "sort": {
+ "date": "desc"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4b1044259a6d777d87529eae25675005.asciidoc b/docs/examples/4b1044259a6d777d87529eae25675005.asciidoc
index 01c60ca18..3d9ff4dca 100644
--- a/docs/examples/4b1044259a6d777d87529eae25675005.asciidoc
+++ b/docs/examples/4b1044259a6d777d87529eae25675005.asciidoc
@@ -1,19 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:444
[source, python]
----
resp = client.ingest.put_pipeline(
id="set-foo",
- body={
- "description": "sets foo",
- "processors": [{"set": {"field": "foo", "value": "bar"}}],
- },
+ description="sets foo",
+ processors=[
+ {
+ "set": {
+ "field": "foo",
+ "value": "bar"
+ }
+ }
+ ],
)
print(resp)
-resp = client.update_by_query(
+resp1 = client.update_by_query(
index="my-index-000001",
pipeline="set-foo",
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/4b113c7f475cfe484a150ddbb8e6c5c7.asciidoc b/docs/examples/4b113c7f475cfe484a150ddbb8e6c5c7.asciidoc
new file mode 100644
index 000000000..c50d2f691
--- /dev/null
+++ b/docs/examples/4b113c7f475cfe484a150ddbb8e6c5c7.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-roles.asciidoc:170
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="role_with_remote_indices",
+ remote_indices=[
+ {
+ "clusters": [
+ "my_remote"
+ ],
+ "names": [
+ "logs*"
+ ],
+ "privileges": [
+ "read",
+ "read_cross_cluster",
+ "view_index_metadata"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/4b3a49710fafa35d6d41a8ec12434515.asciidoc b/docs/examples/4b3a49710fafa35d6d41a8ec12434515.asciidoc
new file mode 100644
index 000000000..3348a97e0
--- /dev/null
+++ b/docs/examples/4b3a49710fafa35d6d41a8ec12434515.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:467
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "percolate": {
+ "field": "query",
+ "documents": [
+ {
+ "message": "bonsai tree"
+ },
+ {
+ "message": "new tree"
+ },
+ {
+ "message": "the office"
+ },
+ {
+ "message": "office tree"
+ }
+ ]
+ }
+ },
+ highlight={
+ "fields": {
+ "message": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4b5110a21676cc0e26e050a4b4552235.asciidoc b/docs/examples/4b5110a21676cc0e26e050a4b4552235.asciidoc
new file mode 100644
index 000000000..b631d63a0
--- /dev/null
+++ b/docs/examples/4b5110a21676cc0e26e050a4b4552235.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// synonyms/apis/get-synonyms-set.asciidoc:75
+
+[source, python]
+----
+resp = client.synonyms.get_synonym(
+ id="my-synonyms-set",
+)
+print(resp)
+----
diff --git a/docs/examples/4ba86373e13e106de044f190343be328.asciidoc b/docs/examples/4ba86373e13e106de044f190343be328.asciidoc
index a9e11b1f6..5f80de6e3 100644
--- a/docs/examples/4ba86373e13e106de044f190343be328.asciidoc
+++ b/docs/examples/4ba86373e13e106de044f190343be328.asciidoc
@@ -1,31 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:365
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "countries": {
- "terms": {
- "field": "artist.country",
- "order": [
- {"rock>playback_stats.avg": "desc"},
- {"_count": "desc"},
- ],
- },
- "aggs": {
- "rock": {
- "filter": {"term": {"genre": "rock"}},
- "aggs": {
- "playback_stats": {
- "stats": {"field": "play_count"}
+ aggs={
+ "countries": {
+ "terms": {
+ "field": "artist.country",
+ "order": [
+ {
+ "rock>playback_stats.avg": "desc"
+ },
+ {
+ "_count": "desc"
+ }
+ ]
+ },
+ "aggs": {
+ "rock": {
+ "filter": {
+ "term": {
+ "genre": "rock"
+ }
+ },
+ "aggs": {
+ "playback_stats": {
+ "stats": {
+ "field": "play_count"
}
- },
+ }
}
- },
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4bb4a64cf04e3feb133b0221d29beaa9.asciidoc b/docs/examples/4bb4a64cf04e3feb133b0221d29beaa9.asciidoc
new file mode 100644
index 000000000..915086067
--- /dev/null
+++ b/docs/examples/4bb4a64cf04e3feb133b0221d29beaa9.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:127
+
+[source, python]
+----
+resp = client.snapshot.restore(
+ repository="my_repository",
+ snapshot="my_snapshot_2099.05.06",
+ indices="my-index,logs-my_app-default",
+)
+print(resp)
+----
diff --git a/docs/examples/4bb7bcfebca682fb9c9e3e47bfd5ef6f.asciidoc b/docs/examples/4bb7bcfebca682fb9c9e3e47bfd5ef6f.asciidoc
new file mode 100644
index 000000000..aa26b5770
--- /dev/null
+++ b/docs/examples/4bb7bcfebca682fb9c9e3e47bfd5ef6f.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:821
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ track_total_hits=False,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "user_name": {
+ "terms": {
+ "field": "user_name"
+ }
+ }
+ },
+ {
+ "date": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "1d",
+ "order": "desc"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4bba59cf745ac7b996bf90308bc26957.asciidoc b/docs/examples/4bba59cf745ac7b996bf90308bc26957.asciidoc
new file mode 100644
index 000000000..2f32af3b6
--- /dev/null
+++ b/docs/examples/4bba59cf745ac7b996bf90308bc26957.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/pathhierarchy-tokenizer.asciidoc:349
+
+[source, python]
+----
+resp = client.search(
+ index="file-path-test",
+ query={
+ "bool": {
+ "must": {
+ "match": {
+ "file_path": "16"
+ }
+ },
+ "filter": {
+ "term": {
+ "file_path.tree": "/User/alice"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4bc4db44b8c74610b73f21a421099a13.asciidoc b/docs/examples/4bc4db44b8c74610b73f21a421099a13.asciidoc
new file mode 100644
index 000000000..488080f02
--- /dev/null
+++ b/docs/examples/4bc4db44b8c74610b73f21a421099a13.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-tokens.asciidoc:188
+
+[source, python]
+----
+resp = client.security.invalidate_token(
+ realm_name="saml1",
+)
+print(resp)
+----
diff --git a/docs/examples/4bc744b0f33b322741a8caf6d8d7d765.asciidoc b/docs/examples/4bc744b0f33b322741a8caf6d8d7d765.asciidoc
index fa34f145b..4803cf0ec 100644
--- a/docs/examples/4bc744b0f33b322741a8caf6d8d7d765.asciidoc
+++ b/docs/examples/4bc744b0f33b322741a8caf6d8d7d765.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/index_.asciidoc:594
[source, python]
@@ -6,11 +7,13 @@ resp = client.index(
index="my-index-000001",
id="1",
op_type="create",
- body={
+ document={
"@timestamp": "2099-11-15T13:12:00",
"message": "GET /search HTTP/1.1 200 1070000",
- "user": {"id": "kimchy"},
+ "user": {
+ "id": "kimchy"
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4bd42e31ac4a5cf237777f1a0e97aba8.asciidoc b/docs/examples/4bd42e31ac4a5cf237777f1a0e97aba8.asciidoc
new file mode 100644
index 000000000..2f5d05b92
--- /dev/null
+++ b/docs/examples/4bd42e31ac4a5cf237777f1a0e97aba8.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/examples.asciidoc:286
+
+[source, python]
+----
+resp = client.transform.start_transform(
+ transform_id="suspicious_client_ips",
+)
+print(resp)
+----
diff --git a/docs/examples/4be07b34db282044c88d5021c7ea08ee.asciidoc b/docs/examples/4be07b34db282044c88d5021c7ea08ee.asciidoc
index 5692f1cbc..5c8c2d90c 100644
--- a/docs/examples/4be07b34db282044c88d5021c7ea08ee.asciidoc
+++ b/docs/examples/4be07b34db282044c88d5021c7ea08ee.asciidoc
@@ -1,31 +1,49 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/dense-vector.asciidoc:18
[source, python]
----
resp = client.indices.create(
index="my-index",
- body={
- "mappings": {
- "properties": {
- "my_vector": {"type": "dense_vector", "dims": 3},
- "my_text": {"type": "keyword"},
+ mappings={
+ "properties": {
+ "my_vector": {
+ "type": "dense_vector",
+ "dims": 3
+ },
+ "my_text": {
+ "type": "keyword"
}
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index",
id="1",
- body={"my_text": "text1", "my_vector": [0.5, 10, 6]},
+ document={
+ "my_text": "text1",
+ "my_vector": [
+ 0.5,
+ 10,
+ 6
+ ]
+ },
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="my-index",
id="2",
- body={"my_text": "text2", "my_vector": [-0.5, 10, 10]},
+ document={
+ "my_text": "text2",
+ "my_vector": [
+ -0.5,
+ 10,
+ 10
+ ]
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/4be20da16d2b58216e8b307218c7bf3a.asciidoc b/docs/examples/4be20da16d2b58216e8b307218c7bf3a.asciidoc
new file mode 100644
index 000000000..3b46ddb6e
--- /dev/null
+++ b/docs/examples/4be20da16d2b58216e8b307218c7bf3a.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:188
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my-data-stream-template",
+ index_patterns=[
+ "my-data-stream*"
+ ],
+ data_stream={},
+ priority=500,
+ template={
+ "mappings": {
+ "properties": {
+ "host": {
+ "properties": {
+ "ip": {
+ "type": "ip",
+ "ignore_malformed": True
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4bef98a2dac575a50ee0783c2269f1db.asciidoc b/docs/examples/4bef98a2dac575a50ee0783c2269f1db.asciidoc
deleted file mode 100644
index b29d99465..000000000
--- a/docs/examples/4bef98a2dac575a50ee0783c2269f1db.asciidoc
+++ /dev/null
@@ -1,20 +0,0 @@
-// mapping/types/dense-vector.asciidoc:469
-
-[source, python]
-----
-resp = client.indices.create(
- index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "text_embedding": {
- "type": "dense_vector",
- "dims": 384,
- "index_options": {"type": "flat"},
- }
- }
- }
- },
-)
-print(resp)
-----
\ No newline at end of file
diff --git a/docs/examples/4bf6bb703a52267379ae2b1e1308cf8b.asciidoc b/docs/examples/4bf6bb703a52267379ae2b1e1308cf8b.asciidoc
new file mode 100644
index 000000000..f3bf35cd9
--- /dev/null
+++ b/docs/examples/4bf6bb703a52267379ae2b1e1308cf8b.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/script-query.asciidoc:156
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "bool": {
+ "filter": {
+ "script": {
+ "script": {
+ "source": "doc['num1'].value > params.param1",
+ "lang": "painless",
+ "params": {
+ "param1": 5
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4bfcb2861f1d572bd0d66acd66deab0b.asciidoc b/docs/examples/4bfcb2861f1d572bd0d66acd66deab0b.asciidoc
new file mode 100644
index 000000000..b83d3fc8a
--- /dev/null
+++ b/docs/examples/4bfcb2861f1d572bd0d66acd66deab0b.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/update-datafeed.asciidoc:160
+
+[source, python]
+----
+resp = client.ml.update_datafeed(
+ datafeed_id="datafeed-test-job",
+ query={
+ "term": {
+ "geo.src": "US"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4c174e228b6b74497b73ef2be80de7ad.asciidoc b/docs/examples/4c174e228b6b74497b73ef2be80de7ad.asciidoc
index 64d7ae76e..aec9f0336 100644
--- a/docs/examples/4c174e228b6b74497b73ef2be80de7ad.asciidoc
+++ b/docs/examples/4c174e228b6b74497b73ef2be80de7ad.asciidoc
@@ -1,7 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/get-trained-models.asciidoc:1460
[source, python]
----
resp = client.ml.get_trained_models()
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4c3db8987d7b2d3d3df78ff1e71e7ede.asciidoc b/docs/examples/4c3db8987d7b2d3d3df78ff1e71e7ede.asciidoc
index 3e590b514..a8ec61ba0 100644
--- a/docs/examples/4c3db8987d7b2d3d3df78ff1e71e7ede.asciidoc
+++ b/docs/examples/4c3db8987d7b2d3d3df78ff1e71e7ede.asciidoc
@@ -1,9 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/match-query.asciidoc:18
[source, python]
----
resp = client.search(
- body={"query": {"match": {"message": {"query": "this is a test"}}}},
+ query={
+ "match": {
+ "message": {
+ "query": "this is a test"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4c5f0d7af287618062bb627b44ccb23e.asciidoc b/docs/examples/4c5f0d7af287618062bb627b44ccb23e.asciidoc
new file mode 100644
index 000000000..4d151a625
--- /dev/null
+++ b/docs/examples/4c5f0d7af287618062bb627b44ccb23e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:192
+
+[source, python]
+----
+resp = client.indices.forcemerge(
+ index="my-index",
+)
+print(resp)
+----
diff --git a/docs/examples/4c712bd5637892a11f16b8975a0a98ed.asciidoc b/docs/examples/4c712bd5637892a11f16b8975a0a98ed.asciidoc
new file mode 100644
index 000000000..33328d0f1
--- /dev/null
+++ b/docs/examples/4c712bd5637892a11f16b8975a0a98ed.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/dataframeanalytics.asciidoc:131
+
+[source, python]
+----
+resp = client.cat.ml_data_frame_analytics(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/4c777b8360ef6c7671ae2e3803c0b0f6.asciidoc b/docs/examples/4c777b8360ef6c7671ae2e3803c0b0f6.asciidoc
new file mode 100644
index 000000000..49228b04a
--- /dev/null
+++ b/docs/examples/4c777b8360ef6c7671ae2e3803c0b0f6.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/tophits-aggregation.asciidoc:52
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "top_tags": {
+ "terms": {
+ "field": "type",
+ "size": 3
+ },
+ "aggs": {
+ "top_sales_hits": {
+ "top_hits": {
+ "sort": [
+ {
+ "date": {
+ "order": "desc"
+ }
+ }
+ ],
+ "_source": {
+ "includes": [
+ "date",
+ "price"
+ ]
+ },
+ "size": 1
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4c77d12039fe2445c9251e33979071ac.asciidoc b/docs/examples/4c77d12039fe2445c9251e33979071ac.asciidoc
new file mode 100644
index 000000000..acdd3d555
--- /dev/null
+++ b/docs/examples/4c77d12039fe2445c9251e33979071ac.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/categorize-text-aggregation.asciidoc:282
+
+[source, python]
+----
+resp = client.search(
+ index="log-messages",
+ filter_path="aggregations",
+ aggs={
+ "categories": {
+ "categorize_text": {
+ "field": "message",
+ "categorization_filters": [
+ "\\w+\\_\\d{3}"
+ ],
+ "similarity_threshold": 11
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4c803b088c1915a7b0634d5cafabe606.asciidoc b/docs/examples/4c803b088c1915a7b0634d5cafabe606.asciidoc
new file mode 100644
index 000000000..a437542f9
--- /dev/null
+++ b/docs/examples/4c803b088c1915a7b0634d5cafabe606.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/ipprefix-aggregation.asciidoc:219
+
+[source, python]
+----
+resp = client.search(
+ index="network-traffic",
+ size=0,
+ aggs={
+ "ipv4-subnets": {
+ "ip_prefix": {
+ "field": "ipv4",
+ "prefix_length": 24,
+ "keyed": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4c9350ed09b28f00e297ebe73c3b95a2.asciidoc b/docs/examples/4c9350ed09b28f00e297ebe73c3b95a2.asciidoc
new file mode 100644
index 000000000..26d87600f
--- /dev/null
+++ b/docs/examples/4c9350ed09b28f00e297ebe73c3b95a2.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-elasticsearch.asciidoc:125
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="my-msmarco-minilm-model",
+ inference_config={
+ "service": "elasticsearch",
+ "service_settings": {
+ "num_allocations": 1,
+ "num_threads": 1,
+ "model_id": "msmarco-MiniLM-L12-cos-v5"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4c95d54b32df4dc49e9762b6c1ae2c05.asciidoc b/docs/examples/4c95d54b32df4dc49e9762b6c1ae2c05.asciidoc
index 92f7e5d52..20d5098b5 100644
--- a/docs/examples/4c95d54b32df4dc49e9762b6c1ae2c05.asciidoc
+++ b/docs/examples/4c95d54b32df4dc49e9762b6c1ae2c05.asciidoc
@@ -1,24 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/text.asciidoc:356
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "tag": {
- "type": "text",
- "fielddata": True,
- "fielddata_frequency_filter": {
- "min": 0.001,
- "max": 0.1,
- "min_segment_size": 500,
- },
+ mappings={
+ "properties": {
+ "tag": {
+ "type": "text",
+ "fielddata": True,
+ "fielddata_frequency_filter": {
+ "min": 0.001,
+ "max": 0.1,
+ "min_segment_size": 500
}
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc b/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc
index f2197e790..11b34e97f 100644
--- a/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc
+++ b/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc
@@ -1,7 +1,8 @@
-// cluster/allocation-explain.asciidoc:344
+// This file is autogenerated, DO NOT EDIT
+// cluster/allocation-explain.asciidoc:443
[source, python]
----
resp = client.cluster.allocation_explain()
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4ca5bc2c2b2f64d15b9c16370ae97a39.asciidoc b/docs/examples/4ca5bc2c2b2f64d15b9c16370ae97a39.asciidoc
new file mode 100644
index 000000000..cf973cbc7
--- /dev/null
+++ b/docs/examples/4ca5bc2c2b2f64d15b9c16370ae97a39.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geohashgrid-aggregation.asciidoc:212
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggregations={
+ "tiles-in-bounds": {
+ "geohash_grid": {
+ "field": "location",
+ "precision": 8,
+ "bounds": {
+ "top_left": "POINT (4.21875 53.4375)",
+ "bottom_right": "POINT (5.625 52.03125)"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4cb44556b8c699f43489b17b42ddd475.asciidoc b/docs/examples/4cb44556b8c699f43489b17b42ddd475.asciidoc
new file mode 100644
index 000000000..7e66cc7c7
--- /dev/null
+++ b/docs/examples/4cb44556b8c699f43489b17b42ddd475.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/multi-get.asciidoc:216
+
+[source, python]
+----
+resp = client.mget(
+ docs=[
+ {
+ "_index": "test",
+ "_id": "1",
+ "stored_fields": [
+ "field1",
+ "field2"
+ ]
+ },
+ {
+ "_index": "test",
+ "_id": "2",
+ "stored_fields": [
+ "field3",
+ "field4"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/4cd40113e0fc90c37976f28d7e4a2327.asciidoc b/docs/examples/4cd40113e0fc90c37976f28d7e4a2327.asciidoc
new file mode 100644
index 000000000..9e552977c
--- /dev/null
+++ b/docs/examples/4cd40113e0fc90c37976f28d7e4a2327.asciidoc
@@ -0,0 +1,84 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/normalizer.asciidoc:18
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index",
+ settings={
+ "analysis": {
+ "normalizer": {
+ "my_normalizer": {
+ "type": "custom",
+ "char_filter": [],
+ "filter": [
+ "lowercase",
+ "asciifolding"
+ ]
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "foo": {
+ "type": "keyword",
+ "normalizer": "my_normalizer"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="index",
+ id="1",
+ document={
+ "foo": "BÀR"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="index",
+ id="2",
+ document={
+ "foo": "bar"
+ },
+)
+print(resp2)
+
+resp3 = client.index(
+ index="index",
+ id="3",
+ document={
+ "foo": "baz"
+ },
+)
+print(resp3)
+
+resp4 = client.indices.refresh(
+ index="index",
+)
+print(resp4)
+
+resp5 = client.search(
+ index="index",
+ query={
+ "term": {
+ "foo": "BAR"
+ }
+ },
+)
+print(resp5)
+
+resp6 = client.search(
+ index="index",
+ query={
+ "match": {
+ "foo": "BAR"
+ }
+ },
+)
+print(resp6)
+----
diff --git a/docs/examples/4cdbd53f08df4bf66e2a47c0f1fcb3f8.asciidoc b/docs/examples/4cdbd53f08df4bf66e2a47c0f1fcb3f8.asciidoc
new file mode 100644
index 000000000..fb2f2e2c8
--- /dev/null
+++ b/docs/examples/4cdbd53f08df4bf66e2a47c0f1fcb3f8.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/clearcache.asciidoc:130
+
+[source, python]
+----
+resp = client.indices.clear_cache(
+ index="my-index-000001",
+ fields="foo,bar",
+)
+print(resp)
+----
diff --git a/docs/examples/4cdcc3fde5cea165a3a7567962b9bd61.asciidoc b/docs/examples/4cdcc3fde5cea165a3a7567962b9bd61.asciidoc
new file mode 100644
index 000000000..a74c2c8cb
--- /dev/null
+++ b/docs/examples/4cdcc3fde5cea165a3a7567962b9bd61.asciidoc
@@ -0,0 +1,69 @@
+// This file is autogenerated, DO NOT EDIT
+// synonyms/apis/put-synonyms-set.asciidoc:125
+
+[source, python]
+----
+resp = client.synonyms.put_synonym(
+ id="my-synonyms-set",
+ synonyms_set=[
+ {
+ "id": "test-1",
+ "synonyms": "hello, hi"
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.indices.create(
+ index="test-index",
+ settings={
+ "analysis": {
+ "filter": {
+ "synonyms_filter": {
+ "type": "synonym_graph",
+ "synonyms_set": "my-synonyms-set",
+ "updateable": True
+ }
+ },
+ "analyzer": {
+ "my_index_analyzer": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase"
+ ]
+ },
+ "my_search_analyzer": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "synonyms_filter"
+ ]
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "title": {
+ "type": "text",
+ "analyzer": "my_index_analyzer",
+ "search_analyzer": "my_search_analyzer"
+ }
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.synonyms.put_synonym(
+ id="my-synonyms-set",
+ synonyms_set=[
+ {
+ "id": "test-1",
+ "synonyms": "hello, hi, howdy"
+ }
+ ],
+)
+print(resp2)
+----
diff --git a/docs/examples/4ce4563e207233c48ffe849728052dca.asciidoc b/docs/examples/4ce4563e207233c48ffe849728052dca.asciidoc
new file mode 100644
index 000000000..8309861f5
--- /dev/null
+++ b/docs/examples/4ce4563e207233c48ffe849728052dca.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:412
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="logs-my_app-default",
+)
+print(resp)
+----
diff --git a/docs/examples/4d21725453955582ff12b4a1104aa7b6.asciidoc b/docs/examples/4d21725453955582ff12b4a1104aa7b6.asciidoc
new file mode 100644
index 000000000..4f877c366
--- /dev/null
+++ b/docs/examples/4d21725453955582ff12b4a1104aa7b6.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/update-filter.asciidoc:44
+
+[source, python]
+----
+resp = client.ml.update_filter(
+ filter_id="safe_domains",
+ description="Updated list of domains",
+ add_items=[
+ "*.myorg.com"
+ ],
+ remove_items=[
+ "wikipedia.org"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/4d2e6eb7fea407deeb7a859c267fda62.asciidoc b/docs/examples/4d2e6eb7fea407deeb7a859c267fda62.asciidoc
new file mode 100644
index 000000000..cc1d2081a
--- /dev/null
+++ b/docs/examples/4d2e6eb7fea407deeb7a859c267fda62.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/put-job.asciidoc:254
+
+[source, python]
+----
+resp = client.rollup.put_job(
+ id="sensor",
+ index_pattern="sensor-*",
+ rollup_index="sensor_rollup",
+ cron="*/30 * * * * ?",
+ page_size=1000,
+ groups={
+ "date_histogram": {
+ "field": "timestamp",
+ "fixed_interval": "1h",
+ "delay": "7d"
+ },
+ "terms": {
+ "fields": [
+ "node"
+ ]
+ }
+ },
+ metrics=[
+ {
+ "field": "temperature",
+ "metrics": [
+ "min",
+ "max",
+ "sum"
+ ]
+ },
+ {
+ "field": "voltage",
+ "metrics": [
+ "avg"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/4d46e2160784bdf7cce948e9f0d31fc8.asciidoc b/docs/examples/4d46e2160784bdf7cce948e9f0d31fc8.asciidoc
new file mode 100644
index 000000000..2894e9dd6
--- /dev/null
+++ b/docs/examples/4d46e2160784bdf7cce948e9f0d31fc8.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/word-delimiter-graph-tokenfilter.asciidoc:410
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "keyword",
+ "filter": [
+ "my_custom_word_delimiter_graph_filter"
+ ]
+ }
+ },
+ "filter": {
+ "my_custom_word_delimiter_graph_filter": {
+ "type": "word_delimiter_graph",
+ "type_table": [
+ "- => ALPHA"
+ ],
+ "split_on_case_change": False,
+ "split_on_numerics": False,
+ "stem_english_possessive": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4d7c0b52d3c0a084157428624c543c90.asciidoc b/docs/examples/4d7c0b52d3c0a084157428624c543c90.asciidoc
new file mode 100644
index 000000000..f949a6474
--- /dev/null
+++ b/docs/examples/4d7c0b52d3c0a084157428624c543c90.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/common/apis/get-ml-info.asciidoc:38
+
+[source, python]
+----
+resp = client.ml.info()
+print(resp)
+----
diff --git a/docs/examples/4dab4c5168047ba596af1beb0e55b845.asciidoc b/docs/examples/4dab4c5168047ba596af1beb0e55b845.asciidoc
new file mode 100644
index 000000000..275db14c9
--- /dev/null
+++ b/docs/examples/4dab4c5168047ba596af1beb0e55b845.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// migration/transient-settings-migration-guide.asciidoc:82
+
+[source, python]
+----
+resp = client.cluster.get_settings(
+ flat_settings=True,
+)
+print(resp)
+----
diff --git a/docs/examples/4ded8ad815ac0e83b1c21a6c18fd0763.asciidoc b/docs/examples/4ded8ad815ac0e83b1c21a6c18fd0763.asciidoc
new file mode 100644
index 000000000..234665baa
--- /dev/null
+++ b/docs/examples/4ded8ad815ac0e83b1c21a6c18fd0763.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/ecommerce-tutorial.asciidoc:401
+
+[source, python]
+----
+resp = client.transform.start_transform(
+ transform_id="ecommerce-customer-transform",
+)
+print(resp)
+----
diff --git a/docs/examples/4e1f02928ef243bf07fd425754b7642b.asciidoc b/docs/examples/4e1f02928ef243bf07fd425754b7642b.asciidoc
index e83cf8c7f..cbeb13b5e 100644
--- a/docs/examples/4e1f02928ef243bf07fd425754b7642b.asciidoc
+++ b/docs/examples/4e1f02928ef243bf07fd425754b7642b.asciidoc
@@ -1,6 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// setup/add-nodes.asciidoc:109
[source, python]
----
+resp = client.cluster.post_voting_config_exclusions(
+ node_names="node_name",
+)
+print(resp)
-----
\ No newline at end of file
+resp1 = client.cluster.post_voting_config_exclusions(
+ node_names="node_name",
+ timeout="1m",
+)
+print(resp1)
+----
diff --git a/docs/examples/4e2317aa45e87922d07c8ddc67a82d32.asciidoc b/docs/examples/4e2317aa45e87922d07c8ddc67a82d32.asciidoc
new file mode 100644
index 000000000..7b5c75de7
--- /dev/null
+++ b/docs/examples/4e2317aa45e87922d07c8ddc67a82d32.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/pathhierarchy-tokenizer.asciidoc:100
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "my_tokenizer"
+ }
+ },
+ "tokenizer": {
+ "my_tokenizer": {
+ "type": "path_hierarchy",
+ "delimiter": "-",
+ "replacement": "/",
+ "skip": 2
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="one-two-three-four-five",
+)
+print(resp1)
+----
diff --git a/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc b/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc
index 3954dfeb5..0335ed397 100644
--- a/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc
+++ b/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// inference/delete-inference.asciidoc:70
[source, python]
@@ -7,4 +8,4 @@ resp = client.inference.delete(
inference_id="my-elser-model",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4e4608ae4ce93c27bd174a9ea078cab2.asciidoc b/docs/examples/4e4608ae4ce93c27bd174a9ea078cab2.asciidoc
new file mode 100644
index 000000000..3464a1ccc
--- /dev/null
+++ b/docs/examples/4e4608ae4ce93c27bd174a9ea078cab2.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/semantic-search/hybrid-search.asciidoc:10
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ retriever={
+ "rrf": {
+ "retrievers": [
+ {
+ "standard": {
+ "query": {
+ "match": {
+ "my_text_field": "the query string"
+ }
+ }
+ }
+ },
+ {
+ "standard": {
+ "query": {
+ "sparse_vector": {
+ "field": "my_tokens",
+ "inference_id": "my-elser-endpoint",
+ "query": "the query string"
+ }
+ }
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4e50d9d25bfb07ac73e3a2be5d2fbbf7.asciidoc b/docs/examples/4e50d9d25bfb07ac73e3a2be5d2fbbf7.asciidoc
new file mode 100644
index 000000000..46f659edd
--- /dev/null
+++ b/docs/examples/4e50d9d25bfb07ac73e3a2be5d2fbbf7.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:227
+
+[source, python]
+----
+resp = client.search(
+ size=10000,
+ query={
+ "match": {
+ "user.id": "elkbee"
+ }
+ },
+ pit={
+ "id": "46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==",
+ "keep_alive": "1m"
+ },
+ sort=[
+ {
+ "@timestamp": {
+ "order": "asc",
+ "format": "strict_date_optional_time_nanos"
+ }
+ },
+ {
+ "_shard_doc": "desc"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/4e5f7a97efdbf517f7a2ed6ef7ff469c.asciidoc b/docs/examples/4e5f7a97efdbf517f7a2ed6ef7ff469c.asciidoc
new file mode 100644
index 000000000..71a77ed24
--- /dev/null
+++ b/docs/examples/4e5f7a97efdbf517f7a2ed6ef7ff469c.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:409
+
+[source, python]
+----
+resp = client.render_search_template(
+ source="{ \"query\": { \"terms\": { \"tags\": {{#toJson}}tags{{/toJson}} }}}",
+ params={
+ "tags": [
+ "prod",
+ "es01"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4e6b78ac991ed2d5f9a2e7c89f4fc471.asciidoc b/docs/examples/4e6b78ac991ed2d5f9a2e7c89f4fc471.asciidoc
new file mode 100644
index 000000000..1ed8125c9
--- /dev/null
+++ b/docs/examples/4e6b78ac991ed2d5f9a2e7c89f4fc471.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/completion-suggest.asciidoc:121
+
+[source, python]
+----
+resp = client.search(
+ index="music",
+ pretty=True,
+ suggest={
+ "song-suggest": {
+ "prefix": "nir",
+ "completion": {
+ "field": "suggest"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4e926063a9494b563387617b08c4f232.asciidoc b/docs/examples/4e926063a9494b563387617b08c4f232.asciidoc
new file mode 100644
index 000000000..361c4b214
--- /dev/null
+++ b/docs/examples/4e926063a9494b563387617b08c4f232.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/restore-from-snapshot.asciidoc:284
+
+[source, python]
+----
+resp = client.snapshot.get(
+ repository="my_repository",
+ snapshot="*",
+ verbose=False,
+)
+print(resp)
+----
diff --git a/docs/examples/4e931cfac74e46e221cf4a9ab88a182d.asciidoc b/docs/examples/4e931cfac74e46e221cf4a9ab88a182d.asciidoc
new file mode 100644
index 000000000..6970d0a99
--- /dev/null
+++ b/docs/examples/4e931cfac74e46e221cf4a9ab88a182d.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// search/field-caps.asciidoc:246
+
+[source, python]
+----
+resp = client.field_caps(
+ fields="rating,title",
+ include_unmapped=True,
+)
+print(resp)
+----
diff --git a/docs/examples/4ed946065faa92f9950f04e402676a97.asciidoc b/docs/examples/4ed946065faa92f9950f04e402676a97.asciidoc
new file mode 100644
index 000000000..47af87b3b
--- /dev/null
+++ b/docs/examples/4ed946065faa92f9950f04e402676a97.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/info.asciidoc:200
+
+[source, python]
+----
+resp = client.xpack.info(
+ human=False,
+)
+print(resp)
+----
diff --git a/docs/examples/4ee31fd4ea6d18f32ec28b7fa433441d.asciidoc b/docs/examples/4ee31fd4ea6d18f32ec28b7fa433441d.asciidoc
new file mode 100644
index 000000000..3a608567f
--- /dev/null
+++ b/docs/examples/4ee31fd4ea6d18f32ec28b7fa433441d.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/put-app-privileges.asciidoc:88
+
+[source, python]
+----
+resp = client.security.put_privileges(
+ privileges={
+ "myapp": {
+ "read": {
+ "actions": [
+ "data:read/*",
+ "action:login"
+ ],
+ "metadata": {
+ "description": "Read access to myapp"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4f08d9e21d9f199acc77abfb83287878.asciidoc b/docs/examples/4f08d9e21d9f199acc77abfb83287878.asciidoc
new file mode 100644
index 000000000..97db55509
--- /dev/null
+++ b/docs/examples/4f08d9e21d9f199acc77abfb83287878.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search-application/apis/search-application-search.asciidoc:125
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my-app",
+ params={
+ "query_string": "my first query",
+ "text_fields": [
+ {
+ "name": "title",
+ "boost": 5
+ },
+ {
+ "name": "description",
+ "boost": 1
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4f140d8922efdf3420e41b1cb669a289.asciidoc b/docs/examples/4f140d8922efdf3420e41b1cb669a289.asciidoc
new file mode 100644
index 000000000..1f5787c1c
--- /dev/null
+++ b/docs/examples/4f140d8922efdf3420e41b1cb669a289.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/delete-component-template.asciidoc:25
+
+[source, python]
+----
+resp = client.cluster.delete_component_template(
+ name="template_1",
+)
+print(resp)
+----
diff --git a/docs/examples/4f1e1205154d280db21fbd2754ed5398.asciidoc b/docs/examples/4f1e1205154d280db21fbd2754ed5398.asciidoc
index 305d4b18f..3df32bd61 100644
--- a/docs/examples/4f1e1205154d280db21fbd2754ed5398.asciidoc
+++ b/docs/examples/4f1e1205154d280db21fbd2754ed5398.asciidoc
@@ -1,20 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/aggregate-metric-double.asciidoc:114
[source, python]
----
resp = client.indices.create(
index="stats-index",
- body={
- "mappings": {
- "properties": {
- "agg_metric": {
- "type": "aggregate_metric_double",
- "metrics": ["min", "max", "sum", "value_count"],
- "default_metric": "max",
- }
+ mappings={
+ "properties": {
+ "agg_metric": {
+ "type": "aggregate_metric_double",
+ "metrics": [
+ "min",
+ "max",
+ "sum",
+ "value_count"
+ ],
+ "default_metric": "max"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4f3366fc26e7ea4de446dfa5cdec9683.asciidoc b/docs/examples/4f3366fc26e7ea4de446dfa5cdec9683.asciidoc
index cf42e9f4f..717f1d19d 100644
--- a/docs/examples/4f3366fc26e7ea4de446dfa5cdec9683.asciidoc
+++ b/docs/examples/4f3366fc26e7ea4de446dfa5cdec9683.asciidoc
@@ -1,22 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/function-score-query.asciidoc:380
[source, python]
----
resp = client.search(
- body={
- "query": {
- "function_score": {
- "gauss": {
- "@timestamp": {
- "origin": "2013-09-17",
- "scale": "10d",
- "offset": "5d",
- "decay": 0.5,
- }
+ query={
+ "function_score": {
+ "gauss": {
+ "@timestamp": {
+ "origin": "2013-09-17",
+ "scale": "10d",
+ "offset": "5d",
+ "decay": 0.5
}
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4f621ab694f62ddb89e0684a9e76c4d1.asciidoc b/docs/examples/4f621ab694f62ddb89e0684a9e76c4d1.asciidoc
new file mode 100644
index 000000000..8e43ea56c
--- /dev/null
+++ b/docs/examples/4f621ab694f62ddb89e0684a9e76c4d1.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:574
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ highlight={
+ "fields": {
+ "comment": {
+ "fragment_size": 150,
+ "number_of_fragments": 3
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4f666d710758578e2582850dac3ad144.asciidoc b/docs/examples/4f666d710758578e2582850dac3ad144.asciidoc
new file mode 100644
index 000000000..60e20c858
--- /dev/null
+++ b/docs/examples/4f666d710758578e2582850dac3ad144.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/update-user-profile-data.asciidoc:135
+
+[source, python]
+----
+resp = client.security.get_user_profile(
+ uid="u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0",
+ data="*",
+)
+print(resp)
+----
diff --git a/docs/examples/4f67b5f5c040f611bd2560a5d38ea6f5.asciidoc b/docs/examples/4f67b5f5c040f611bd2560a5d38ea6f5.asciidoc
new file mode 100644
index 000000000..5f19f543e
--- /dev/null
+++ b/docs/examples/4f67b5f5c040f611bd2560a5d38ea6f5.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/rare-terms-aggregation.asciidoc:331
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "genres": {
+ "rare_terms": {
+ "field": "genre",
+ "missing": "N/A"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4f792d86ff79dcfe4643cd95505f8d5f.asciidoc b/docs/examples/4f792d86ff79dcfe4643cd95505f8d5f.asciidoc
index 4551d8004..a9a72432f 100644
--- a/docs/examples/4f792d86ff79dcfe4643cd95505f8d5f.asciidoc
+++ b/docs/examples/4f792d86ff79dcfe4643cd95505f8d5f.asciidoc
@@ -1,23 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:661
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic": "runtime",
- "runtime": {
- "day_of_week": {
- "type": "keyword",
- "script": {
- "source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
- },
+ mappings={
+ "dynamic": "runtime",
+ "runtime": {
+ "day_of_week": {
+ "type": "keyword",
+ "script": {
+ "source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
}
- },
- "properties": {"@timestamp": {"type": "date"}},
+ }
+ },
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4f8a4ad49e2bca6784c88ede18a1a709.asciidoc b/docs/examples/4f8a4ad49e2bca6784c88ede18a1a709.asciidoc
new file mode 100644
index 000000000..c7576d78e
--- /dev/null
+++ b/docs/examples/4f8a4ad49e2bca6784c88ede18a1a709.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// licensing/delete-license.asciidoc:37
+
+[source, python]
+----
+resp = client.license.delete()
+print(resp)
+----
diff --git a/docs/examples/4fa9ee04188cbf0b38cfc28f6a56527d.asciidoc b/docs/examples/4fa9ee04188cbf0b38cfc28f6a56527d.asciidoc
new file mode 100644
index 000000000..ac9f9eb67
--- /dev/null
+++ b/docs/examples/4fa9ee04188cbf0b38cfc28f6a56527d.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-datafeed.asciidoc:74
+
+[source, python]
+----
+resp = client.ml.get_datafeeds(
+ datafeed_id="datafeed-high_sum_total_sales",
+)
+print(resp)
+----
diff --git a/docs/examples/4fb0629146ca78b85e823edd405497bb.asciidoc b/docs/examples/4fb0629146ca78b85e823edd405497bb.asciidoc
new file mode 100644
index 000000000..ce649ee73
--- /dev/null
+++ b/docs/examples/4fb0629146ca78b85e823edd405497bb.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/put-dfanalytics.asciidoc:908
+
+[source, python]
+----
+resp = client.ml.put_data_frame_analytics(
+ id="loan_classification",
+ source={
+ "index": "loan-applicants"
+ },
+ dest={
+ "index": "loan-applicants-classified"
+ },
+ analysis={
+ "classification": {
+ "dependent_variable": "label",
+ "training_percent": 75,
+ "num_top_classes": 2
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4fcca1687d7b2cf08de526539fea5a76.asciidoc b/docs/examples/4fcca1687d7b2cf08de526539fea5a76.asciidoc
new file mode 100644
index 000000000..49ed59db1
--- /dev/null
+++ b/docs/examples/4fcca1687d7b2cf08de526539fea5a76.asciidoc
@@ -0,0 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/text-expansion-query.asciidoc:112
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "bool": {
+ "should": [
+ {
+ "text_expansion": {
+ "ml.inference.title_expanded.predicted_value": {
+ "model_id": ".elser_model_2",
+ "model_text": "How is the weather in Jamaica?",
+ "boost": 1
+ }
+ }
+ },
+ {
+ "text_expansion": {
+ "ml.inference.description_expanded.predicted_value": {
+ "model_id": ".elser_model_2",
+ "model_text": "How is the weather in Jamaica?",
+ "boost": 1
+ }
+ }
+ },
+ {
+ "multi_match": {
+ "query": "How is the weather in Jamaica?",
+ "fields": [
+ "title",
+ "description"
+ ],
+ "boost": 4
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/4fe78a4dfb747fd5dc34145ec6b76183.asciidoc b/docs/examples/4fe78a4dfb747fd5dc34145ec6b76183.asciidoc
index d5f60c81c..ba1e66696 100644
--- a/docs/examples/4fe78a4dfb747fd5dc34145ec6b76183.asciidoc
+++ b/docs/examples/4fe78a4dfb747fd5dc34145ec6b76183.asciidoc
@@ -1,22 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:130
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "runtime": {
- "day_of_week": {
- "type": "keyword",
- "script": {
- "source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
- },
+ mappings={
+ "runtime": {
+ "day_of_week": {
+ "type": "keyword",
+ "script": {
+ "source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
}
- },
- "properties": {"@timestamp": {"type": "date"}},
+ }
+ },
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/4ff2dcec03fe097075cf1d174a019a1f.asciidoc b/docs/examples/4ff2dcec03fe097075cf1d174a019a1f.asciidoc
new file mode 100644
index 000000000..ed884ed78
--- /dev/null
+++ b/docs/examples/4ff2dcec03fe097075cf1d174a019a1f.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:709
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match_phrase": {
+ "message": "number 1"
+ }
+ },
+ highlight={
+ "fields": {
+ "message": {
+ "type": "plain",
+ "fragment_size": 15,
+ "number_of_fragments": 3,
+ "fragmenter": "simple"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/50096ee0ca53fe8a88450ebb2a50f285.asciidoc b/docs/examples/50096ee0ca53fe8a88450ebb2a50f285.asciidoc
new file mode 100644
index 000000000..b8154c4d0
--- /dev/null
+++ b/docs/examples/50096ee0ca53fe8a88450ebb2a50f285.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:143
+
+[source, python]
+----
+resp = client.sql.query(
+ format="csv",
+ delimiter=";",
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=5,
+)
+print(resp)
+----
diff --git a/docs/examples/5024c524a7db0d6bb44c1820007cc5f4.asciidoc b/docs/examples/5024c524a7db0d6bb44c1820007cc5f4.asciidoc
new file mode 100644
index 000000000..b91af443d
--- /dev/null
+++ b/docs/examples/5024c524a7db0d6bb44c1820007cc5f4.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/grok.asciidoc:39
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "description": "...",
+ "processors": [
+ {
+ "grok": {
+ "field": "message",
+ "patterns": [
+ "%{IP:client} %{WORD:method} %{URIPATHPARAM:request} %{NUMBER:bytes:int} %{NUMBER:duration:double}"
+ ]
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_source": {
+ "message": "55.3.244.1 GET /index.html 15824 0.043"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/50522d3d5b3d055f712ad737e3d1707a.asciidoc b/docs/examples/50522d3d5b3d055f712ad737e3d1707a.asciidoc
index 9cf7f2175..646e9e26a 100644
--- a/docs/examples/50522d3d5b3d055f712ad737e3d1707a.asciidoc
+++ b/docs/examples/50522d3d5b3d055f712ad737e3d1707a.asciidoc
@@ -1,20 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/token-count.asciidoc:14
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "name": {
- "type": "text",
- "fields": {
- "length": {
- "type": "token_count",
- "analyzer": "standard",
- }
- },
+ mappings={
+ "properties": {
+ "name": {
+ "type": "text",
+ "fields": {
+ "length": {
+ "type": "token_count",
+ "analyzer": "standard"
+ }
}
}
}
@@ -22,23 +21,31 @@ resp = client.indices.create(
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"name": "John Smith"},
+ document={
+ "name": "John Smith"
+ },
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="my-index-000001",
id="2",
- body={"name": "Rachel Alice Williams"},
+ document={
+ "name": "Rachel Alice Williams"
+ },
)
-print(resp)
+print(resp2)
-resp = client.search(
+resp3 = client.search(
index="my-index-000001",
- body={"query": {"term": {"name.length": 3}}},
+ query={
+ "term": {
+ "name.length": 3
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp3)
+----
diff --git a/docs/examples/505a6c21a4cb608d3662fab1a35eb6df.asciidoc b/docs/examples/505a6c21a4cb608d3662fab1a35eb6df.asciidoc
new file mode 100644
index 000000000..7b88355e5
--- /dev/null
+++ b/docs/examples/505a6c21a4cb608d3662fab1a35eb6df.asciidoc
@@ -0,0 +1,59 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/doc-count-field.asciidoc:54
+
+[source, python]
+----
+resp = client.index(
+ index="my_index",
+ id="1",
+ document={
+ "my_text": "histogram_1",
+ "my_histogram": {
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 3,
+ 7,
+ 23,
+ 12,
+ 6
+ ]
+ },
+ "_doc_count": 45
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my_index",
+ id="2",
+ document={
+ "my_text": "histogram_2",
+ "my_histogram": {
+ "values": [
+ 0.1,
+ 0.25,
+ 0.35,
+ 0.4,
+ 0.45,
+ 0.5
+ ],
+ "counts": [
+ 8,
+ 17,
+ 8,
+ 7,
+ 6,
+ 2
+ ]
+ },
+ "_doc_count": 62
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/50764f4ea88079156b0aff2835bcdc45.asciidoc b/docs/examples/50764f4ea88079156b0aff2835bcdc45.asciidoc
new file mode 100644
index 000000000..bf0c933a0
--- /dev/null
+++ b/docs/examples/50764f4ea88079156b0aff2835bcdc45.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:221
+
+[source, python]
+----
+resp = client.cluster.state(
+ metric="metadata",
+ pretty=True,
+ filter_path="metadata.stored_scripts",
+)
+print(resp)
+----
diff --git a/docs/examples/5093bfd281dbe41bd0dba8ff979e6e47.asciidoc b/docs/examples/5093bfd281dbe41bd0dba8ff979e6e47.asciidoc
new file mode 100644
index 000000000..1dfd1c859
--- /dev/null
+++ b/docs/examples/5093bfd281dbe41bd0dba8ff979e6e47.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/apis/get-stored-script-api.asciidoc:24
+
+[source, python]
+----
+resp = client.get_script(
+ id="my-stored-script",
+)
+print(resp)
+----
diff --git a/docs/examples/50a9623c153cabe64101efb633e10e6c.asciidoc b/docs/examples/50a9623c153cabe64101efb633e10e6c.asciidoc
new file mode 100644
index 000000000..b84d11c31
--- /dev/null
+++ b/docs/examples/50a9623c153cabe64101efb633e10e6c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/apis/delete-autoscaling-policy.asciidoc:31
+
+[source, python]
+----
+resp = client.autoscaling.delete_autoscaling_policy(
+ name="",
+)
+print(resp)
+----
diff --git a/docs/examples/50b5c0332949d2154c72b629b5fa6222.asciidoc b/docs/examples/50b5c0332949d2154c72b629b5fa6222.asciidoc
index 0d320d06e..0922defcd 100644
--- a/docs/examples/50b5c0332949d2154c72b629b5fa6222.asciidoc
+++ b/docs/examples/50b5c0332949d2154c72b629b5fa6222.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:339
[source, python]
@@ -5,14 +6,18 @@
resp = client.index(
index="my-index-000001",
refresh="wait_for",
- body={"user_id": 12345},
+ document={
+ "user_id": 12345
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
refresh="wait_for",
- body={"user_id": 12346},
+ document={
+ "user_id": 12346
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/50c2b06ecddb5a4aebd8b78e38af5f1f.asciidoc b/docs/examples/50c2b06ecddb5a4aebd8b78e38af5f1f.asciidoc
new file mode 100644
index 000000000..cae08f019
--- /dev/null
+++ b/docs/examples/50c2b06ecddb5a4aebd8b78e38af5f1f.asciidoc
@@ -0,0 +1,54 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-a-data-stream.asciidoc:55
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my-lifecycle-policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_primary_shard_size": "50gb"
+ }
+ }
+ },
+ "warm": {
+ "min_age": "30d",
+ "actions": {
+ "shrink": {
+ "number_of_shards": 1
+ },
+ "forcemerge": {
+ "max_num_segments": 1
+ }
+ }
+ },
+ "cold": {
+ "min_age": "60d",
+ "actions": {
+ "searchable_snapshot": {
+ "snapshot_repository": "found-snapshots"
+ }
+ }
+ },
+ "frozen": {
+ "min_age": "90d",
+ "actions": {
+ "searchable_snapshot": {
+ "snapshot_repository": "found-snapshots"
+ }
+ }
+ },
+ "delete": {
+ "min_age": "735d",
+ "actions": {
+ "delete": {}
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/50c2cea2adbe9523458c2686ab11df54.asciidoc b/docs/examples/50c2cea2adbe9523458c2686ab11df54.asciidoc
new file mode 100644
index 000000000..2074e06c8
--- /dev/null
+++ b/docs/examples/50c2cea2adbe9523458c2686ab11df54.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/delimited-payload-tokenfilter.asciidoc:206
+
+[source, python]
+----
+resp = client.indices.create(
+ index="text_payloads",
+ mappings={
+ "properties": {
+ "text": {
+ "type": "text",
+ "term_vector": "with_positions_payloads",
+ "analyzer": "payload_delimiter"
+ }
+ }
+ },
+ settings={
+ "analysis": {
+ "analyzer": {
+ "payload_delimiter": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "delimited_payload"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/50d5c5b7e8ed9a95b8d9a25a32a77425.asciidoc b/docs/examples/50d5c5b7e8ed9a95b8d9a25a32a77425.asciidoc
new file mode 100644
index 000000000..df67b3bd8
--- /dev/null
+++ b/docs/examples/50d5c5b7e8ed9a95b8d9a25a32a77425.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/unique-tokenfilter.asciidoc:26
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "unique"
+ ],
+ text="the quick fox jumps the lazy fox",
+)
+print(resp)
+----
diff --git a/docs/examples/50d9c0508ddb0fc5ba5a893eec219dd8.asciidoc b/docs/examples/50d9c0508ddb0fc5ba5a893eec219dd8.asciidoc
new file mode 100644
index 000000000..13c958321
--- /dev/null
+++ b/docs/examples/50d9c0508ddb0fc5ba5a893eec219dd8.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/synthetic-source.asciidoc:125
+
+[source, python]
+----
+resp = client.index(
+ index="idx",
+ id="1",
+ document={
+ "foo.bar.baz": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/50dc35d3d8705bd62aed20a15209476c.asciidoc b/docs/examples/50dc35d3d8705bd62aed20a15209476c.asciidoc
new file mode 100644
index 000000000..a51c7d773
--- /dev/null
+++ b/docs/examples/50dc35d3d8705bd62aed20a15209476c.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-role-mappings.asciidoc:358
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="mapping9",
+ rules={
+ "field": {
+ "realm.name": "cloud-saml"
+ }
+ },
+ role_templates=[
+ {
+ "template": {
+ "source": "saml_user"
+ }
+ },
+ {
+ "template": {
+ "source": "_user_{{username}}"
+ }
+ }
+ ],
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/50ddf374cfa8128538ea092ee98b723d.asciidoc b/docs/examples/50ddf374cfa8128538ea092ee98b723d.asciidoc
new file mode 100644
index 000000000..e5951558a
--- /dev/null
+++ b/docs/examples/50ddf374cfa8128538ea092ee98b723d.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/task-queue-backlog.asciidoc:45
+
+[source, python]
+----
+resp = client.tasks.list(
+ filter_path="nodes.*.tasks",
+)
+print(resp)
+----
diff --git a/docs/examples/50f922e9f002d8ac570953be59414b7b.asciidoc b/docs/examples/50f922e9f002d8ac570953be59414b7b.asciidoc
new file mode 100644
index 000000000..560c917c3
--- /dev/null
+++ b/docs/examples/50f922e9f002d8ac570953be59414b7b.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/combined-fields-query.asciidoc:156
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "combined_fields": {
+ "query": "database systems",
+ "fields": [
+ "title",
+ "abstract"
+ ],
+ "operator": "and"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/511e5bb8ab881171b7e8629095e30b85.asciidoc b/docs/examples/511e5bb8ab881171b7e8629095e30b85.asciidoc
new file mode 100644
index 000000000..f99c9de99
--- /dev/null
+++ b/docs/examples/511e5bb8ab881171b7e8629095e30b85.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-ilm.asciidoc:417
+
+[source, python]
+----
+resp = client.search(
+ index="datastream",
+)
+print(resp)
+----
diff --git a/docs/examples/51390ca10aa22d7104e8970f09ea4512.asciidoc b/docs/examples/51390ca10aa22d7104e8970f09ea4512.asciidoc
index eee2970dd..83ee3f394 100644
--- a/docs/examples/51390ca10aa22d7104e8970f09ea4512.asciidoc
+++ b/docs/examples/51390ca10aa22d7104e8970f09ea4512.asciidoc
@@ -1,24 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/binary.asciidoc:68
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {
- "binary": {"type": "binary", "doc_values": True}
- },
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "binary": {
+ "type": "binary",
+ "doc_values": True
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"binary": ["IAA=", "EAA="]},
+ document={
+ "binary": [
+ "IAA=",
+ "EAA="
+ ]
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/515e1104d136082e826d1b32af011759.asciidoc b/docs/examples/515e1104d136082e826d1b32af011759.asciidoc
new file mode 100644
index 000000000..4d316fb8a
--- /dev/null
+++ b/docs/examples/515e1104d136082e826d1b32af011759.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/nested-aggregation.asciidoc:38
+
+[source, python]
+----
+resp = client.index(
+ index="products",
+ id="0",
+ refresh=True,
+ document={
+ "name": "LED TV",
+ "resellers": [
+ {
+ "reseller": "companyA",
+ "price": 350
+ },
+ {
+ "reseller": "companyB",
+ "price": 500
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5174c3c731fc1703e5b43ae2bae7a80e.asciidoc b/docs/examples/5174c3c731fc1703e5b43ae2bae7a80e.asciidoc
new file mode 100644
index 000000000..4488c4343
--- /dev/null
+++ b/docs/examples/5174c3c731fc1703e5b43ae2bae7a80e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/apis/clear-sql-cursor-api.asciidoc:23
+
+[source, python]
+----
+resp = client.sql.clear_cursor(
+ cursor="sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=",
+)
+print(resp)
+----
diff --git a/docs/examples/517d291044c3e4448b8804322616ab4a.asciidoc b/docs/examples/517d291044c3e4448b8804322616ab4a.asciidoc
new file mode 100644
index 000000000..4fc02a67c
--- /dev/null
+++ b/docs/examples/517d291044c3e4448b8804322616ab4a.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc:41
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="elser_embeddings",
+ processors=[
+ {
+ "inference": {
+ "model_id": "elser_embeddings",
+ "input_output": {
+ "input_field": "content",
+ "output_field": "content_embedding"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/518fcf1dc1edd7dba0864accf71b49f4.asciidoc b/docs/examples/518fcf1dc1edd7dba0864accf71b49f4.asciidoc
new file mode 100644
index 000000000..c7f267361
--- /dev/null
+++ b/docs/examples/518fcf1dc1edd7dba0864accf71b49f4.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-shard-routing.asciidoc:48
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ preference="_local",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5195a88194f7a139c635a84398d76205.asciidoc b/docs/examples/5195a88194f7a139c635a84398d76205.asciidoc
new file mode 100644
index 000000000..812b30e06
--- /dev/null
+++ b/docs/examples/5195a88194f7a139c635a84398d76205.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/restore-snapshot-api.asciidoc:54
+
+[source, python]
+----
+resp = client.snapshot.restore(
+ repository="my_repository",
+ snapshot="my_snapshot",
+)
+print(resp)
+----
diff --git a/docs/examples/51b40610ae05730b4c6afd25647d7ae0.asciidoc b/docs/examples/51b40610ae05730b4c6afd25647d7ae0.asciidoc
index 795f65b00..b47accd69 100644
--- a/docs/examples/51b40610ae05730b4c6afd25647d7ae0.asciidoc
+++ b/docs/examples/51b40610ae05730b4c6afd25647d7ae0.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:489
[source, python]
@@ -5,33 +6,35 @@
resp = client.index(
index="my-index-000001",
id="1",
- refresh="true",
- body={"date": "2015-10-01T05:30:00Z"},
+ refresh=True,
+ document={
+ "date": "2015-10-01T05:30:00Z"
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="2",
- refresh="true",
- body={"date": "2015-10-01T06:30:00Z"},
+ refresh=True,
+ document={
+ "date": "2015-10-01T06:30:00Z"
+ },
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
size="0",
- body={
- "aggs": {
- "by_day": {
- "date_histogram": {
- "field": "date",
- "calendar_interval": "day",
- "offset": "+6h",
- }
+ aggs={
+ "by_day": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "day",
+ "offset": "+6h"
}
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/51b44224feee6e2e5974824334474c77.asciidoc b/docs/examples/51b44224feee6e2e5974824334474c77.asciidoc
new file mode 100644
index 000000000..a8a8584b8
--- /dev/null
+++ b/docs/examples/51b44224feee6e2e5974824334474c77.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/repository-s3.asciidoc:333
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_s3_repository",
+ repository={
+ "type": "s3",
+ "settings": {
+ "client": "my-client",
+ "bucket": "my-bucket",
+ "endpoint": "my.s3.endpoint"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/51f1a0930362594b231a5bcc17673768.asciidoc b/docs/examples/51f1a0930362594b231a5bcc17673768.asciidoc
new file mode 100644
index 000000000..0950c1dee
--- /dev/null
+++ b/docs/examples/51f1a0930362594b231a5bcc17673768.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/modify-data-streams-api.asciidoc:11
+
+[source, python]
+----
+resp = client.indices.modify_data_stream(
+ actions=[
+ {
+ "remove_backing_index": {
+ "data_stream": "my-logs",
+ "index": ".ds-my-logs-2099.01.01-000001"
+ }
+ },
+ {
+ "add_backing_index": {
+ "data_stream": "my-logs",
+ "index": "index-to-add"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/51f6cb682424e110f289af79c106f4c7.asciidoc b/docs/examples/51f6cb682424e110f289af79c106f4c7.asciidoc
new file mode 100644
index 000000000..54d35a87f
--- /dev/null
+++ b/docs/examples/51f6cb682424e110f289af79c106f4c7.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/troubleshooting-shards-capacity.asciidoc:401
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.max_shards_per_node.frozen": 3200
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5203560189ccab7122c03500147701ef.asciidoc b/docs/examples/5203560189ccab7122c03500147701ef.asciidoc
deleted file mode 100644
index 412284e48..000000000
--- a/docs/examples/5203560189ccab7122c03500147701ef.asciidoc
+++ /dev/null
@@ -1,6 +0,0 @@
-// aggregations/bucket/datehistogram-aggregation.asciidoc:569
-
-[source, python]
-----
-
-----
\ No newline at end of file
diff --git a/docs/examples/5275842787967b6db876025f4a1c6942.asciidoc b/docs/examples/5275842787967b6db876025f4a1c6942.asciidoc
index 20106e870..679b69a09 100644
--- a/docs/examples/5275842787967b6db876025f4a1c6942.asciidoc
+++ b/docs/examples/5275842787967b6db876025f4a1c6942.asciidoc
@@ -1,15 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
// search/suggesters.asciidoc:122
[source, python]
----
resp = client.search(
- body={
- "suggest": {
- "text": "tring out Elasticsearch",
- "my-suggest-1": {"term": {"field": "message"}},
- "my-suggest-2": {"term": {"field": "user"}},
+ suggest={
+ "text": "tring out Elasticsearch",
+ "my-suggest-1": {
+ "term": {
+ "field": "message"
+ }
+ },
+ "my-suggest-2": {
+ "term": {
+ "field": "user"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5276a831513623e43ed567eb52b6dba9.asciidoc b/docs/examples/5276a831513623e43ed567eb52b6dba9.asciidoc
new file mode 100644
index 000000000..b395c9666
--- /dev/null
+++ b/docs/examples/5276a831513623e43ed567eb52b6dba9.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-shard-routing.asciidoc:109
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ routing="my-routing-value",
+ document={
+ "@timestamp": "2099-11-15T13:12:00",
+ "message": "GET /search HTTP/1.1 200 1070000",
+ "user": {
+ "id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/528e5f1c345c3769248cc6889e8cf552.asciidoc b/docs/examples/528e5f1c345c3769248cc6889e8cf552.asciidoc
index 8e249cd55..6c7ff8f6f 100644
--- a/docs/examples/528e5f1c345c3769248cc6889e8cf552.asciidoc
+++ b/docs/examples/528e5f1c345c3769248cc6889e8cf552.asciidoc
@@ -1,14 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/similarity.asciidoc:45
[source, python]
----
resp = client.indices.put_mapping(
index="index",
- body={
- "properties": {
- "title": {"type": "text", "similarity": "my_similarity"}
+ properties={
+ "title": {
+ "type": "text",
+ "similarity": "my_similarity"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/529b975b7cedaac58dce9821956adc37.asciidoc b/docs/examples/529b975b7cedaac58dce9821956adc37.asciidoc
index fd6388a57..a44149598 100644
--- a/docs/examples/529b975b7cedaac58dce9821956adc37.asciidoc
+++ b/docs/examples/529b975b7cedaac58dce9821956adc37.asciidoc
@@ -1,27 +1,87 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:391
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "MultiPolygon",
"coordinates": [
- [[[102, 2], [103, 2], [103, 3], [102, 3], [102, 2]]],
[
- [[100, 0], [101, 0], [101, 1], [100, 1], [100, 0]],
[
- [100.2, 0.2],
- [100.8, 0.2],
- [100.8, 0.8],
- [100.2, 0.8],
- [100.2, 0.2],
- ],
+ [
+ 102,
+ 2
+ ],
+ [
+ 103,
+ 2
+ ],
+ [
+ 103,
+ 3
+ ],
+ [
+ 102,
+ 3
+ ],
+ [
+ 102,
+ 2
+ ]
+ ]
],
- ],
+ [
+ [
+ [
+ 100,
+ 0
+ ],
+ [
+ 101,
+ 0
+ ],
+ [
+ 101,
+ 1
+ ],
+ [
+ 100,
+ 1
+ ],
+ [
+ 100,
+ 0
+ ]
+ ],
+ [
+ [
+ 100.2,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.8
+ ],
+ [
+ 100.2,
+ 0.8
+ ],
+ [
+ 100.2,
+ 0.2
+ ]
+ ]
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/52a2d119addb15366a935115518335fd.asciidoc b/docs/examples/52a2d119addb15366a935115518335fd.asciidoc
new file mode 100644
index 000000000..2ee9ea4c7
--- /dev/null
+++ b/docs/examples/52a2d119addb15366a935115518335fd.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/shrink-index.asciidoc:46
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my_source_index",
+ settings={
+ "settings": {
+ "index.number_of_replicas": 0,
+ "index.routing.allocation.require._name": "shrink_node_name"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/52b71aa4ae6563abae78cd20ff06d1e9.asciidoc b/docs/examples/52b71aa4ae6563abae78cd20ff06d1e9.asciidoc
new file mode 100644
index 000000000..8121426ba
--- /dev/null
+++ b/docs/examples/52b71aa4ae6563abae78cd20ff06d1e9.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/hotspotting.asciidoc:142
+
+[source, python]
+----
+resp = client.nodes.stats(
+ human=True,
+ filter_path="nodes.*.name,nodes.*.indices.indexing",
+)
+print(resp)
+----
diff --git a/docs/examples/52bc577a0d0cd42b46f33e0ef5124df8.asciidoc b/docs/examples/52bc577a0d0cd42b46f33e0ef5124df8.asciidoc
new file mode 100644
index 000000000..5b1bec364
--- /dev/null
+++ b/docs/examples/52bc577a0d0cd42b46f33e0ef5124df8.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:644
+
+[source, python]
+----
+resp = client.put_script(
+ id="my-search-template",
+ script={
+ "lang": "mustache",
+ "source": {
+ "query": {
+ "match": {
+ "message": "{{query_string}}"
+ }
+ },
+ "from": "{{from}}",
+ "size": "{{size}}"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/52be795b68e6ef3f396f35fea52d0481.asciidoc b/docs/examples/52be795b68e6ef3f396f35fea52d0481.asciidoc
new file mode 100644
index 000000000..aec06f520
--- /dev/null
+++ b/docs/examples/52be795b68e6ef3f396f35fea52d0481.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/detect-threats-with-eql.asciidoc:51
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my-data-stream-template",
+ index_patterns=[
+ "my-data-stream*"
+ ],
+ data_stream={},
+ priority=500,
+)
+print(resp)
+----
diff --git a/docs/examples/52c2b4c180388f5ae044588ba70b70f0.asciidoc b/docs/examples/52c2b4c180388f5ae044588ba70b70f0.asciidoc
new file mode 100644
index 000000000..0a7997675
--- /dev/null
+++ b/docs/examples/52c2b4c180388f5ae044588ba70b70f0.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/knn-query.asciidoc:172
+
+[source, python]
+----
+resp = client.search(
+ index="my-image-index",
+ size=10,
+ query={
+ "bool": {
+ "must": {
+ "knn": {
+ "field": "image-vector",
+ "query_vector": [
+ -5,
+ 9,
+ -12
+ ],
+ "k": 3
+ }
+ },
+ "filter": {
+ "term": {
+ "file-type": "png"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/52c7e4172a446c394210a07c464c57d2.asciidoc b/docs/examples/52c7e4172a446c394210a07c464c57d2.asciidoc
index 431168efb..1fe38bcd9 100644
--- a/docs/examples/52c7e4172a446c394210a07c464c57d2.asciidoc
+++ b/docs/examples/52c7e4172a446c394210a07c464c57d2.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:606
[source, python]
@@ -7,4 +8,4 @@ resp = client.delete_by_query_rethrottle(
requests_per_second="-1",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/52cdb5526ce69d0223d1dd198308bfea.asciidoc b/docs/examples/52cdb5526ce69d0223d1dd198308bfea.asciidoc
new file mode 100644
index 000000000..0fb446fba
--- /dev/null
+++ b/docs/examples/52cdb5526ce69d0223d1dd198308bfea.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/dynamic.asciidoc:53
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "dynamic": False,
+ "properties": {
+ "user": {
+ "properties": {
+ "name": {
+ "type": "text"
+ },
+ "social_networks": {
+ "dynamic": True,
+ "properties": {}
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/52f1c1689ab35353858cdeaab7597546.asciidoc b/docs/examples/52f1c1689ab35353858cdeaab7597546.asciidoc
new file mode 100644
index 000000000..cd29eaa7d
--- /dev/null
+++ b/docs/examples/52f1c1689ab35353858cdeaab7597546.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/common-log-format-example.asciidoc:174
+
+[source, python]
+----
+resp = client.index(
+ index="my-data-stream",
+ pipeline="my-pipeline",
+ document={
+ "message": "89.160.20.128 - - [05/May/2099:16:21:15 +0000] \"GET /favicon.ico HTTP/1.1\" 200 3638 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36\""
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/52fd112e970882c4d7cc4b0cca8e2c6f.asciidoc b/docs/examples/52fd112e970882c4d7cc4b0cca8e2c6f.asciidoc
index 395ee4537..e46423564 100644
--- a/docs/examples/52fd112e970882c4d7cc4b0cca8e2c6f.asciidoc
+++ b/docs/examples/52fd112e970882c4d7cc4b0cca8e2c6f.asciidoc
@@ -1,18 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/numeric.asciidoc:23
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "number_of_bytes": {"type": "integer"},
- "time_in_seconds": {"type": "float"},
- "price": {"type": "scaled_float", "scaling_factor": 100},
+ mappings={
+ "properties": {
+ "number_of_bytes": {
+ "type": "integer"
+ },
+ "time_in_seconds": {
+ "type": "float"
+ },
+ "price": {
+ "type": "scaled_float",
+ "scaling_factor": 100
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5302f4f2bcc0f400ff71c791e6f68d7b.asciidoc b/docs/examples/5302f4f2bcc0f400ff71c791e6f68d7b.asciidoc
new file mode 100644
index 000000000..4f0d0fc2a
--- /dev/null
+++ b/docs/examples/5302f4f2bcc0f400ff71c791e6f68d7b.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keyword-marker-tokenfilter.asciidoc:95
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ {
+ "type": "keyword_marker",
+ "keywords": [
+ "jumping"
+ ]
+ },
+ "stemmer"
+ ],
+ text="fox running and jumping",
+)
+print(resp)
+----
diff --git a/docs/examples/5305bc07c1bf90bab3e8db1de3e31b26.asciidoc b/docs/examples/5305bc07c1bf90bab3e8db1de3e31b26.asciidoc
new file mode 100644
index 000000000..4458a453d
--- /dev/null
+++ b/docs/examples/5305bc07c1bf90bab3e8db1de3e31b26.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// shutdown/apis/shutdown-put.asciidoc:96
+
+[source, python]
+----
+resp = client.shutdown.put_node(
+ node_id="USpTGYaBSIKbgSUJR2Z9lg",
+ type="restart",
+ reason="Demonstrating how the node shutdown API works",
+ allocation_delay="20m",
+)
+print(resp)
+----
diff --git a/docs/examples/532ddf9afdcd0b1c9c0bb331e74d8df3.asciidoc b/docs/examples/532ddf9afdcd0b1c9c0bb331e74d8df3.asciidoc
new file mode 100644
index 000000000..d42b38962
--- /dev/null
+++ b/docs/examples/532ddf9afdcd0b1c9c0bb331e74d8df3.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:156
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index_long",
+ mappings={
+ "properties": {
+ "field": {
+ "type": "long"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/532f371934b61fb4992d37bedcc085de.asciidoc b/docs/examples/532f371934b61fb4992d37bedcc085de.asciidoc
new file mode 100644
index 000000000..dab4d1e81
--- /dev/null
+++ b/docs/examples/532f371934b61fb4992d37bedcc085de.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// shutdown/apis/shutdown-get.asciidoc:49
+
+[source, python]
+----
+resp = client.shutdown.put_node(
+ node_id="USpTGYaBSIKbgSUJR2Z9lg",
+ type="restart",
+ reason="Demonstrating how the node shutdown API works",
+ allocation_delay="10m",
+)
+print(resp)
+----
diff --git a/docs/examples/5330191ec9f11281ebf6867bf11c58ae.asciidoc b/docs/examples/5330191ec9f11281ebf6867bf11c58ae.asciidoc
index 57ab4c2e7..d6c1a6599 100644
--- a/docs/examples/5330191ec9f11281ebf6867bf11c58ae.asciidoc
+++ b/docs/examples/5330191ec9f11281ebf6867bf11c58ae.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:394
[source, python]
@@ -5,7 +6,13 @@
resp = client.delete_by_query(
index="my-index-000001",
routing="1",
- body={"query": {"range": {"age": {"gte": 10}}}},
+ query={
+ "range": {
+ "age": {
+ "gte": 10
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/533087d787b48878a0bf3fa8d0851b64.asciidoc b/docs/examples/533087d787b48878a0bf3fa8d0851b64.asciidoc
new file mode 100644
index 000000000..ee9fdaefd
--- /dev/null
+++ b/docs/examples/533087d787b48878a0bf3fa8d0851b64.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/delete-geoip-database.asciidoc:52
+
+[source, python]
+----
+resp = client.perform_request(
+ "DELETE",
+ "/_ingest/geoip/database/example-database-id",
+)
+print(resp)
+----
diff --git a/docs/examples/5332c4cca5fbb45cc700dcd34f37bc38.asciidoc b/docs/examples/5332c4cca5fbb45cc700dcd34f37bc38.asciidoc
index 2c1ec87f1..c1cdcb1ce 100644
--- a/docs/examples/5332c4cca5fbb45cc700dcd34f37bc38.asciidoc
+++ b/docs/examples/5332c4cca5fbb45cc700dcd34f37bc38.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:557
[source, python]
@@ -5,7 +6,10 @@
resp = client.index(
index="my-index-000001",
id="1",
- body={"english": "Some English text", "count": 5},
+ document={
+ "english": "Some English text",
+ "count": 5
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/53aa8b21e2b1c4d48960343711296704.asciidoc b/docs/examples/53aa8b21e2b1c4d48960343711296704.asciidoc
new file mode 100644
index 000000000..4ea9806b5
--- /dev/null
+++ b/docs/examples/53aa8b21e2b1c4d48960343711296704.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/regexp-syntax.asciidoc:60
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "regexp": {
+ "my_field.keyword": "a\\\\.*"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/53b908c3432118c5a6e460f74d32006b.asciidoc b/docs/examples/53b908c3432118c5a6e460f74d32006b.asciidoc
index 1496312bd..7b11b477c 100644
--- a/docs/examples/53b908c3432118c5a6e460f74d32006b.asciidoc
+++ b/docs/examples/53b908c3432118c5a6e460f74d32006b.asciidoc
@@ -1,16 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:11
[source, python]
----
resp = client.search(
- body={
- "query": {
- "multi_match": {
- "query": "this is a test",
- "fields": ["subject", "message"],
- }
+ query={
+ "multi_match": {
+ "query": "this is a test",
+ "fields": [
+ "subject",
+ "message"
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/53bb7f0e3429861aadb8dd3d588085cd.asciidoc b/docs/examples/53bb7f0e3429861aadb8dd3d588085cd.asciidoc
new file mode 100644
index 000000000..c329bd21d
--- /dev/null
+++ b/docs/examples/53bb7f0e3429861aadb8dd3d588085cd.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:272
+
+[source, python]
+----
+resp = client.search(
+ index="my-data-stream",
+ seq_no_primary_term=True,
+ query={
+ "match": {
+ "user.id": "yWIumJd7"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/53c6256295111524d5ff2885bdcb99a9.asciidoc b/docs/examples/53c6256295111524d5ff2885bdcb99a9.asciidoc
new file mode 100644
index 000000000..f59be3554
--- /dev/null
+++ b/docs/examples/53c6256295111524d5ff2885bdcb99a9.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/get-transform-stats.asciidoc:322
+
+[source, python]
+----
+resp = client.transform.get_transform(
+ transform_id="_stats",
+ from_="5",
+ size="10",
+)
+print(resp)
+----
diff --git a/docs/examples/53e4ac5a4009fd21024f4b31e54aa83f.asciidoc b/docs/examples/53e4ac5a4009fd21024f4b31e54aa83f.asciidoc
new file mode 100644
index 000000000..f95a82ec0
--- /dev/null
+++ b/docs/examples/53e4ac5a4009fd21024f4b31e54aa83f.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/oidc-guide.asciidoc:619
+
+[source, python]
+----
+resp = client.security.put_user(
+ username="facilitator",
+ password="",
+ roles=[
+ "facilitator-role"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/54059961f05904368ced52c894a50e23.asciidoc b/docs/examples/54059961f05904368ced52c894a50e23.asciidoc
new file mode 100644
index 000000000..8508fd3ac
--- /dev/null
+++ b/docs/examples/54059961f05904368ced52c894a50e23.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/movfn-aggregation.asciidoc:214
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "the_moving_max": {
+ "moving_fn": {
+ "buckets_path": "the_sum",
+ "window": 10,
+ "script": "MovingFunctions.max(values)"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/540aefc39303c925a4efff71ebe2f002.asciidoc b/docs/examples/540aefc39303c925a4efff71ebe2f002.asciidoc
new file mode 100644
index 000000000..e77238829
--- /dev/null
+++ b/docs/examples/540aefc39303c925a4efff71ebe2f002.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significantterms-aggregation.asciidoc:560
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "tags": {
+ "significant_terms": {
+ "field": "tag",
+ "min_doc_count": 10
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5433bb83628cc91d81fbe53c533b2a09.asciidoc b/docs/examples/5433bb83628cc91d81fbe53c533b2a09.asciidoc
new file mode 100644
index 000000000..1f6d73d93
--- /dev/null
+++ b/docs/examples/5433bb83628cc91d81fbe53c533b2a09.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/asciifolding-tokenfilter.asciidoc:83
+
+[source, python]
+----
+resp = client.indices.create(
+ index="asciifold_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_asciifolding": {
+ "tokenizer": "standard",
+ "filter": [
+ "asciifolding"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5457c94f0039c6b95c7f9f305d0c6b58.asciidoc b/docs/examples/5457c94f0039c6b95c7f9f305d0c6b58.asciidoc
new file mode 100644
index 000000000..751f84242
--- /dev/null
+++ b/docs/examples/5457c94f0039c6b95c7f9f305d0c6b58.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/nodes-stats.asciidoc:2384
+
+[source, python]
+----
+resp = client.nodes.stats(
+ metric="indices",
+)
+print(resp)
+
+resp1 = client.nodes.stats(
+ metric="os,process",
+)
+print(resp1)
+
+resp2 = client.nodes.stats(
+ node_id="10.0.0.1",
+ metric="process",
+)
+print(resp2)
+----
diff --git a/docs/examples/548b85bd9e6e7d33e36133953869449b.asciidoc b/docs/examples/548b85bd9e6e7d33e36133953869449b.asciidoc
new file mode 100644
index 000000000..6e436ef2e
--- /dev/null
+++ b/docs/examples/548b85bd9e6e7d33e36133953869449b.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:338
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "xpack.monitoring.collection.enabled": False
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/54a215d242ab65123b09e9dfb71bcbbf.asciidoc b/docs/examples/54a215d242ab65123b09e9dfb71bcbbf.asciidoc
index 96f693a65..882c0598f 100644
--- a/docs/examples/54a215d242ab65123b09e9dfb71bcbbf.asciidoc
+++ b/docs/examples/54a215d242ab65123b09e9dfb71bcbbf.asciidoc
@@ -1,15 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:237
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "genres": {
- "terms": {"field": "genre", "order": {"_key": "asc"}}
+ aggs={
+ "genres": {
+ "terms": {
+ "field": "genre",
+ "order": {
+ "_key": "asc"
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/55096381f811388fafd8e244dd2402c8.asciidoc b/docs/examples/55096381f811388fafd8e244dd2402c8.asciidoc
new file mode 100644
index 000000000..e460dfbb5
--- /dev/null
+++ b/docs/examples/55096381f811388fafd8e244dd2402c8.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/rollover-index.asciidoc:445
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="my-alias",
+ settings={
+ "index.number_of_shards": 2
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/553904c175a76d5ba83bc5d46fff7373.asciidoc b/docs/examples/553904c175a76d5ba83bc5d46fff7373.asciidoc
new file mode 100644
index 000000000..e793c6ce7
--- /dev/null
+++ b/docs/examples/553904c175a76d5ba83bc5d46fff7373.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/saml-guide.asciidoc:1031
+
+[source, python]
+----
+resp = client.security.saml_logout(
+ token="46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3",
+ refresh_token="mJdXLtmvTUSpoLwMvdBt_w",
+)
+print(resp)
+----
diff --git a/docs/examples/553d79817bb1333970e99507c37a159a.asciidoc b/docs/examples/553d79817bb1333970e99507c37a159a.asciidoc
index 2862caa9e..86245a2f5 100644
--- a/docs/examples/553d79817bb1333970e99507c37a159a.asciidoc
+++ b/docs/examples/553d79817bb1333970e99507c37a159a.asciidoc
@@ -1,14 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/similarity.asciidoc:520
[source, python]
----
resp = client.indices.create(
index="index",
- body={
- "settings": {
- "index": {"similarity": {"default": {"type": "boolean"}}}
+ settings={
+ "index": {
+ "similarity": {
+ "default": {
+ "type": "boolean"
+ }
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5553cf7a02c22f616cd994747f2dd5a5.asciidoc b/docs/examples/5553cf7a02c22f616cd994747f2dd5a5.asciidoc
index d03933cb3..a8a427981 100644
--- a/docs/examples/5553cf7a02c22f616cd994747f2dd5a5.asciidoc
+++ b/docs/examples/5553cf7a02c22f616cd994747f2dd5a5.asciidoc
@@ -1,19 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/nested.asciidoc:60
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "query": {
- "bool": {
- "must": [
- {"match": {"user.first": "Alice"}},
- {"match": {"user.last": "Smith"}},
- ]
- }
+ query={
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "user.first": "Alice"
+ }
+ },
+ {
+ "match": {
+ "user.last": "Smith"
+ }
+ }
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5566cff431570f522e1fc5475b2ed875.asciidoc b/docs/examples/5566cff431570f522e1fc5475b2ed875.asciidoc
new file mode 100644
index 000000000..53dfd1d5c
--- /dev/null
+++ b/docs/examples/5566cff431570f522e1fc5475b2ed875.asciidoc
@@ -0,0 +1,77 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/phrase-suggest.asciidoc:22
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test",
+ settings={
+ "index": {
+ "number_of_shards": 1,
+ "analysis": {
+ "analyzer": {
+ "trigram": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "shingle"
+ ]
+ },
+ "reverse": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "reverse"
+ ]
+ }
+ },
+ "filter": {
+ "shingle": {
+ "type": "shingle",
+ "min_shingle_size": 2,
+ "max_shingle_size": 3
+ }
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "title": {
+ "type": "text",
+ "fields": {
+ "trigram": {
+ "type": "text",
+ "analyzer": "trigram"
+ },
+ "reverse": {
+ "type": "text",
+ "analyzer": "reverse"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="test",
+ refresh=True,
+ document={
+ "title": "noble warriors"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="test",
+ refresh=True,
+ document={
+ "title": "nobel prize"
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/55838e0b21c4f4da2dc8aaec045a6d5f.asciidoc b/docs/examples/55838e0b21c4f4da2dc8aaec045a6d5f.asciidoc
new file mode 100644
index 000000000..2ef3bad46
--- /dev/null
+++ b/docs/examples/55838e0b21c4f4da2dc8aaec045a6d5f.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-aggregation.asciidoc:185
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ runtime_mappings={
+ "load_time.seconds": {
+ "type": "long",
+ "script": {
+ "source": "emit(doc['load_time'].value / params.timeUnit)",
+ "params": {
+ "timeUnit": 1000
+ }
+ }
+ }
+ },
+ aggs={
+ "load_time_outlier": {
+ "percentiles": {
+ "field": "load_time.seconds"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/558b3f9b987771e9f9f35e51a0d7e062.asciidoc b/docs/examples/558b3f9b987771e9f9f35e51a0d7e062.asciidoc
new file mode 100644
index 000000000..053704c71
--- /dev/null
+++ b/docs/examples/558b3f9b987771e9f9f35e51a0d7e062.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// search/profile.asciidoc:1155
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-dfs-index",
+ settings={
+ "number_of_shards": 2,
+ "number_of_replicas": 1
+ },
+ mappings={
+ "properties": {
+ "my-keyword": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="my-dfs-index",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "1"
+ }
+ },
+ {
+ "my-keyword": "a"
+ },
+ {
+ "index": {
+ "_id": "2"
+ }
+ },
+ {
+ "my-keyword": "b"
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/5597eeb8f43b5d47bd07f27122c24194.asciidoc b/docs/examples/5597eeb8f43b5d47bd07f27122c24194.asciidoc
new file mode 100644
index 000000000..bbdb28ae5
--- /dev/null
+++ b/docs/examples/5597eeb8f43b5d47bd07f27122c24194.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-across-clusters.asciidoc:1073
+
+[source, python]
+----
+resp = client.async_search.submit(
+ index="my-index-000001,cluster_one:my-index-000001,cluster_two:my-index-000001",
+ ccs_minimize_roundtrips=False,
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ source=[
+ "user.id",
+ "message",
+ "http.response.status_code"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/55d349ccb0efd5e1c06c6dd383a593cf.asciidoc b/docs/examples/55d349ccb0efd5e1c06c6dd383a593cf.asciidoc
new file mode 100644
index 000000000..99c86e300
--- /dev/null
+++ b/docs/examples/55d349ccb0efd5e1c06c6dd383a593cf.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-across-clusters.asciidoc:1030
+
+[source, python]
+----
+resp = client.async_search.submit(
+ index="my-index-000001,cluster*:my-index-*,cluster_three:-my-index-000001",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ source=[
+ "user.id",
+ "message",
+ "http.response.status_code"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/55e8ddf643726dec51531ada0bec7143.asciidoc b/docs/examples/55e8ddf643726dec51531ada0bec7143.asciidoc
new file mode 100644
index 000000000..e1f3f9765
--- /dev/null
+++ b/docs/examples/55e8ddf643726dec51531ada0bec7143.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// slm/apis/slm-stats.asciidoc:26
+
+[source, python]
+----
+resp = client.slm.get_stats()
+print(resp)
+----
diff --git a/docs/examples/55f0fec6342f677af74de2124b801aa2.asciidoc b/docs/examples/55f0fec6342f677af74de2124b801aa2.asciidoc
new file mode 100644
index 000000000..5326cf65b
--- /dev/null
+++ b/docs/examples/55f0fec6342f677af74de2124b801aa2.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:229
+
+[source, python]
+----
+resp = client.search(
+ index="byte-image-index",
+ knn={
+ "field": "byte-image-vector",
+ "query_vector": [
+ -5,
+ 9
+ ],
+ "k": 10,
+ "num_candidates": 100
+ },
+ fields=[
+ "title"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/55f4a15b84b724b9fbf2efd29a4da120.asciidoc b/docs/examples/55f4a15b84b724b9fbf2efd29a4da120.asciidoc
new file mode 100644
index 000000000..e47fdd6ae
--- /dev/null
+++ b/docs/examples/55f4a15b84b724b9fbf2efd29a4da120.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/authenticate.asciidoc:35
+
+[source, python]
+----
+resp = client.security.authenticate()
+print(resp)
+----
diff --git a/docs/examples/5619103306878d58a058bce87c5bd82b.asciidoc b/docs/examples/5619103306878d58a058bce87c5bd82b.asciidoc
new file mode 100644
index 000000000..c2fce5326
--- /dev/null
+++ b/docs/examples/5619103306878d58a058bce87c5bd82b.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/recovery.asciidoc:350
+
+[source, python]
+----
+resp = client.indices.recovery(
+ human=True,
+ detailed=True,
+)
+print(resp)
+----
diff --git a/docs/examples/5632c3b947062d3a5fc0e4f3413b3308.asciidoc b/docs/examples/5632c3b947062d3a5fc0e4f3413b3308.asciidoc
new file mode 100644
index 000000000..4c59ffbb9
--- /dev/null
+++ b/docs/examples/5632c3b947062d3a5fc0e4f3413b3308.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/register-fs-repo.asciidoc:17
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_fs_backup",
+ repository={
+ "type": "fs",
+ "settings": {
+ "location": "/mount/backups/my_fs_backup_location"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/563dfbf421422c837ee6929ae2ede876.asciidoc b/docs/examples/563dfbf421422c837ee6929ae2ede876.asciidoc
new file mode 100644
index 000000000..a15e07d5c
--- /dev/null
+++ b/docs/examples/563dfbf421422c837ee6929ae2ede876.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/migrate-to-data-stream.asciidoc:53
+
+[source, python]
+----
+resp = client.indices.migrate_to_data_stream(
+ name="my-logs",
+)
+print(resp)
+----
diff --git a/docs/examples/56563f91d9f0b74e9e4aae9cb221845b.asciidoc b/docs/examples/56563f91d9f0b74e9e4aae9cb221845b.asciidoc
new file mode 100644
index 000000000..67cb1a01c
--- /dev/null
+++ b/docs/examples/56563f91d9f0b74e9e4aae9cb221845b.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-cross-cluster-api-key.asciidoc:106
+
+[source, python]
+----
+resp = client.perform_request(
+ "POST",
+ "/_security/cross_cluster/api_key",
+ headers={"Content-Type": "application/json"},
+ body={
+ "name": "my-cross-cluster-api-key",
+ "expiration": "1d",
+ "access": {
+ "search": [
+ {
+ "names": [
+ "logs*"
+ ]
+ }
+ ],
+ "replication": [
+ {
+ "names": [
+ "archive*"
+ ]
+ }
+ ]
+ },
+ "metadata": {
+ "description": "phase one",
+ "environment": {
+ "level": 1,
+ "trusted": True,
+ "tags": [
+ "dev",
+ "staging"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/565908b03edff1d6e6e7cdfb92177faf.asciidoc b/docs/examples/565908b03edff1d6e6e7cdfb92177faf.asciidoc
new file mode 100644
index 000000000..5f61bdea2
--- /dev/null
+++ b/docs/examples/565908b03edff1d6e6e7cdfb92177faf.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/stats-aggregation.asciidoc:53
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size=0,
+ runtime_mappings={
+ "grade.weighted": {
+ "type": "double",
+ "script": "\n emit(doc['grade'].value * doc['weight'].value)\n "
+ }
+ },
+ aggs={
+ "grades_stats": {
+ "stats": {
+ "field": "grade.weighted"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/568979150ce18739f8d3ea859355aaa3.asciidoc b/docs/examples/568979150ce18739f8d3ea859355aaa3.asciidoc
new file mode 100644
index 000000000..9accb5678
--- /dev/null
+++ b/docs/examples/568979150ce18739f8d3ea859355aaa3.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-users.asciidoc:87
+
+[source, python]
+----
+resp = client.security.get_user(
+ username="jacknich",
+ with_profile_uid=True,
+)
+print(resp)
+----
diff --git a/docs/examples/569f10fee671632017c722fd983009d4.asciidoc b/docs/examples/569f10fee671632017c722fd983009d4.asciidoc
new file mode 100644
index 000000000..277745f63
--- /dev/null
+++ b/docs/examples/569f10fee671632017c722fd983009d4.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:548
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "shop": {
+ "terms": {
+ "field": "shop"
+ }
+ }
+ },
+ {
+ "product": {
+ "terms": {
+ "field": "product"
+ }
+ }
+ },
+ {
+ "date": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "1d"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/56a1aa4f7fa62f2289e20607e3039bf3.asciidoc b/docs/examples/56a1aa4f7fa62f2289e20607e3039bf3.asciidoc
index e58905f00..c43a52a11 100644
--- a/docs/examples/56a1aa4f7fa62f2289e20607e3039bf3.asciidoc
+++ b/docs/examples/56a1aa4f7fa62f2289e20607e3039bf3.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:13
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={"properties": {"email": {"type": "keyword"}}},
+ properties={
+ "email": {
+ "type": "keyword"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/56a903530990313b753b1be33578997a.asciidoc b/docs/examples/56a903530990313b753b1be33578997a.asciidoc
index f7131ab2f..3bfc858ea 100644
--- a/docs/examples/56a903530990313b753b1be33578997a.asciidoc
+++ b/docs/examples/56a903530990313b753b1be33578997a.asciidoc
@@ -1,31 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:448
[source, python]
----
resp = client.search(
- body={
- "query": {
- "dis_max": {
- "queries": [
- {
- "multi_match": {
- "query": "Will Smith",
- "type": "cross_fields",
- "fields": ["first", "last"],
- "minimum_should_match": "50%",
- }
- },
- {
- "multi_match": {
- "query": "Will Smith",
- "type": "cross_fields",
- "fields": ["*.edge"],
- }
- },
- ]
- }
+ query={
+ "dis_max": {
+ "queries": [
+ {
+ "multi_match": {
+ "query": "Will Smith",
+ "type": "cross_fields",
+ "fields": [
+ "first",
+ "last"
+ ],
+ "minimum_should_match": "50%"
+ }
+ },
+ {
+ "multi_match": {
+ "query": "Will Smith",
+ "type": "cross_fields",
+ "fields": [
+ "*.edge"
+ ]
+ }
+ }
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/56b6b50b174a935d368301ebd717231d.asciidoc b/docs/examples/56b6b50b174a935d368301ebd717231d.asciidoc
new file mode 100644
index 000000000..d4873c9da
--- /dev/null
+++ b/docs/examples/56b6b50b174a935d368301ebd717231d.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/stats.asciidoc:119
+
+[source, python]
+----
+resp = client.watcher.stats(
+ metric="current_watches",
+)
+print(resp)
+----
diff --git a/docs/examples/56da9c55774f4c2e8eadde0579bdc60c.asciidoc b/docs/examples/56da9c55774f4c2e8eadde0579bdc60c.asciidoc
new file mode 100644
index 000000000..58ebf79c9
--- /dev/null
+++ b/docs/examples/56da9c55774f4c2e8eadde0579bdc60c.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/top-metrics-aggregation.asciidoc:463
+
+[source, python]
+----
+resp = client.search(
+ index="test*",
+ filter_path="aggregations",
+ aggs={
+ "tm": {
+ "top_metrics": {
+ "metrics": {
+ "field": "m"
+ },
+ "sort": {
+ "s": {
+ "order": "asc",
+ "numeric_type": "double"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/56db76c987106a870357854d3068ad98.asciidoc b/docs/examples/56db76c987106a870357854d3068ad98.asciidoc
new file mode 100644
index 000000000..ede6b5e5c
--- /dev/null
+++ b/docs/examples/56db76c987106a870357854d3068ad98.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// query-rules/apis/list-query-rulesets.asciidoc:158
+
+[source, python]
+----
+resp = client.query_rules.list_rulesets()
+print(resp)
+----
diff --git a/docs/examples/56e90a63f94eeb882fe8acbcd74229c2.asciidoc b/docs/examples/56e90a63f94eeb882fe8acbcd74229c2.asciidoc
new file mode 100644
index 000000000..a71557a07
--- /dev/null
+++ b/docs/examples/56e90a63f94eeb882fe8acbcd74229c2.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/movfn-aggregation.asciidoc:256
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "the_moving_min": {
+ "moving_fn": {
+ "buckets_path": "the_sum",
+ "window": 10,
+ "script": "MovingFunctions.min(values)"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/56f3a6bec7be5a90fb43144c331a5b5a.asciidoc b/docs/examples/56f3a6bec7be5a90fb43144c331a5b5a.asciidoc
new file mode 100644
index 000000000..ca345c564
--- /dev/null
+++ b/docs/examples/56f3a6bec7be5a90fb43144c331a5b5a.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/common-options.asciidoc:260
+
+[source, python]
+----
+resp = client.indices.get_settings(
+ index="my-index-000001",
+ flat_settings=False,
+)
+print(resp)
+----
diff --git a/docs/examples/56fa6c9e08258157d445e2f92274962b.asciidoc b/docs/examples/56fa6c9e08258157d445e2f92274962b.asciidoc
new file mode 100644
index 000000000..938188705
--- /dev/null
+++ b/docs/examples/56fa6c9e08258157d445e2f92274962b.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/shingle-tokenfilter.asciidoc:220
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ {
+ "type": "shingle",
+ "min_shingle_size": 2,
+ "max_shingle_size": 3,
+ "output_unigrams": False
+ }
+ ],
+ text="quick brown fox jumps",
+)
+print(resp)
+----
diff --git a/docs/examples/571314a948e49f1f9614d36fcf79392a.asciidoc b/docs/examples/571314a948e49f1f9614d36fcf79392a.asciidoc
new file mode 100644
index 000000000..00c5382a1
--- /dev/null
+++ b/docs/examples/571314a948e49f1f9614d36fcf79392a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-across-clusters.asciidoc:877
+
+[source, python]
+----
+resp = client.async_search.get(
+ id="FjktRGJ1Y2w1U0phLTRhZnVyeUZ2MVEbWEJyeVBPQldTV3FGZGdIeUVabXBldzo5NzA4",
+)
+print(resp)
+----
diff --git a/docs/examples/578808065fee8691355b8f25c35782cd.asciidoc b/docs/examples/578808065fee8691355b8f25c35782cd.asciidoc
new file mode 100644
index 000000000..8bd882564
--- /dev/null
+++ b/docs/examples/578808065fee8691355b8f25c35782cd.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// search/profile.asciidoc:1018
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ filter_path="profile.shards.fetch",
+ profile=True,
+ query={
+ "term": {
+ "user.id": {
+ "value": "elkbee"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5797df4b8e71d821a1488cbb63481104.asciidoc b/docs/examples/5797df4b8e71d821a1488cbb63481104.asciidoc
new file mode 100644
index 000000000..8a3cda2f5
--- /dev/null
+++ b/docs/examples/5797df4b8e71d821a1488cbb63481104.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/troubleshooting-shards-capacity.asciidoc:418
+
+[source, python]
+----
+resp = client.health_report(
+ feature="shards_capacity",
+)
+print(resp)
+----
diff --git a/docs/examples/57a3e8d2ca64e37e90d658c4cd935399.asciidoc b/docs/examples/57a3e8d2ca64e37e90d658c4cd935399.asciidoc
new file mode 100644
index 000000000..def44edfb
--- /dev/null
+++ b/docs/examples/57a3e8d2ca64e37e90d658c4cd935399.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/distance-feature-query.asciidoc:127
+
+[source, python]
+----
+resp = client.search(
+ index="items",
+ query={
+ "bool": {
+ "must": {
+ "match": {
+ "name": "chocolate"
+ }
+ },
+ "should": {
+ "distance_feature": {
+ "field": "location",
+ "pivot": "1000m",
+ "origin": [
+ -71.3,
+ 41.15
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/57c690f8fa95bacf4b250803be7467e4.asciidoc b/docs/examples/57c690f8fa95bacf4b250803be7467e4.asciidoc
index 75d7bfb86..7a03db5dc 100644
--- a/docs/examples/57c690f8fa95bacf4b250803be7467e4.asciidoc
+++ b/docs/examples/57c690f8fa95bacf4b250803be7467e4.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:427
[source, python]
----
resp = client.index(
index="example",
- body={"location": "BBOX (1000.0, 1002.0, 2000.0, 1000.0)"},
+ document={
+ "location": "BBOX (1000.0, 1002.0, 2000.0, 1000.0)"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc b/docs/examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc
new file mode 100644
index 000000000..a18b9a0a8
--- /dev/null
+++ b/docs/examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/oidc-prepare-authentication-api.asciidoc:100
+
+[source, python]
+----
+resp = client.security.oidc_prepare_authentication(
+ body={
+ "realm": "oidc1",
+ "state": "lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO",
+ "nonce": "zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/57e0bbab98f17d5b564d1ea146a55fe4.asciidoc b/docs/examples/57e0bbab98f17d5b564d1ea146a55fe4.asciidoc
new file mode 100644
index 000000000..79a2d5fcf
--- /dev/null
+++ b/docs/examples/57e0bbab98f17d5b564d1ea146a55fe4.asciidoc
@@ -0,0 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template.asciidoc:218
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="template_1",
+ index_patterns=[
+ "temp*"
+ ],
+ priority=0,
+ template={
+ "settings": {
+ "number_of_shards": 1,
+ "number_of_replicas": 0
+ },
+ "mappings": {
+ "_source": {
+ "enabled": False
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.put_index_template(
+ name="template_2",
+ index_patterns=[
+ "template*"
+ ],
+ priority=1,
+ template={
+ "settings": {
+ "number_of_shards": 2
+ },
+ "mappings": {
+ "_source": {
+ "enabled": True
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/582c4b05401dbc190b19411282d85310.asciidoc b/docs/examples/582c4b05401dbc190b19411282d85310.asciidoc
new file mode 100644
index 000000000..ed9d3ea23
--- /dev/null
+++ b/docs/examples/582c4b05401dbc190b19411282d85310.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:375
+
+[source, python]
+----
+resp = client.update(
+ index="my-index-000001",
+ id="1",
+ script={
+ "source": "if (ctx._source.tags.contains(params['tag'])) { ctx.op = 'delete' } else { ctx.op = 'none' }",
+ "lang": "painless",
+ "params": {
+ "tag": "green"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/582da02c09e0597b4396c87e33571e7b.asciidoc b/docs/examples/582da02c09e0597b4396c87e33571e7b.asciidoc
new file mode 100644
index 000000000..784a83d15
--- /dev/null
+++ b/docs/examples/582da02c09e0597b4396c87e33571e7b.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:311
+
+[source, python]
+----
+resp = client.sql.query(
+ format="json",
+ cursor="sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=",
+)
+print(resp)
+----
diff --git a/docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc b/docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc
index 51fe0d3bf..b105ef8bd 100644
--- a/docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc
+++ b/docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc
@@ -1,4 +1,5 @@
-// ml/trained-models/apis/start-trained-model-deployment.asciidoc:208
+// This file is autogenerated, DO NOT EDIT
+// ml/trained-models/apis/start-trained-model-deployment.asciidoc:181
[source, python]
----
@@ -7,4 +8,4 @@ resp = client.ml.start_trained_model_deployment(
deployment_id="my_model_for_search",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/584f502cf840134f2db5f39e2483ced1.asciidoc b/docs/examples/584f502cf840134f2db5f39e2483ced1.asciidoc
new file mode 100644
index 000000000..925fc1eb0
--- /dev/null
+++ b/docs/examples/584f502cf840134f2db5f39e2483ced1.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1453
+
+[source, python]
+----
+resp = client.indices.create(
+ index="portuguese_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "portuguese_stop": {
+ "type": "stop",
+ "stopwords": "_portuguese_"
+ },
+ "portuguese_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "exemplo"
+ ]
+ },
+ "portuguese_stemmer": {
+ "type": "stemmer",
+ "language": "light_portuguese"
+ }
+ },
+ "analyzer": {
+ "rebuilt_portuguese": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "portuguese_stop",
+ "portuguese_keywords",
+ "portuguese_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/585a34ad79aee16678b37da785933ac8.asciidoc b/docs/examples/585a34ad79aee16678b37da785933ac8.asciidoc
new file mode 100644
index 000000000..4ae188bd7
--- /dev/null
+++ b/docs/examples/585a34ad79aee16678b37da785933ac8.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/apis/stop.asciidoc:79
+
+[source, python]
+----
+resp = client.ilm.stop()
+print(resp)
+----
diff --git a/docs/examples/585b19369cb9b9763a7e8d405f009a47.asciidoc b/docs/examples/585b19369cb9b9763a7e8d405f009a47.asciidoc
index 7ec0673b0..c0ef6279a 100644
--- a/docs/examples/585b19369cb9b9763a7e8d405f009a47.asciidoc
+++ b/docs/examples/585b19369cb9b9763a7e8d405f009a47.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:249
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={"runtime": {"day_of_week": None}},
+ runtime={
+ "day_of_week": None
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5865ca8d2bcd087ed5dbee33fafee57f.asciidoc b/docs/examples/5865ca8d2bcd087ed5dbee33fafee57f.asciidoc
new file mode 100644
index 000000000..676850f72
--- /dev/null
+++ b/docs/examples/5865ca8d2bcd087ed5dbee33fafee57f.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-manage-existing-data-stream.asciidoc:111
+
+[source, python]
+----
+resp = client.indices.explain_data_lifecycle(
+ index=".ds-my-data-stream-*",
+)
+print(resp)
+----
diff --git a/docs/examples/586cfa0e5fd695b7d451e854f9fb4a9c.asciidoc b/docs/examples/586cfa0e5fd695b7d451e854f9fb4a9c.asciidoc
new file mode 100644
index 000000000..bda985584
--- /dev/null
+++ b/docs/examples/586cfa0e5fd695b7d451e854f9fb4a9c.asciidoc
@@ -0,0 +1,53 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-grid-query.asciidoc:20
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my_locations",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my_locations",
+ id="1",
+ refresh=True,
+ document={
+ "location": "POINT(4.912350 52.374081)",
+ "city": "Amsterdam",
+ "name": "NEMO Science Museum"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="my_locations",
+ id="2",
+ refresh=True,
+ document={
+ "location": "POINT(4.405200 51.222900)",
+ "city": "Antwerp",
+ "name": "Letterenhuis"
+ },
+)
+print(resp2)
+
+resp3 = client.index(
+ index="my_locations",
+ id="3",
+ refresh=True,
+ document={
+ "location": "POINT(2.336389 48.861111)",
+ "city": "Paris",
+ "name": "Musée du Louvre"
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/58ca855be30049f8f0879e532db51ee2.asciidoc b/docs/examples/58ca855be30049f8f0879e532db51ee2.asciidoc
new file mode 100644
index 000000000..d043f45f6
--- /dev/null
+++ b/docs/examples/58ca855be30049f8f0879e532db51ee2.asciidoc
@@ -0,0 +1,55 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/put-transform.asciidoc:314
+
+[source, python]
+----
+resp = client.transform.put_transform(
+ transform_id="ecommerce_transform1",
+ source={
+ "index": "kibana_sample_data_ecommerce",
+ "query": {
+ "term": {
+ "geoip.continent_name": {
+ "value": "Asia"
+ }
+ }
+ }
+ },
+ pivot={
+ "group_by": {
+ "customer_id": {
+ "terms": {
+ "field": "customer_id",
+ "missing_bucket": True
+ }
+ }
+ },
+ "aggregations": {
+ "max_price": {
+ "max": {
+ "field": "taxful_total_price"
+ }
+ }
+ }
+ },
+ description="Maximum priced ecommerce data by customer_id in Asia",
+ dest={
+ "index": "kibana_sample_data_ecommerce_transform1",
+ "pipeline": "add_timestamp_pipeline"
+ },
+ frequency="5m",
+ sync={
+ "time": {
+ "field": "order_date",
+ "delay": "60s"
+ }
+ },
+ retention_policy={
+ "time": {
+ "field": "order_date",
+ "max_age": "30d"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/58e684e0b771b4646662fe12d3060c05.asciidoc b/docs/examples/58e684e0b771b4646662fe12d3060c05.asciidoc
new file mode 100644
index 000000000..fcc617e43
--- /dev/null
+++ b/docs/examples/58e684e0b771b4646662fe12d3060c05.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/cjk-width-tokenfilter.asciidoc:69
+
+[source, python]
+----
+resp = client.indices.create(
+ index="cjk_width_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_cjk_width": {
+ "tokenizer": "standard",
+ "filter": [
+ "cjk_width"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/58f72be60c25752d7899a35fc60fe6eb.asciidoc b/docs/examples/58f72be60c25752d7899a35fc60fe6eb.asciidoc
index 99faff82a..95b46f3fe 100644
--- a/docs/examples/58f72be60c25752d7899a35fc60fe6eb.asciidoc
+++ b/docs/examples/58f72be60c25752d7899a35fc60fe6eb.asciidoc
@@ -1,13 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// modules/cluster/misc.asciidoc:179
[source, python]
----
resp = client.cluster.put_settings(
- body={
- "persistent": {
- "logger.org.elasticsearch.indices.recovery": "DEBUG"
- }
+ persistent={
+ "logger.org.elasticsearch.indices.recovery": "DEBUG"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/591c7fb7451069829a14bba593136f1f.asciidoc b/docs/examples/591c7fb7451069829a14bba593136f1f.asciidoc
new file mode 100644
index 000000000..85d4c0f71
--- /dev/null
+++ b/docs/examples/591c7fb7451069829a14bba593136f1f.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/forecast.asciidoc:82
+
+[source, python]
+----
+resp = client.ml.forecast(
+ job_id="low_request_rate",
+ duration="10d",
+)
+print(resp)
+----
diff --git a/docs/examples/5969c446688c8b326acc80276573e9d2.asciidoc b/docs/examples/5969c446688c8b326acc80276573e9d2.asciidoc
new file mode 100644
index 000000000..fd1bb3e8e
--- /dev/null
+++ b/docs/examples/5969c446688c8b326acc80276573e9d2.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:312
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ highlight={
+ "number_of_fragments": 3,
+ "fragment_size": 150,
+ "fields": {
+ "body": {
+ "pre_tags": [
+ ""
+ ],
+ "post_tags": [
+ ""
+ ]
+ },
+ "blog.title": {
+ "number_of_fragments": 0
+ },
+ "blog.author": {
+ "number_of_fragments": 0
+ },
+ "blog.comment": {
+ "number_of_fragments": 5,
+ "order": "score"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/59726e3c90e1218487a781508788c243.asciidoc b/docs/examples/59726e3c90e1218487a781508788c243.asciidoc
new file mode 100644
index 000000000..97f4c3a97
--- /dev/null
+++ b/docs/examples/59726e3c90e1218487a781508788c243.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/autodatehistogram-aggregation.asciidoc:293
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "sale_date": {
+ "auto_date_histogram": {
+ "field": "date",
+ "buckets": 10,
+ "missing": "2000/01/01"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/597d456edfcb3d410954a3e9b5babf9a.asciidoc b/docs/examples/597d456edfcb3d410954a3e9b5babf9a.asciidoc
new file mode 100644
index 000000000..a97a9a1e7
--- /dev/null
+++ b/docs/examples/597d456edfcb3d410954a3e9b5babf9a.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/disk-usage.asciidoc:51
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index",
+ mappings={
+ "dynamic_templates": [
+ {
+ "strings": {
+ "match_mapping_type": "string",
+ "mapping": {
+ "type": "keyword"
+ }
+ }
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5987afb2c17c73fe3d860937565ef115.asciidoc b/docs/examples/5987afb2c17c73fe3d860937565ef115.asciidoc
new file mode 100644
index 000000000..d777e9bd5
--- /dev/null
+++ b/docs/examples/5987afb2c17c73fe3d860937565ef115.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// search/point-in-time-api.asciidoc:40
+
+[source, python]
+----
+resp = client.open_point_in_time(
+ index="my-index-000001",
+ keep_alive="1m",
+)
+print(resp)
+----
diff --git a/docs/examples/599454613ac699d447537e79e65ae35a.asciidoc b/docs/examples/599454613ac699d447537e79e65ae35a.asciidoc
new file mode 100644
index 000000000..f3109d6c6
--- /dev/null
+++ b/docs/examples/599454613ac699d447537e79e65ae35a.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:67
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ script_fields={
+ "my_doubled_field": {
+ "script": {
+ "source": "doc['my_field'].value * params['multiplier']",
+ "params": {
+ "multiplier": 2
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/599f693cc7d30b1153f5eeecec8eb23a.asciidoc b/docs/examples/599f693cc7d30b1153f5eeecec8eb23a.asciidoc
new file mode 100644
index 000000000..8b43c7453
--- /dev/null
+++ b/docs/examples/599f693cc7d30b1153f5eeecec8eb23a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/delete-index-template-v1.asciidoc:29
+
+[source, python]
+----
+resp = client.indices.delete_template(
+ name="my-legacy-index-template",
+)
+print(resp)
+----
diff --git a/docs/examples/59b8b9555f4aa30bc4613f819e9fc8f0.asciidoc b/docs/examples/59b8b9555f4aa30bc4613f819e9fc8f0.asciidoc
new file mode 100644
index 000000000..06bef0b08
--- /dev/null
+++ b/docs/examples/59b8b9555f4aa30bc4613f819e9fc8f0.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/close.asciidoc:72
+
+[source, python]
+----
+resp = client.indices.close(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/59d015f7bd0eeab40d0885010a62fa70.asciidoc b/docs/examples/59d015f7bd0eeab40d0885010a62fa70.asciidoc
new file mode 100644
index 000000000..4094c2a04
--- /dev/null
+++ b/docs/examples/59d015f7bd0eeab40d0885010a62fa70.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/role-templates.asciidoc:52
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="example2",
+ indices=[
+ {
+ "names": [
+ "my-index-000001"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "query": {
+ "template": {
+ "source": {
+ "term": {
+ "group.id": "{{_user.metadata.group_id}}"
+ }
+ }
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc b/docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc
new file mode 100644
index 000000000..f825daf85
--- /dev/null
+++ b/docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-openai.asciidoc:137
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="completion",
+ inference_id="openai-completion",
+ inference_config={
+ "service": "openai",
+ "service_settings": {
+ "api_key": "",
+ "model_id": "gpt-3.5-turbo"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/59f0ad2a6f97200e98e8eb079cdd8334.asciidoc b/docs/examples/59f0ad2a6f97200e98e8eb079cdd8334.asciidoc
new file mode 100644
index 000000000..44e6fc0af
--- /dev/null
+++ b/docs/examples/59f0ad2a6f97200e98e8eb079cdd8334.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/multi-get.asciidoc:156
+
+[source, python]
+----
+resp = client.mget(
+ index="my-index-000001",
+ ids=[
+ "1",
+ "2"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/5a006feed86309b547bbaa1baca1c496.asciidoc b/docs/examples/5a006feed86309b547bbaa1baca1c496.asciidoc
index 386f4b545..1c555f60d 100644
--- a/docs/examples/5a006feed86309b547bbaa1baca1c496.asciidoc
+++ b/docs/examples/5a006feed86309b547bbaa1baca1c496.asciidoc
@@ -1,64 +1,72 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:148
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "numeric_counts": {
- "match_mapping_type": ["long", "double"],
- "match": "count",
- "mapping": {
- "type": "{dynamic_type}",
- "index": False,
- },
+ mappings={
+ "dynamic_templates": [
+ {
+ "numeric_counts": {
+ "match_mapping_type": [
+ "long",
+ "double"
+ ],
+ "match": "count",
+ "mapping": {
+ "type": "{dynamic_type}",
+ "index": False
}
- },
- {
- "integers": {
- "match_mapping_type": "long",
- "mapping": {"type": "integer"},
+ }
+ },
+ {
+ "integers": {
+ "match_mapping_type": "long",
+ "mapping": {
+ "type": "integer"
}
- },
- {
- "strings": {
- "match_mapping_type": "string",
- "mapping": {
- "type": "text",
- "fields": {
- "raw": {
- "type": "keyword",
- "ignore_above": 256,
- }
- },
- },
+ }
+ },
+ {
+ "strings": {
+ "match_mapping_type": "string",
+ "mapping": {
+ "type": "text",
+ "fields": {
+ "raw": {
+ "type": "keyword",
+ "ignore_above": 256
+ }
+ }
}
- },
- {
- "non_objects_keyword": {
- "match_mapping_type": "*",
- "unmatch_mapping_type": "object",
- "mapping": {"type": "keyword"},
+ }
+ },
+ {
+ "non_objects_keyword": {
+ "match_mapping_type": "*",
+ "unmatch_mapping_type": "object",
+ "mapping": {
+ "type": "keyword"
}
- },
- ]
- }
+ }
+ }
+ ]
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={
+ document={
"my_integer": 5,
"my_string": "Some string",
"my_boolean": "false",
- "field": {"count": 4},
+ "field": {
+ "count": 4
+ }
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/5a3855f1b3e37d89ab7cbcc4f7ae1dd3.asciidoc b/docs/examples/5a3855f1b3e37d89ab7cbcc4f7ae1dd3.asciidoc
new file mode 100644
index 000000000..39ca9ab8f
--- /dev/null
+++ b/docs/examples/5a3855f1b3e37d89ab7cbcc4f7ae1dd3.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/limit-token-count-tokenfilter.asciidoc:43
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ {
+ "type": "limit",
+ "max_token_count": 2
+ }
+ ],
+ text="quick fox jumps over lazy dog",
+)
+print(resp)
+----
diff --git a/docs/examples/5a3fe9584d203d1fd6c96981ba34e0de.asciidoc b/docs/examples/5a3fe9584d203d1fd6c96981ba34e0de.asciidoc
new file mode 100644
index 000000000..2f1a1c9e7
--- /dev/null
+++ b/docs/examples/5a3fe9584d203d1fd6c96981ba34e0de.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/geo-match-enrich-policy-type-ex.asciidoc:17
+
+[source, python]
+----
+resp = client.indices.create(
+ index="postal_codes",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_shape"
+ },
+ "postal_code": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5a6bb9ac6830668ecc00550c1aa8f2f1.asciidoc b/docs/examples/5a6bb9ac6830668ecc00550c1aa8f2f1.asciidoc
new file mode 100644
index 000000000..bce40b81e
--- /dev/null
+++ b/docs/examples/5a6bb9ac6830668ecc00550c1aa8f2f1.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/remote-clusters-privileges-cert.asciidoc:286
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="logstash-reader",
+ indices=[
+ {
+ "names": [
+ "logstash-*"
+ ],
+ "privileges": [
+ "read_cross_cluster",
+ "read",
+ "view_index_metadata"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/5a754dcc854b9154296550a0b581cb9d.asciidoc b/docs/examples/5a754dcc854b9154296550a0b581cb9d.asciidoc
new file mode 100644
index 000000000..fc806cf05
--- /dev/null
+++ b/docs/examples/5a754dcc854b9154296550a0b581cb9d.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/ipprefix-aggregation.asciidoc:50
+
+[source, python]
+----
+resp = client.search(
+ index="network-traffic",
+ size=0,
+ aggs={
+ "ipv4-subnets": {
+ "ip_prefix": {
+ "field": "ipv4",
+ "prefix_length": 24
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5a7f05ab1d05b4eef5ff327168517165.asciidoc b/docs/examples/5a7f05ab1d05b4eef5ff327168517165.asciidoc
new file mode 100644
index 000000000..9d043fe3b
--- /dev/null
+++ b/docs/examples/5a7f05ab1d05b4eef5ff327168517165.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-shard-routing.asciidoc:140
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ routing="my-routing-value,my-routing-value-2",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5ab9b44939fb30f5b4adbdcc4bcc0733.asciidoc b/docs/examples/5ab9b44939fb30f5b4adbdcc4bcc0733.asciidoc
new file mode 100644
index 000000000..67388e6fa
--- /dev/null
+++ b/docs/examples/5ab9b44939fb30f5b4adbdcc4bcc0733.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-ilm.asciidoc:53
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="datastream_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_age": "5m"
+ },
+ "downsample": {
+ "fixed_interval": "1h"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5ad365ed9e1a3c26093a0f09666c133a.asciidoc b/docs/examples/5ad365ed9e1a3c26093a0f09666c133a.asciidoc
new file mode 100644
index 000000000..921bfe844
--- /dev/null
+++ b/docs/examples/5ad365ed9e1a3c26093a0f09666c133a.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-role-mappings.asciidoc:246
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="mapping5",
+ role_templates=[
+ {
+ "template": {
+ "source": "{{#tojson}}groups{{/tojson}}"
+ },
+ "format": "json"
+ }
+ ],
+ rules={
+ "field": {
+ "realm.name": "saml1"
+ }
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/5afbd9caed88c32f8a2968c07054f096.asciidoc b/docs/examples/5afbd9caed88c32f8a2968c07054f096.asciidoc
new file mode 100644
index 000000000..912ae0d8c
--- /dev/null
+++ b/docs/examples/5afbd9caed88c32f8a2968c07054f096.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/logstash/delete-pipeline.asciidoc:67
+
+[source, python]
+----
+resp = client.logstash.delete_pipeline(
+ id="my_pipeline",
+)
+print(resp)
+----
diff --git a/docs/examples/5b0cc9e186a8f765a11141809b8b17b7.asciidoc b/docs/examples/5b0cc9e186a8f765a11141809b8b17b7.asciidoc
new file mode 100644
index 000000000..6766b1c62
--- /dev/null
+++ b/docs/examples/5b0cc9e186a8f765a11141809b8b17b7.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// search-application/apis/list-search-applications.asciidoc:101
+
+[source, python]
+----
+resp = client.search_application.list(
+ from_="0",
+ size="3",
+ q="app*",
+)
+print(resp)
+----
diff --git a/docs/examples/5b191f2dbfa46c774cc9b9b9e8d1d831.asciidoc b/docs/examples/5b191f2dbfa46c774cc9b9b9e8d1d831.asciidoc
new file mode 100644
index 000000000..5a0713e09
--- /dev/null
+++ b/docs/examples/5b191f2dbfa46c774cc9b9b9e8d1d831.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-user-privileges.asciidoc:34
+
+[source, python]
+----
+resp = client.security.get_user_privileges()
+print(resp)
+----
diff --git a/docs/examples/5b1ae98ad03e2819fc7c3468840ef448.asciidoc b/docs/examples/5b1ae98ad03e2819fc7c3468840ef448.asciidoc
new file mode 100644
index 000000000..ab8f4a762
--- /dev/null
+++ b/docs/examples/5b1ae98ad03e2819fc7c3468840ef448.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:637
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-index*",
+ query="\n sample by host\n [any where uptime > 0]\n [any where port > 100]\n [any where bool == true]\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/5b266deba5396c7810af1b8315c23596.asciidoc b/docs/examples/5b266deba5396c7810af1b8315c23596.asciidoc
new file mode 100644
index 000000000..36ef617d6
--- /dev/null
+++ b/docs/examples/5b266deba5396c7810af1b8315c23596.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-grid-query.asciidoc:62
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ size=0,
+ aggs={
+ "grouped": {
+ "geohash_grid": {
+ "field": "location",
+ "precision": 2
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5b281956e35a26e734c482b42b356c0d.asciidoc b/docs/examples/5b281956e35a26e734c482b42b356c0d.asciidoc
new file mode 100644
index 000000000..4b77d9f45
--- /dev/null
+++ b/docs/examples/5b281956e35a26e734c482b42b356c0d.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/alias-exists.asciidoc:10
+
+[source, python]
+----
+resp = client.indices.exists_alias(
+ name="my-alias",
+)
+print(resp)
+----
diff --git a/docs/examples/5b2a13366bd4e1ab4b25d04d360570dc.asciidoc b/docs/examples/5b2a13366bd4e1ab4b25d04d360570dc.asciidoc
new file mode 100644
index 000000000..01a6a6ea8
--- /dev/null
+++ b/docs/examples/5b2a13366bd4e1ab4b25d04d360570dc.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-component-template.asciidoc:252
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="template_1",
+ template={
+ "settings": {
+ "number_of_shards": 1
+ }
+ },
+ meta={
+ "description": "set number of shards to one",
+ "serialization": {
+ "class": "MyComponentTemplate",
+ "id": 10
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5b3384992c398ea8a3064d2e08725e2b.asciidoc b/docs/examples/5b3384992c398ea8a3064d2e08725e2b.asciidoc
new file mode 100644
index 000000000..9fb98466d
--- /dev/null
+++ b/docs/examples/5b3384992c398ea8a3064d2e08725e2b.asciidoc
@@ -0,0 +1,77 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/top-metrics-aggregation.asciidoc:291
+
+[source, python]
+----
+resp = client.indices.create(
+ index="node",
+ mappings={
+ "properties": {
+ "ip": {
+ "type": "ip"
+ },
+ "date": {
+ "type": "date"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="node",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "ip": "192.168.0.1",
+ "date": "2020-01-01T01:01:01",
+ "m": 1
+ },
+ {
+ "index": {}
+ },
+ {
+ "ip": "192.168.0.1",
+ "date": "2020-01-01T02:01:01",
+ "m": 2
+ },
+ {
+ "index": {}
+ },
+ {
+ "ip": "192.168.0.2",
+ "date": "2020-01-01T02:01:01",
+ "m": 3
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="node",
+ filter_path="aggregations",
+ aggs={
+ "ip": {
+ "terms": {
+ "field": "ip"
+ },
+ "aggs": {
+ "tm": {
+ "top_metrics": {
+ "metrics": {
+ "field": "m"
+ },
+ "sort": {
+ "date": "desc"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/5b58007f10700ec7934580f034404652.asciidoc b/docs/examples/5b58007f10700ec7934580f034404652.asciidoc
index 87a4d0df4..ed59e0d0b 100644
--- a/docs/examples/5b58007f10700ec7934580f034404652.asciidoc
+++ b/docs/examples/5b58007f10700ec7934580f034404652.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/index_.asciidoc:579
[source, python]
@@ -5,11 +6,13 @@
resp = client.create(
index="my-index-000001",
id="1",
- body={
+ document={
"@timestamp": "2099-11-15T13:12:00",
"message": "GET /search HTTP/1.1 200 1070000",
- "user": {"id": "kimchy"},
+ "user": {
+ "id": "kimchy"
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5b6bc085943e9189236d98b3c05ed62c.asciidoc b/docs/examples/5b6bc085943e9189236d98b3c05ed62c.asciidoc
new file mode 100644
index 000000000..a95c80e71
--- /dev/null
+++ b/docs/examples/5b6bc085943e9189236d98b3c05ed62c.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/set-up-lifecycle-policy.asciidoc:44
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_primary_shard_size": "25GB"
+ }
+ }
+ },
+ "delete": {
+ "min_age": "30d",
+ "actions": {
+ "delete": {}
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5b7d6f1db88ca6f42c48fa3dbb4341e8.asciidoc b/docs/examples/5b7d6f1db88ca6f42c48fa3dbb4341e8.asciidoc
index c8cee2b4d..b58e6bc27 100644
--- a/docs/examples/5b7d6f1db88ca6f42c48fa3dbb4341e8.asciidoc
+++ b/docs/examples/5b7d6f1db88ca6f42c48fa3dbb4341e8.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// indices/get-mapping.asciidoc:79
[source, python]
@@ -7,11 +8,11 @@ resp = client.indices.get_mapping(
)
print(resp)
-resp = client.indices.get_mapping(
+resp1 = client.indices.get_mapping(
index="_all",
)
-print(resp)
+print(resp1)
-resp = client.indices.get_mapping()
-print(resp)
-----
\ No newline at end of file
+resp2 = client.indices.get_mapping()
+print(resp2)
+----
diff --git a/docs/examples/5b8119b4d9a09f4643be5a5b40875c8f.asciidoc b/docs/examples/5b8119b4d9a09f4643be5a5b40875c8f.asciidoc
index ad2d49e9f..2ef914ffd 100644
--- a/docs/examples/5b8119b4d9a09f4643be5a5b40875c8f.asciidoc
+++ b/docs/examples/5b8119b4d9a09f4643be5a5b40875c8f.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/boolean.asciidoc:78
[source, python]
@@ -5,32 +6,46 @@
resp = client.index(
index="my-index-000001",
id="1",
- refresh="true",
- body={"is_published": True},
+ refresh=True,
+ document={
+ "is_published": True
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="2",
- refresh="true",
- body={"is_published": False},
+ refresh=True,
+ document={
+ "is_published": False
+ },
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
- body={
- "aggs": {"publish_state": {"terms": {"field": "is_published"}}},
- "sort": ["is_published"],
- "fields": [{"field": "weight"}],
- "runtime_mappings": {
- "weight": {
- "type": "long",
- "script": "emit(doc['is_published'].value ? 10 : 0)",
+ aggs={
+ "publish_state": {
+ "terms": {
+ "field": "is_published"
}
- },
+ }
+ },
+ sort=[
+ "is_published"
+ ],
+ fields=[
+ {
+ "field": "weight"
+ }
+ ],
+ runtime_mappings={
+ "weight": {
+ "type": "long",
+ "script": "emit(doc['is_published'].value ? 10 : 0)"
+ }
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/5b86d54900e2c4c043a54ca7ae2df0f0.asciidoc b/docs/examples/5b86d54900e2c4c043a54ca7ae2df0f0.asciidoc
index fff85f1f4..31492b541 100644
--- a/docs/examples/5b86d54900e2c4c043a54ca7ae2df0f0.asciidoc
+++ b/docs/examples/5b86d54900e2c4c043a54ca7ae2df0f0.asciidoc
@@ -1,22 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/flattened.asciidoc:407
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"flattened": {"type": "flattened"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "flattened": {
+ "type": "flattened"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"flattened": {"field": ["foo"]}},
+ document={
+ "flattened": {
+ "field": [
+ "foo"
+ ]
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/5ba32ebaa7ee28a339c7693696d305ca.asciidoc b/docs/examples/5ba32ebaa7ee28a339c7693696d305ca.asciidoc
new file mode 100644
index 000000000..95de4965d
--- /dev/null
+++ b/docs/examples/5ba32ebaa7ee28a339c7693696d305ca.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/attachment.asciidoc:137
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="attachment",
+ description="Extract attachment information",
+ processors=[
+ {
+ "attachment": {
+ "field": "data",
+ "properties": [
+ "content",
+ "title"
+ ],
+ "remove_binary": False
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/5bb0d84185df2f276f01bb2fba709e1a.asciidoc b/docs/examples/5bb0d84185df2f276f01bb2fba709e1a.asciidoc
new file mode 100644
index 000000000..d7387585d
--- /dev/null
+++ b/docs/examples/5bb0d84185df2f276f01bb2fba709e1a.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1482
+
+[source, python]
+----
+resp = client.eql.search(
+ index="cluster_one:my-data-stream,cluster_two:my-data-stream",
+ query="\n process where process.name == \"regsvr32.exe\"\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/5bbccf103107e505c17ae59863753efd.asciidoc b/docs/examples/5bbccf103107e505c17ae59863753efd.asciidoc
new file mode 100644
index 000000000..056d688e7
--- /dev/null
+++ b/docs/examples/5bbccf103107e505c17ae59863753efd.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-influencer.asciidoc:152
+
+[source, python]
+----
+resp = client.ml.get_influencers(
+ job_id="high_sum_total_sales",
+ sort="influencer_score",
+ desc=True,
+)
+print(resp)
+----
diff --git a/docs/examples/5c187ba92dd1678fda86b5eec8cc7421.asciidoc b/docs/examples/5c187ba92dd1678fda86b5eec8cc7421.asciidoc
new file mode 100644
index 000000000..5d29c9ac6
--- /dev/null
+++ b/docs/examples/5c187ba92dd1678fda86b5eec8cc7421.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/script-query.asciidoc:24
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "bool": {
+ "filter": {
+ "script": {
+ "script": "\n double amount = doc['amount'].value;\n if (doc['type'].value == 'expense') {\n amount *= -1;\n }\n return amount < 10;\n "
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5c22172a944864a7d138decdc08558b4.asciidoc b/docs/examples/5c22172a944864a7d138decdc08558b4.asciidoc
new file mode 100644
index 000000000..cc3c8a011
--- /dev/null
+++ b/docs/examples/5c22172a944864a7d138decdc08558b4.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/detect-threats-with-eql.asciidoc:73
+
+[source, python]
+----
+resp = client.cat.indices(
+ index="my-data-stream",
+ v=True,
+ h="health,status,index,docs.count",
+)
+print(resp)
+----
diff --git a/docs/examples/5c249eaeb99e6aee07162128288ac1b1.asciidoc b/docs/examples/5c249eaeb99e6aee07162128288ac1b1.asciidoc
new file mode 100644
index 000000000..4a81953e8
--- /dev/null
+++ b/docs/examples/5c249eaeb99e6aee07162128288ac1b1.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/moving-percentiles-aggregation.asciidoc:43
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_percentile": {
+ "percentiles": {
+ "field": "price",
+ "percents": [
+ 1,
+ 99
+ ]
+ }
+ },
+ "the_movperc": {
+ "moving_percentiles": {
+ "buckets_path": "the_percentile",
+ "window": 10
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5c24a9a0ddbfa50628dacdb9d25f7ab0.asciidoc b/docs/examples/5c24a9a0ddbfa50628dacdb9d25f7ab0.asciidoc
new file mode 100644
index 000000000..29806b764
--- /dev/null
+++ b/docs/examples/5c24a9a0ddbfa50628dacdb9d25f7ab0.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/extendedstats-aggregation.asciidoc:172
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size=0,
+ aggs={
+ "grades_stats": {
+ "extended_stats": {
+ "field": "grade",
+ "missing": 0
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5c2f486c27bd5346e512265f93375d16.asciidoc b/docs/examples/5c2f486c27bd5346e512265f93375d16.asciidoc
index a7af294d8..44807a333 100644
--- a/docs/examples/5c2f486c27bd5346e512265f93375d16.asciidoc
+++ b/docs/examples/5c2f486c27bd5346e512265f93375d16.asciidoc
@@ -1,19 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/range-query.asciidoc:241
[source, python]
----
resp = client.search(
- body={
- "query": {
- "range": {
- "timestamp": {
- "time_zone": "+01:00",
- "gte": "2020-01-01T00:00:00",
- "lte": "now",
- }
+ query={
+ "range": {
+ "timestamp": {
+ "time_zone": "+01:00",
+ "gte": "2020-01-01T00:00:00",
+ "lte": "now"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5c6fbeac20dc23b613847f35d431ecab.asciidoc b/docs/examples/5c6fbeac20dc23b613847f35d431ecab.asciidoc
index 54693f4af..eb709e7f8 100644
--- a/docs/examples/5c6fbeac20dc23b613847f35d431ecab.asciidoc
+++ b/docs/examples/5c6fbeac20dc23b613847f35d431ecab.asciidoc
@@ -1,27 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/function-score-query.asciidoc:578
[source, python]
----
resp = client.search(
- body={
- "query": {
- "function_score": {
- "functions": [
- {"gauss": {"price": {"origin": "0", "scale": "20"}}},
- {
- "gauss": {
- "location": {
- "origin": "11, 12",
- "scale": "2km",
- }
+ query={
+ "function_score": {
+ "functions": [
+ {
+ "gauss": {
+ "price": {
+ "origin": "0",
+ "scale": "20"
}
- },
- ],
- "query": {"match": {"properties": "balcony"}},
- "score_mode": "multiply",
- }
+ }
+ },
+ {
+ "gauss": {
+ "location": {
+ "origin": "11, 12",
+ "scale": "2km"
+ }
+ }
+ }
+ ],
+ "query": {
+ "match": {
+ "properties": "balcony"
+ }
+ },
+ "score_mode": "multiply"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5c7ece1f30267adabdb832424871900a.asciidoc b/docs/examples/5c7ece1f30267adabdb832424871900a.asciidoc
new file mode 100644
index 000000000..4e8858788
--- /dev/null
+++ b/docs/examples/5c7ece1f30267adabdb832424871900a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-unbalanced-cluster.asciidoc:20
+
+[source, python]
+----
+resp = client.cat.allocation(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/5c8ac24dd56e85d8f3f6705ec3c6dc32.asciidoc b/docs/examples/5c8ac24dd56e85d8f3f6705ec3c6dc32.asciidoc
new file mode 100644
index 000000000..fedf56ce0
--- /dev/null
+++ b/docs/examples/5c8ac24dd56e85d8f3f6705ec3c6dc32.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/circle.asciidoc:27
+
+[source, python]
+----
+resp = client.indices.create(
+ index="circles",
+ mappings={
+ "properties": {
+ "circle": {
+ "type": "geo_shape"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.ingest.put_pipeline(
+ id="polygonize_circles",
+ description="translate circle to polygon",
+ processors=[
+ {
+ "circle": {
+ "field": "circle",
+ "error_distance": 28,
+ "shape_type": "geo_shape"
+ }
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/5ccfd9f4698dcd7cdfbc6bad60081aab.asciidoc b/docs/examples/5ccfd9f4698dcd7cdfbc6bad60081aab.asciidoc
new file mode 100644
index 000000000..6ec562e73
--- /dev/null
+++ b/docs/examples/5ccfd9f4698dcd7cdfbc6bad60081aab.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/get-dfanalytics.asciidoc:212
+
+[source, python]
+----
+resp = client.ml.get_data_frame_analytics(
+ id="loganalytics",
+)
+print(resp)
+----
diff --git a/docs/examples/5cd792dff7d5891c33bef098d9338ce1.asciidoc b/docs/examples/5cd792dff7d5891c33bef098d9338ce1.asciidoc
new file mode 100644
index 000000000..a5ca425b2
--- /dev/null
+++ b/docs/examples/5cd792dff7d5891c33bef098d9338ce1.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/store.asciidoc:20
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "title": {
+ "type": "text",
+ "store": True
+ },
+ "date": {
+ "type": "date",
+ "store": True
+ },
+ "content": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "title": "Some short title",
+ "date": "2015-01-01",
+ "content": "A very long content field..."
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ stored_fields=[
+ "title",
+ "date"
+ ],
+)
+print(resp2)
+----
diff --git a/docs/examples/5cfab507e50d8c5182939412a9dbcdc8.asciidoc b/docs/examples/5cfab507e50d8c5182939412a9dbcdc8.asciidoc
new file mode 100644
index 000000000..fc87e1e41
--- /dev/null
+++ b/docs/examples/5cfab507e50d8c5182939412a9dbcdc8.asciidoc
@@ -0,0 +1,82 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/geocentroid-aggregation.asciidoc:184
+
+[source, python]
+----
+resp = client.indices.create(
+ index="places",
+ mappings={
+ "properties": {
+ "geometry": {
+ "type": "geo_shape"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="places",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "name": "NEMO Science Museum",
+ "geometry": "POINT(4.912350 52.374081)"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "name": "Sportpark De Weeren",
+ "geometry": {
+ "type": "Polygon",
+ "coordinates": [
+ [
+ [
+ 4.965305328369141,
+ 52.39347642069457
+ ],
+ [
+ 4.966979026794433,
+ 52.391721758934835
+ ],
+ [
+ 4.969425201416015,
+ 52.39238958618537
+ ],
+ [
+ 4.967944622039794,
+ 52.39420969150824
+ ],
+ [
+ 4.965305328369141,
+ 52.39347642069457
+ ]
+ ]
+ ]
+ }
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="places",
+ size="0",
+ aggs={
+ "centroid": {
+ "geo_centroid": {
+ "field": "geometry"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/5d03bb385904d20c5323885706738459.asciidoc b/docs/examples/5d03bb385904d20c5323885706738459.asciidoc
index 4fe59fe3a..b5272d856 100644
--- a/docs/examples/5d03bb385904d20c5323885706738459.asciidoc
+++ b/docs/examples/5d03bb385904d20c5323885706738459.asciidoc
@@ -1,13 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// indices/aliases.asciidoc:10
[source, python]
----
resp = client.indices.update_aliases(
- body={
- "actions": [
- {"add": {"index": "my-data-stream", "alias": "my-alias"}}
- ]
- },
+ actions=[
+ {
+ "add": {
+ "index": "my-data-stream",
+ "alias": "my-alias"
+ }
+ }
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5d3ee81bcf6ad57f39052c9065963cc3.asciidoc b/docs/examples/5d3ee81bcf6ad57f39052c9065963cc3.asciidoc
new file mode 100644
index 000000000..a9099c446
--- /dev/null
+++ b/docs/examples/5d3ee81bcf6ad57f39052c9065963cc3.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/copy-to.asciidoc:139
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test_index",
+ mappings={
+ "dynamic": "strict",
+ "properties": {
+ "description": {
+ "properties": {
+ "notes": {
+ "type": "text",
+ "copy_to": [
+ "description.notes_raw"
+ ],
+ "analyzer": "standard",
+ "search_analyzer": "standard"
+ },
+ "notes_raw": {
+ "type": "keyword"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5d428ea66252fd252b6a8d6f47605c86.asciidoc b/docs/examples/5d428ea66252fd252b6a8d6f47605c86.asciidoc
new file mode 100644
index 000000000..856ea6639
--- /dev/null
+++ b/docs/examples/5d428ea66252fd252b6a8d6f47605c86.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/cjk-bigram-tokenfilter.asciidoc:176
+
+[source, python]
+----
+resp = client.indices.create(
+ index="cjk_bigram_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "han_bigrams": {
+ "tokenizer": "standard",
+ "filter": [
+ "han_bigrams_filter"
+ ]
+ }
+ },
+ "filter": {
+ "han_bigrams_filter": {
+ "type": "cjk_bigram",
+ "ignored_scripts": [
+ "hangul",
+ "hiragana",
+ "katakana"
+ ],
+ "output_unigrams": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5d5b06468c54308f52c212cca5d58fef.asciidoc b/docs/examples/5d5b06468c54308f52c212cca5d58fef.asciidoc
new file mode 100644
index 000000000..bf9ff4a35
--- /dev/null
+++ b/docs/examples/5d5b06468c54308f52c212cca5d58fef.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:469
+
+[source, python]
+----
+resp = client.sql.query(
+ format="json",
+ cursor="sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWWWdrRlVfSS1TbDYtcW9lc1FJNmlYdw==:BAFmBmF1dGhvcgFmBG5hbWUBZgpwYWdlX2NvdW50AWYMcmVsZWFzZV9kYXRl+v///w8=",
+ columnar=True,
+)
+print(resp)
+----
diff --git a/docs/examples/5d5cdbd4c5c62a90ff2a39cba4a59368.asciidoc b/docs/examples/5d5cdbd4c5c62a90ff2a39cba4a59368.asciidoc
new file mode 100644
index 000000000..f1b72b6ac
--- /dev/null
+++ b/docs/examples/5d5cdbd4c5c62a90ff2a39cba4a59368.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:610
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my_search_application",
+ params={
+ "elser": True,
+ "text": True,
+ "query_string": "where is the best mountain climbing?",
+ "elser_fields": [
+ {
+ "name": "title",
+ "boost": 1
+ },
+ {
+ "name": "description",
+ "boost": 1
+ }
+ ],
+ "text_query_boost": 4,
+ "min_score": 10
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5d689d74062cddd01a0711a2fa7f23fd.asciidoc b/docs/examples/5d689d74062cddd01a0711a2fa7f23fd.asciidoc
new file mode 100644
index 000000000..0c63e3a8c
--- /dev/null
+++ b/docs/examples/5d689d74062cddd01a0711a2fa7f23fd.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/network/tracers.asciidoc:92
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "logger.org.elasticsearch.transport.TransportService.tracer": "TRACE"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5d7980d8c745abf7ea0fa573e818bd5b.asciidoc b/docs/examples/5d7980d8c745abf7ea0fa573e818bd5b.asciidoc
new file mode 100644
index 000000000..baa4af2d1
--- /dev/null
+++ b/docs/examples/5d7980d8c745abf7ea0fa573e818bd5b.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/shingle-tokenfilter.asciidoc:488
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "en": {
+ "tokenizer": "standard",
+ "filter": [
+ "my_shingle_filter"
+ ]
+ }
+ },
+ "filter": {
+ "my_shingle_filter": {
+ "type": "shingle",
+ "min_shingle_size": 2,
+ "max_shingle_size": 5,
+ "output_unigrams": False
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5d9d7b84e2fec7ecd832145cbb951cf1.asciidoc b/docs/examples/5d9d7b84e2fec7ecd832145cbb951cf1.asciidoc
index de7f4c45a..38a83ac56 100644
--- a/docs/examples/5d9d7b84e2fec7ecd832145cbb951cf1.asciidoc
+++ b/docs/examples/5d9d7b84e2fec7ecd832145cbb951cf1.asciidoc
@@ -1,22 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:600
[source, python]
----
resp = client.search(
- body={
- "size": 0,
- "aggs": {
- "expired_sessions": {
- "terms": {
- "field": "account_id",
- "include": {"partition": 0, "num_partitions": 20},
- "size": 10000,
- "order": {"last_access": "asc"},
+ size=0,
+ aggs={
+ "expired_sessions": {
+ "terms": {
+ "field": "account_id",
+ "include": {
+ "partition": 0,
+ "num_partitions": 20
},
- "aggs": {"last_access": {"max": {"field": "access_date"}}},
+ "size": 10000,
+ "order": {
+ "last_access": "asc"
+ }
+ },
+ "aggs": {
+ "last_access": {
+ "max": {
+ "field": "access_date"
+ }
+ }
}
- },
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5da6efd5b038ada64c9e853c88c1ec47.asciidoc b/docs/examples/5da6efd5b038ada64c9e853c88c1ec47.asciidoc
index 265c6cdf4..be0470b74 100644
--- a/docs/examples/5da6efd5b038ada64c9e853c88c1ec47.asciidoc
+++ b/docs/examples/5da6efd5b038ada64c9e853c88c1ec47.asciidoc
@@ -1,18 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:114
[source, python]
----
resp = client.search(
- body={
- "query": {
- "multi_match": {
- "query": "brown fox",
- "type": "best_fields",
- "fields": ["subject", "message"],
- "tie_breaker": 0.3,
- }
+ query={
+ "multi_match": {
+ "query": "brown fox",
+ "type": "best_fields",
+ "fields": [
+ "subject",
+ "message"
+ ],
+ "tie_breaker": 0.3
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5db5349162a4fbe74bffb646926a2495.asciidoc b/docs/examples/5db5349162a4fbe74bffb646926a2495.asciidoc
index b1dc76030..43631c2cb 100644
--- a/docs/examples/5db5349162a4fbe74bffb646926a2495.asciidoc
+++ b/docs/examples/5db5349162a4fbe74bffb646926a2495.asciidoc
@@ -1,22 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/range.asciidoc:357
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"my_range": {"type": "long_range"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "my_range": {
+ "type": "long_range"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"my_range": {"gt": 200, "lt": 300}},
+ document={
+ "my_range": {
+ "gt": 200,
+ "lt": 300
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/5dbf06ca9058843f572676fcaf587f75.asciidoc b/docs/examples/5dbf06ca9058843f572676fcaf587f75.asciidoc
new file mode 100644
index 000000000..32bf13cb9
--- /dev/null
+++ b/docs/examples/5dbf06ca9058843f572676fcaf587f75.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/variablewidthhistogram-aggregation.asciidoc:18
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "prices": {
+ "variable_width_histogram": {
+ "field": "price",
+ "buckets": 2
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5ddc26da6e163fda54f52d33b5157051.asciidoc b/docs/examples/5ddc26da6e163fda54f52d33b5157051.asciidoc
new file mode 100644
index 000000000..7f7e435c5
--- /dev/null
+++ b/docs/examples/5ddc26da6e163fda54f52d33b5157051.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/semantic-search/search.asciidoc:9
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "sparse_vector": {
+ "field": "my_tokens",
+ "inference_id": "my-elser-endpoint",
+ "query": "the query string"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5deeed427f35cbaee4b8ddc45002a9d7.asciidoc b/docs/examples/5deeed427f35cbaee4b8ddc45002a9d7.asciidoc
new file mode 100644
index 000000000..a5c9ef373
--- /dev/null
+++ b/docs/examples/5deeed427f35cbaee4b8ddc45002a9d7.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/bulk-delete-roles.asciidoc:72
+
+[source, python]
+----
+resp = client.security.bulk_delete_role(
+ names=[
+ "my_admin_role",
+ "not_an_existing_role"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/5df3226fdc8f1f66ae92ba2f527af8c0.asciidoc b/docs/examples/5df3226fdc8f1f66ae92ba2f527af8c0.asciidoc
new file mode 100644
index 000000000..8f09563e7
--- /dev/null
+++ b/docs/examples/5df3226fdc8f1f66ae92ba2f527af8c0.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:52
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "my_field": 5
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5dfb23f6e36ef484f1d3271bae76a8d1.asciidoc b/docs/examples/5dfb23f6e36ef484f1d3271bae76a8d1.asciidoc
new file mode 100644
index 000000000..fb4958bb8
--- /dev/null
+++ b/docs/examples/5dfb23f6e36ef484f1d3271bae76a8d1.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/recovery.asciidoc:248
+
+[source, python]
+----
+resp = client.indices.recovery(
+ human=True,
+)
+print(resp)
+----
diff --git a/docs/examples/5dfe24287bb930ad33345caf092a004b.asciidoc b/docs/examples/5dfe24287bb930ad33345caf092a004b.asciidoc
index 99da7c1b3..00fac41ec 100644
--- a/docs/examples/5dfe24287bb930ad33345caf092a004b.asciidoc
+++ b/docs/examples/5dfe24287bb930ad33345caf092a004b.asciidoc
@@ -1,11 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/exists-query.asciidoc:56
[source, python]
----
resp = client.search(
- body={
- "query": {"bool": {"must_not": {"exists": {"field": "user.id"}}}}
+ query={
+ "bool": {
+ "must_not": {
+ "exists": {
+ "field": "user.id"
+ }
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5e099493f135ff7bd614e935c4f2bf5a.asciidoc b/docs/examples/5e099493f135ff7bd614e935c4f2bf5a.asciidoc
index ab71059c0..d1f47e0f5 100644
--- a/docs/examples/5e099493f135ff7bd614e935c4f2bf5a.asciidoc
+++ b/docs/examples/5e099493f135ff7bd614e935c4f2bf5a.asciidoc
@@ -1,14 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// modules/indices/request_cache.asciidoc:86
[source, python]
----
resp = client.search(
index="my-index-000001",
- request_cache="true",
- body={
- "size": 0,
- "aggs": {"popular_colors": {"terms": {"field": "colors"}}},
+ request_cache=True,
+ size=0,
+ aggs={
+ "popular_colors": {
+ "terms": {
+ "field": "colors"
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5e124875d97c27362ae858160ae1c6d5.asciidoc b/docs/examples/5e124875d97c27362ae858160ae1c6d5.asciidoc
new file mode 100644
index 000000000..d83f724ea
--- /dev/null
+++ b/docs/examples/5e124875d97c27362ae858160ae1c6d5.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/auto-follow/get-auto-follow-pattern.asciidoc:44
+
+[source, python]
+----
+resp = client.ccr.get_auto_follow_pattern()
+print(resp)
+----
diff --git a/docs/examples/5e21dbac92f34d236a8f0cc0d3a39cdd.asciidoc b/docs/examples/5e21dbac92f34d236a8f0cc0d3a39cdd.asciidoc
new file mode 100644
index 000000000..559f8a514
--- /dev/null
+++ b/docs/examples/5e21dbac92f34d236a8f0cc0d3a39cdd.asciidoc
@@ -0,0 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/jwt-realm.asciidoc:411
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="jwt1_users",
+ refresh=True,
+ roles=[
+ "user"
+ ],
+ rules={
+ "all": [
+ {
+ "field": {
+ "realm.name": "jwt1"
+ }
+ },
+ {
+ "field": {
+ "username": "principalname1"
+ }
+ },
+ {
+ "field": {
+ "dn": "CN=Principal Name 1,DC=example.com"
+ }
+ },
+ {
+ "field": {
+ "groups": "group1"
+ }
+ },
+ {
+ "field": {
+ "metadata.jwt_claim_other": "other1"
+ }
+ }
+ ]
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/5e2f7097eb299de553d0fa0087d70a59.asciidoc b/docs/examples/5e2f7097eb299de553d0fa0087d70a59.asciidoc
new file mode 100644
index 000000000..8b1aa55cc
--- /dev/null
+++ b/docs/examples/5e2f7097eb299de553d0fa0087d70a59.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:748
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "index": {
+ "sort.field": [
+ "username",
+ "timestamp"
+ ],
+ "sort.order": [
+ "asc",
+ "desc"
+ ]
+ }
+ },
+ mappings={
+ "properties": {
+ "username": {
+ "type": "keyword",
+ "doc_values": True
+ },
+ "timestamp": {
+ "type": "date"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5e3673bcbef5731746e400c4f3fe134d.asciidoc b/docs/examples/5e3673bcbef5731746e400c4f3fe134d.asciidoc
new file mode 100644
index 000000000..6f6a9cdb5
--- /dev/null
+++ b/docs/examples/5e3673bcbef5731746e400c4f3fe134d.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-shape-query.asciidoc:262
+
+[source, python]
+----
+resp = client.index(
+ index="test",
+ id="1",
+ document={
+ "location": [
+ {
+ "coordinates": [
+ 46.25,
+ 20.14
+ ],
+ "type": "point"
+ },
+ {
+ "coordinates": [
+ 47.49,
+ 19.04
+ ],
+ "type": "point"
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5e415c490a46358643ee2aab554b4876.asciidoc b/docs/examples/5e415c490a46358643ee2aab554b4876.asciidoc
new file mode 100644
index 000000000..b86c34e4d
--- /dev/null
+++ b/docs/examples/5e415c490a46358643ee2aab554b4876.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:57
+
+[source, python]
+----
+resp = client.cluster.allocation_explain(
+ filter_path="index,node_allocation_decisions.node_name,node_allocation_decisions.deciders.*",
+ index="my-index",
+ shard=0,
+ primary=False,
+)
+print(resp)
+----
diff --git a/docs/examples/5e47a407b6ca29dadf6eac5ab1d71163.asciidoc b/docs/examples/5e47a407b6ca29dadf6eac5ab1d71163.asciidoc
new file mode 100644
index 000000000..ea0b961c9
--- /dev/null
+++ b/docs/examples/5e47a407b6ca29dadf6eac5ab1d71163.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-polygon-query.asciidoc:12
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_polygon": {
+ "person.location": {
+ "points": [
+ {
+ "lat": 40,
+ "lon": -70
+ },
+ {
+ "lat": 30,
+ "lon": -80
+ },
+ {
+ "lat": 20,
+ "lon": -90
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5e6419bc3e2db0d0f05bce58d8cc9215.asciidoc b/docs/examples/5e6419bc3e2db0d0f05bce58d8cc9215.asciidoc
new file mode 100644
index 000000000..c3fbbc4a7
--- /dev/null
+++ b/docs/examples/5e6419bc3e2db0d0f05bce58d8cc9215.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:669
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "rename": {
+ "description": "Rename 'provider' to 'cloud.provider'",
+ "field": "provider",
+ "target_field": "cloud.provider",
+ "on_failure": [
+ {
+ "set": {
+ "description": "Set 'error.message'",
+ "field": "error.message",
+ "value": "Field 'provider' does not exist. Cannot rename to 'cloud.provider'",
+ "override": False
+ }
+ }
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/5e87dd38ac3a0fd59ad794005b16d13e.asciidoc b/docs/examples/5e87dd38ac3a0fd59ad794005b16d13e.asciidoc
new file mode 100644
index 000000000..ffb9e6141
--- /dev/null
+++ b/docs/examples/5e87dd38ac3a0fd59ad794005b16d13e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:353
+
+[source, python]
+----
+resp = client.slm.get_lifecycle(
+ policy_id="nightly-snapshots",
+)
+print(resp)
+----
diff --git a/docs/examples/5e9a7845e60b79685aab59877c5fbd1a.asciidoc b/docs/examples/5e9a7845e60b79685aab59877c5fbd1a.asciidoc
new file mode 100644
index 000000000..15806d7f7
--- /dev/null
+++ b/docs/examples/5e9a7845e60b79685aab59877c5fbd1a.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/ignored-field.asciidoc:51
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "ignored_fields": {
+ "terms": {
+ "field": "_ignored"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5ea9da129ca70a5fe534f27a82d80b29.asciidoc b/docs/examples/5ea9da129ca70a5fe534f27a82d80b29.asciidoc
new file mode 100644
index 000000000..a84be9f9e
--- /dev/null
+++ b/docs/examples/5ea9da129ca70a5fe534f27a82d80b29.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:669
+
+[source, python]
+----
+resp = client.indices.create(
+ index="example",
+ mappings={
+ "properties": {
+ "comment": {
+ "type": "text",
+ "index_options": "offsets"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5f031b7bd2b7d98d2d10df7420d269ff.asciidoc b/docs/examples/5f031b7bd2b7d98d2d10df7420d269ff.asciidoc
new file mode 100644
index 000000000..684ee3f6d
--- /dev/null
+++ b/docs/examples/5f031b7bd2b7d98d2d10df7420d269ff.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:407
+
+[source, python]
+----
+resp = client.indices.resolve_index(
+ name="new-data-stream*",
+)
+print(resp)
+----
diff --git a/docs/examples/5f1ed9cfdc149763b444acfbe10b0e16.asciidoc b/docs/examples/5f1ed9cfdc149763b444acfbe10b0e16.asciidoc
index df119127d..4b346a298 100644
--- a/docs/examples/5f1ed9cfdc149763b444acfbe10b0e16.asciidoc
+++ b/docs/examples/5f1ed9cfdc149763b444acfbe10b0e16.asciidoc
@@ -1,16 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:265
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "user_id": {"type": "keyword", "ignore_above": 20}
+ mappings={
+ "properties": {
+ "user_id": {
+ "type": "keyword",
+ "ignore_above": 20
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5f3373887e8d3dc31239b687a5151449.asciidoc b/docs/examples/5f3373887e8d3dc31239b687a5151449.asciidoc
new file mode 100644
index 000000000..9f2599d6b
--- /dev/null
+++ b/docs/examples/5f3373887e8d3dc31239b687a5151449.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/coerce.asciidoc:19
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "number_one": {
+ "type": "integer"
+ },
+ "number_two": {
+ "type": "integer",
+ "coerce": False
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "number_one": "10"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="my-index-000001",
+ id="2",
+ document={
+ "number_two": "10"
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/5f3549ac7fee94682ca0d7439eebdd2a.asciidoc b/docs/examples/5f3549ac7fee94682ca0d7439eebdd2a.asciidoc
new file mode 100644
index 000000000..7ce071786
--- /dev/null
+++ b/docs/examples/5f3549ac7fee94682ca0d7439eebdd2a.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:233
+
+[source, python]
+----
+resp = client.search(
+ index="index_long,index_double",
+ sort=[
+ {
+ "field": {
+ "numeric_type": "date_nanos"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/5f72ab800c3db9d118df95e2a378d411.asciidoc b/docs/examples/5f72ab800c3db9d118df95e2a378d411.asciidoc
new file mode 100644
index 000000000..b982ac7a9
--- /dev/null
+++ b/docs/examples/5f72ab800c3db9d118df95e2a378d411.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/alias-privileges.asciidoc:59
+
+[source, python]
+----
+resp = client.get(
+ index=".ds-my-data-stream-2099.03.09-000003",
+ id="2",
+)
+print(resp)
+----
diff --git a/docs/examples/5f7b59d4fad0bdce6b09abb520ddb51d.asciidoc b/docs/examples/5f7b59d4fad0bdce6b09abb520ddb51d.asciidoc
new file mode 100644
index 000000000..579308dd6
--- /dev/null
+++ b/docs/examples/5f7b59d4fad0bdce6b09abb520ddb51d.asciidoc
@@ -0,0 +1,50 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/use-elasticsearch-for-time-series-data.asciidoc:101
+
+[source, python]
+----
+resp = client.search(
+ index="my-data-stream",
+ runtime_mappings={
+ "source.ip": {
+ "type": "ip",
+ "script": "\n String sourceip=grok('%{IPORHOST:sourceip} .*').extract(doc[ \"message\" ].value)?.sourceip;\n if (sourceip != null) emit(sourceip);\n "
+ }
+ },
+ query={
+ "bool": {
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "now-1d/d",
+ "lt": "now/d"
+ }
+ }
+ },
+ {
+ "range": {
+ "source.ip": {
+ "gte": "192.0.2.0",
+ "lte": "192.0.2.255"
+ }
+ }
+ }
+ ]
+ }
+ },
+ fields=[
+ "*"
+ ],
+ source=False,
+ sort=[
+ {
+ "@timestamp": "desc"
+ },
+ {
+ "source.ip": "desc"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/5f8acd1e367b048b5542dbc6079bcc88.asciidoc b/docs/examples/5f8acd1e367b048b5542dbc6079bcc88.asciidoc
new file mode 100644
index 000000000..5b8040c61
--- /dev/null
+++ b/docs/examples/5f8acd1e367b048b5542dbc6079bcc88.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/hyphenation-decompounder-tokenfilter.asciidoc:132
+
+[source, python]
+----
+resp = client.indices.create(
+ index="hyphenation_decompound_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_hyphenation_decompound": {
+ "tokenizer": "standard",
+ "filter": [
+ "22_char_hyphenation_decompound"
+ ]
+ }
+ },
+ "filter": {
+ "22_char_hyphenation_decompound": {
+ "type": "hyphenation_decompounder",
+ "word_list_path": "analysis/example_word_list.txt",
+ "hyphenation_patterns_path": "analysis/hyphenation_patterns.xml",
+ "max_subword_size": 22
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/5f8d90515995a5eee189d722abe3b111.asciidoc b/docs/examples/5f8d90515995a5eee189d722abe3b111.asciidoc
new file mode 100644
index 000000000..42081a588
--- /dev/null
+++ b/docs/examples/5f8d90515995a5eee189d722abe3b111.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc:145
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="azure_ai_studio_embeddings",
+ processors=[
+ {
+ "inference": {
+ "model_id": "azure_ai_studio_embeddings",
+ "input_output": {
+ "input_field": "content",
+ "output_field": "content_embedding"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/5f8fb5513d4f725434db2f517ad4298f.asciidoc b/docs/examples/5f8fb5513d4f725434db2f517ad4298f.asciidoc
index 730df13b0..08e6c6870 100644
--- a/docs/examples/5f8fb5513d4f725434db2f517ad4298f.asciidoc
+++ b/docs/examples/5f8fb5513d4f725434db2f517ad4298f.asciidoc
@@ -1,30 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/similarity.asciidoc:357
[source, python]
----
resp = client.indices.create(
index="index",
- body={
- "settings": {
- "number_of_shards": 1,
- "similarity": {
- "scripted_tfidf": {
- "type": "scripted",
- "weight_script": {
- "source": "double idf = Math.log((field.docCount+1.0)/(term.docFreq+1.0)) + 1.0; return query.boost * idf;"
- },
- "script": {
- "source": "double tf = Math.sqrt(doc.freq); double norm = 1/Math.sqrt(doc.length); return weight * tf * norm;"
- },
+ settings={
+ "number_of_shards": 1,
+ "similarity": {
+ "scripted_tfidf": {
+ "type": "scripted",
+ "weight_script": {
+ "source": "double idf = Math.log((field.docCount+1.0)/(term.docFreq+1.0)) + 1.0; return query.boost * idf;"
+ },
+ "script": {
+ "source": "double tf = Math.sqrt(doc.freq); double norm = 1/Math.sqrt(doc.length); return weight * tf * norm;"
}
- },
- },
- "mappings": {
- "properties": {
- "field": {"type": "text", "similarity": "scripted_tfidf"}
}
- },
+ }
+ },
+ mappings={
+ "properties": {
+ "field": {
+ "type": "text",
+ "similarity": "scripted_tfidf"
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/5faa121e00a0582160b2adb2b72fed67.asciidoc b/docs/examples/5faa121e00a0582160b2adb2b72fed67.asciidoc
new file mode 100644
index 000000000..6342a01eb
--- /dev/null
+++ b/docs/examples/5faa121e00a0582160b2adb2b72fed67.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-settings.asciidoc:92
+
+[source, python]
+----
+resp = client.indices.get_settings(
+ index="log_2099_-*",
+ name="index.number_*",
+)
+print(resp)
+----
diff --git a/docs/examples/5fca6671bc8eaddc44ac488d1c3c6909.asciidoc b/docs/examples/5fca6671bc8eaddc44ac488d1c3c6909.asciidoc
new file mode 100644
index 000000000..f3234a306
--- /dev/null
+++ b/docs/examples/5fca6671bc8eaddc44ac488d1c3c6909.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-calendar.asciidoc:89
+
+[source, python]
+----
+resp = client.ml.get_calendars(
+ calendar_id="planned-outages",
+)
+print(resp)
+----
diff --git a/docs/examples/5fde0d78e9b2cc0519f8a63848ed344e.asciidoc b/docs/examples/5fde0d78e9b2cc0519f8a63848ed344e.asciidoc
new file mode 100644
index 000000000..74cfdcf7b
--- /dev/null
+++ b/docs/examples/5fde0d78e9b2cc0519f8a63848ed344e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// query-rules/apis/get-query-ruleset.asciidoc:102
+
+[source, python]
+----
+resp = client.query_rules.get_ruleset(
+ ruleset_id="my-ruleset",
+)
+print(resp)
+----
diff --git a/docs/examples/5ffe6fd303400e8678fa1ead291e237f.asciidoc b/docs/examples/5ffe6fd303400e8678fa1ead291e237f.asciidoc
new file mode 100644
index 000000000..cf74a00db
--- /dev/null
+++ b/docs/examples/5ffe6fd303400e8678fa1ead291e237f.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-aggregation.asciidoc:30
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_outlier": {
+ "percentiles": {
+ "field": "load_time"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/600d33c80f8872dda85c87ed41da95fd.asciidoc b/docs/examples/600d33c80f8872dda85c87ed41da95fd.asciidoc
new file mode 100644
index 000000000..14e36ade6
--- /dev/null
+++ b/docs/examples/600d33c80f8872dda85c87ed41da95fd.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-search.asciidoc:343
+
+[source, python]
+----
+resp = client.search(
+ index="azure-ai-studio-embeddings",
+ knn={
+ "field": "content_embedding",
+ "query_vector_builder": {
+ "text_embedding": {
+ "model_id": "azure_ai_studio_embeddings",
+ "model_text": "Calculate fuel cost"
+ }
+ },
+ "k": 10,
+ "num_candidates": 100
+ },
+ source=[
+ "id",
+ "content"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/6013ed65d2058da5ce704b47a504b60a.asciidoc b/docs/examples/6013ed65d2058da5ce704b47a504b60a.asciidoc
new file mode 100644
index 000000000..f5d46db5f
--- /dev/null
+++ b/docs/examples/6013ed65d2058da5ce704b47a504b60a.asciidoc
@@ -0,0 +1,53 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/top-metrics-aggregation.asciidoc:222
+
+[source, python]
+----
+resp = client.bulk(
+ index="test",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "s": 1,
+ "m": 3.1415
+ },
+ {
+ "index": {}
+ },
+ {
+ "s": 2,
+ "m": 1
+ },
+ {
+ "index": {}
+ },
+ {
+ "s": 3,
+ "m": 2.71828
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.search(
+ index="test",
+ filter_path="aggregations",
+ aggs={
+ "tm": {
+ "top_metrics": {
+ "metrics": {
+ "field": "m"
+ },
+ "sort": {
+ "s": "desc"
+ },
+ "size": 3
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/601ad3b0ceccb3fcd282e5ec36748954.asciidoc b/docs/examples/601ad3b0ceccb3fcd282e5ec36748954.asciidoc
new file mode 100644
index 000000000..41fbc65df
--- /dev/null
+++ b/docs/examples/601ad3b0ceccb3fcd282e5ec36748954.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-service-credentials.asciidoc:59
+
+[source, python]
+----
+resp = client.security.get_service_credentials(
+ namespace="elastic",
+ service="fleet-server",
+)
+print(resp)
+----
diff --git a/docs/examples/60299454aa19fec15a604a0dd06fe522.asciidoc b/docs/examples/60299454aa19fec15a604a0dd06fe522.asciidoc
new file mode 100644
index 000000000..40d51872a
--- /dev/null
+++ b/docs/examples/60299454aa19fec15a604a0dd06fe522.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/disk/increase-other-node-capacity.asciidoc:27
+
+[source, python]
+----
+resp = client.cluster.get_settings(
+ include_defaults=True,
+ filter_path="*.cluster.routing.allocation.disk.watermark.high*",
+)
+print(resp)
+----
diff --git a/docs/examples/602e04051c092cf77de2f75a563661b8.asciidoc b/docs/examples/602e04051c092cf77de2f75a563661b8.asciidoc
new file mode 100644
index 000000000..4d7617acd
--- /dev/null
+++ b/docs/examples/602e04051c092cf77de2f75a563661b8.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat.asciidoc:57
+
+[source, python]
+----
+resp = client.cat.master(
+ help=True,
+)
+print(resp)
+----
diff --git a/docs/examples/604da59fe41160efa10a846a9dacc07a.asciidoc b/docs/examples/604da59fe41160efa10a846a9dacc07a.asciidoc
new file mode 100644
index 000000000..b25e552f6
--- /dev/null
+++ b/docs/examples/604da59fe41160efa10a846a9dacc07a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/get-async-eql-status-api.asciidoc:18
+
+[source, python]
+----
+resp = client.eql.get_status(
+ id="FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
+)
+print(resp)
+----
diff --git a/docs/examples/6061aadb3b870791278212d1e8f52b39.asciidoc b/docs/examples/6061aadb3b870791278212d1e8f52b39.asciidoc
new file mode 100644
index 000000000..7a90e38ee
--- /dev/null
+++ b/docs/examples/6061aadb3b870791278212d1e8f52b39.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/common/apis/get-ml-memory.asciidoc:228
+
+[source, python]
+----
+resp = client.ml.get_memory_stats(
+ human=True,
+)
+print(resp)
+----
diff --git a/docs/examples/608cadc6b8a3f194612b69279ccc96de.asciidoc b/docs/examples/608cadc6b8a3f194612b69279ccc96de.asciidoc
new file mode 100644
index 000000000..0641dfe56
--- /dev/null
+++ b/docs/examples/608cadc6b8a3f194612b69279ccc96de.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:728
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my_search_application",
+ search_application={
+ "indices": [
+ "index1"
+ ],
+ "template": {
+ "script": {
+ "lang": "mustache",
+ "source": "\n {\n \"query\": {\n \"script_score\": {\n \"query\": {\n \"bool\": {\n \"filter\": {\n \"range\": {\n \"{{field}}\": {\n \"{{operator}}\": {{value}}\n }\n }\n }\n }\n },\n \"script\": {\n \"source\": \"cosineSimilarity({{#toJson}}query_vector{{/toJson}}, '{{dense_vector_field}}') + 1.0\"\n }\n }\n }\n }\n ",
+ "params": {
+ "field": "price",
+ "operator": "gte",
+ "value": 1000,
+ "dense_vector_field": "product-vector",
+ "query_vector": []
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6097ae69c64454a92a89ef01b994e9f9.asciidoc b/docs/examples/6097ae69c64454a92a89ef01b994e9f9.asciidoc
new file mode 100644
index 000000000..4cad7c0a3
--- /dev/null
+++ b/docs/examples/6097ae69c64454a92a89ef01b994e9f9.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// synonyms/apis/put-synonym-rule.asciidoc:145
+
+[source, python]
+----
+resp = client.synonyms.put_synonym_rule(
+ set_id="my-synonyms-set",
+ rule_id="test-1",
+ synonyms="hello => hi => howdy",
+)
+print(resp)
+----
diff --git a/docs/examples/60a9aa5dcde9023901f6ff27231a10c4.asciidoc b/docs/examples/60a9aa5dcde9023901f6ff27231a10c4.asciidoc
new file mode 100644
index 000000000..b34407ff9
--- /dev/null
+++ b/docs/examples/60a9aa5dcde9023901f6ff27231a10c4.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significanttext-aggregation.asciidoc:417
+
+[source, python]
+----
+resp = client.search(
+ index="news",
+ query={
+ "match": {
+ "content": "madrid"
+ }
+ },
+ aggs={
+ "tags": {
+ "significant_text": {
+ "field": "content",
+ "background_filter": {
+ "term": {
+ "content": "spain"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/60b0fc1b6ae418621ff1b31591fa1fce.asciidoc b/docs/examples/60b0fc1b6ae418621ff1b31591fa1fce.asciidoc
new file mode 100644
index 000000000..9d4be1118
--- /dev/null
+++ b/docs/examples/60b0fc1b6ae418621ff1b31591fa1fce.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/example-watches/example-watch-clusterstatus.asciidoc:280
+
+[source, python]
+----
+resp = client.watcher.delete_watch(
+ id="cluster_health_watch",
+)
+print(resp)
+----
diff --git a/docs/examples/60cab62af1540db2ad3b696b0ee1d7a8.asciidoc b/docs/examples/60cab62af1540db2ad3b696b0ee1d7a8.asciidoc
index 0c5d1ad7f..dd0fe36f2 100644
--- a/docs/examples/60cab62af1540db2ad3b696b0ee1d7a8.asciidoc
+++ b/docs/examples/60cab62af1540db2ad3b696b0ee1d7a8.asciidoc
@@ -1,17 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:165
[source, python]
----
resp = client.search(
index="queries",
- body={
- "query": {
- "percolate": {
- "field": "query",
- "document": {"body": "fox jumps over the lazy dog"},
+ query={
+ "percolate": {
+ "field": "query",
+ "document": {
+ "body": "fox jumps over the lazy dog"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/60d689aae3f8de1e6830329dfd69a6a6.asciidoc b/docs/examples/60d689aae3f8de1e6830329dfd69a6a6.asciidoc
new file mode 100644
index 000000000..444a6765b
--- /dev/null
+++ b/docs/examples/60d689aae3f8de1e6830329dfd69a6a6.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-reindex.asciidoc:184
+
+[source, python]
+----
+resp = client.reindex(
+ wait_for_completion=False,
+ source={
+ "index": "test-data",
+ "size": 50
+ },
+ dest={
+ "index": "amazon-bedrock-embeddings",
+ "pipeline": "amazon_bedrock_embeddings"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/60f889fbed5df3185444f7015b48ed76.asciidoc b/docs/examples/60f889fbed5df3185444f7015b48ed76.asciidoc
index 5c91acda8..f0991a95c 100644
--- a/docs/examples/60f889fbed5df3185444f7015b48ed76.asciidoc
+++ b/docs/examples/60f889fbed5df3185444f7015b48ed76.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// indices/create-index.asciidoc:10
[source, python]
@@ -6,4 +7,4 @@ resp = client.indices.create(
index="my-index-000001",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/610f629d0486a64546d62402a0a5e00f.asciidoc b/docs/examples/610f629d0486a64546d62402a0a5e00f.asciidoc
new file mode 100644
index 000000000..230ffa85a
--- /dev/null
+++ b/docs/examples/610f629d0486a64546d62402a0a5e00f.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/query-string-syntax.asciidoc:296
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "query_string": {
+ "query": "kimchy\\!",
+ "fields": [
+ "user.id"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/611c1e05f4ebb48a1a8c8488238ce34d.asciidoc b/docs/examples/611c1e05f4ebb48a1a8c8488238ce34d.asciidoc
new file mode 100644
index 000000000..c03987dcd
--- /dev/null
+++ b/docs/examples/611c1e05f4ebb48a1a8c8488238ce34d.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:109
+
+[source, python]
+----
+resp = client.cluster.reroute(
+ metric="none",
+)
+print(resp)
+----
diff --git a/docs/examples/612c2e975f833de9815651135735eae5.asciidoc b/docs/examples/612c2e975f833de9815651135735eae5.asciidoc
new file mode 100644
index 000000000..b3e378bbb
--- /dev/null
+++ b/docs/examples/612c2e975f833de9815651135735eae5.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/tasks.asciidoc:247
+
+[source, python]
+----
+resp = client.tasks.cancel(
+ nodes="nodeId1,nodeId2",
+ actions="*reindex",
+)
+print(resp)
+----
diff --git a/docs/examples/618c9d42284c067891fb57034a4fd834.asciidoc b/docs/examples/618c9d42284c067891fb57034a4fd834.asciidoc
new file mode 100644
index 000000000..cb2e2f133
--- /dev/null
+++ b/docs/examples/618c9d42284c067891fb57034a4fd834.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/start-job.asciidoc:50
+
+[source, python]
+----
+resp = client.rollup.start_job(
+ id="sensor",
+)
+print(resp)
+----
diff --git a/docs/examples/61bf6ac15ae3e22323454a9a2872a2fa.asciidoc b/docs/examples/61bf6ac15ae3e22323454a9a2872a2fa.asciidoc
new file mode 100644
index 000000000..b850a30c5
--- /dev/null
+++ b/docs/examples/61bf6ac15ae3e22323454a9a2872a2fa.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/cardinality-aggregation.asciidoc:13
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "type_count": {
+ "cardinality": {
+ "field": "type"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/61c49cee90c6aa0eafbdd5cc03936e7d.asciidoc b/docs/examples/61c49cee90c6aa0eafbdd5cc03936e7d.asciidoc
index ff89fcb84..21aa8ea75 100644
--- a/docs/examples/61c49cee90c6aa0eafbdd5cc03936e7d.asciidoc
+++ b/docs/examples/61c49cee90c6aa0eafbdd5cc03936e7d.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic-mapping.asciidoc:11
[source, python]
@@ -5,7 +6,9 @@
resp = client.index(
index="data",
id="1",
- body={"count": 5},
+ document={
+ "count": 5
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/61d6b9503459914c436930c3ae87d454.asciidoc b/docs/examples/61d6b9503459914c436930c3ae87d454.asciidoc
new file mode 100644
index 000000000..12f47766f
--- /dev/null
+++ b/docs/examples/61d6b9503459914c436930c3ae87d454.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// query-rules/apis/list-query-rulesets.asciidoc:165
+
+[source, python]
+----
+resp = client.query_rules.list_rulesets(
+ from_="0",
+ size="3",
+)
+print(resp)
+----
diff --git a/docs/examples/61e38e95191f4dde791070c6fce8a092.asciidoc b/docs/examples/61e38e95191f4dde791070c6fce8a092.asciidoc
new file mode 100644
index 000000000..a13434633
--- /dev/null
+++ b/docs/examples/61e38e95191f4dde791070c6fce8a092.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/movfn-aggregation.asciidoc:546
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "the_movavg": {
+ "moving_fn": {
+ "buckets_path": "the_sum",
+ "window": 10,
+ "script": "MovingFunctions.holt(values, 0.3, 0.1)"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/621665fdbd7fc103c09bfeed28b67b1a.asciidoc b/docs/examples/621665fdbd7fc103c09bfeed28b67b1a.asciidoc
new file mode 100644
index 000000000..a65639bf0
--- /dev/null
+++ b/docs/examples/621665fdbd7fc103c09bfeed28b67b1a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/common-options.asciidoc:150
+
+[source, python]
+----
+resp = client.count(
+ filter_path="-_shards",
+)
+print(resp)
+----
diff --git a/docs/examples/621f4553e24592d40c8cdbbdfaeb027e.asciidoc b/docs/examples/621f4553e24592d40c8cdbbdfaeb027e.asciidoc
new file mode 100644
index 000000000..b483bb165
--- /dev/null
+++ b/docs/examples/621f4553e24592d40c8cdbbdfaeb027e.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:387
+
+[source, python]
+----
+resp = client.search(
+ index="image-index",
+ knn={
+ "field": "image-vector",
+ "query_vector": [
+ 54,
+ 10,
+ -2
+ ],
+ "k": 5,
+ "num_candidates": 50,
+ "filter": {
+ "term": {
+ "file-type": "png"
+ }
+ }
+ },
+ fields=[
+ "title"
+ ],
+ source=False,
+)
+print(resp)
+----
diff --git a/docs/examples/6220087321e6d288024a70c6b09bd720.asciidoc b/docs/examples/6220087321e6d288024a70c6b09bd720.asciidoc
new file mode 100644
index 000000000..b7f8b8531
--- /dev/null
+++ b/docs/examples/6220087321e6d288024a70c6b09bd720.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:358
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="4",
+ refresh=True,
+ document={
+ "query": {
+ "match": {
+ "message": "lazy dog"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6244204213f60edf2f23295f9059f2c9.asciidoc b/docs/examples/6244204213f60edf2f23295f9059f2c9.asciidoc
new file mode 100644
index 000000000..eacb1ead7
--- /dev/null
+++ b/docs/examples/6244204213f60edf2f23295f9059f2c9.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/stats.asciidoc:163
+
+[source, python]
+----
+resp = client.watcher.stats(
+ metric="queued_watches",
+)
+print(resp)
+----
diff --git a/docs/examples/624e69dedf42c4877234b87ec1d00068.asciidoc b/docs/examples/624e69dedf42c4877234b87ec1d00068.asciidoc
new file mode 100644
index 000000000..f670c427c
--- /dev/null
+++ b/docs/examples/624e69dedf42c4877234b87ec1d00068.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/snapshot/repeated-snapshot-failures.asciidoc:105
+
+[source, python]
+----
+resp = client.slm.get_lifecycle(
+ policy_id="",
+)
+print(resp)
+----
diff --git a/docs/examples/62c311e7ab4de8b79e532929a5069975.asciidoc b/docs/examples/62c311e7ab4de8b79e532929a5069975.asciidoc
index f8e5c21b8..447e27646 100644
--- a/docs/examples/62c311e7ab4de8b79e532929a5069975.asciidoc
+++ b/docs/examples/62c311e7ab4de8b79e532929a5069975.asciidoc
@@ -1,58 +1,83 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/rank-features.asciidoc:16
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "topics": {"type": "rank_features"},
- "negative_reviews": {
- "type": "rank_features",
- "positive_score_impact": False,
- },
+ mappings={
+ "properties": {
+ "topics": {
+ "type": "rank_features"
+ },
+ "negative_reviews": {
+ "type": "rank_features",
+ "positive_score_impact": False
}
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={
- "topics": {"politics": 20, "economics": 50.8},
- "negative_reviews": {"1star": 10, "2star": 100},
+ document={
+ "topics": {
+ "politics": 20,
+ "economics": 50.8
+ },
+ "negative_reviews": {
+ "1star": 10,
+ "2star": 100
+ }
},
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="my-index-000001",
id="2",
- body={
- "topics": {"politics": 5.2, "sports": 80.1},
- "negative_reviews": {"1star": 1, "2star": 10},
+ document={
+ "topics": {
+ "politics": 5.2,
+ "sports": 80.1
+ },
+ "negative_reviews": {
+ "1star": 1,
+ "2star": 10
+ }
},
)
-print(resp)
+print(resp2)
-resp = client.search(
+resp3 = client.search(
index="my-index-000001",
- body={"query": {"rank_feature": {"field": "topics.politics"}}},
+ query={
+ "rank_feature": {
+ "field": "topics.politics"
+ }
+ },
)
-print(resp)
+print(resp3)
-resp = client.search(
+resp4 = client.search(
index="my-index-000001",
- body={"query": {"rank_feature": {"field": "negative_reviews.1star"}}},
+ query={
+ "rank_feature": {
+ "field": "negative_reviews.1star"
+ }
+ },
)
-print(resp)
+print(resp4)
-resp = client.search(
+resp5 = client.search(
index="my-index-000001",
- body={"query": {"term": {"topics": "economics"}}},
+ query={
+ "term": {
+ "topics": "economics"
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp5)
+----
diff --git a/docs/examples/62ccee6ad356428c2d625742f961ceb7.asciidoc b/docs/examples/62ccee6ad356428c2d625742f961ceb7.asciidoc
new file mode 100644
index 000000000..d94a8ced9
--- /dev/null
+++ b/docs/examples/62ccee6ad356428c2d625742f961ceb7.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/update-api-key.asciidoc:200
+
+[source, python]
+----
+resp = client.security.update_api_key(
+ id="VuaCfGcBCdbkQm-e5aOx",
+ role_descriptors={},
+)
+print(resp)
+----
diff --git a/docs/examples/62d3c8fccb11471bdc12555c1a7777f2.asciidoc b/docs/examples/62d3c8fccb11471bdc12555c1a7777f2.asciidoc
new file mode 100644
index 000000000..2c535f041
--- /dev/null
+++ b/docs/examples/62d3c8fccb11471bdc12555c1a7777f2.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/synthetic-source.asciidoc:89
+
+[source, python]
+----
+resp = client.index(
+ index="idx",
+ id="1",
+ document={
+ "foo": [
+ {
+ "bar": 1
+ },
+ {
+ "baz": 2
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/62eafc5b3ab75cc67314d5a8567d6077.asciidoc b/docs/examples/62eafc5b3ab75cc67314d5a8567d6077.asciidoc
new file mode 100644
index 000000000..1af60a98f
--- /dev/null
+++ b/docs/examples/62eafc5b3ab75cc67314d5a8567d6077.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:225
+
+[source, python]
+----
+resp = client.security.get_api_key(
+ username="myuser",
+)
+print(resp)
+----
diff --git a/docs/examples/62f1ec1bb5cc5a9c2efd536a7474f549.asciidoc b/docs/examples/62f1ec1bb5cc5a9c2efd536a7474f549.asciidoc
new file mode 100644
index 000000000..7833fd86c
--- /dev/null
+++ b/docs/examples/62f1ec1bb5cc5a9c2efd536a7474f549.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/hunspell-tokenfilter.asciidoc:73
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ {
+ "type": "hunspell",
+ "locale": "en_US"
+ }
+ ],
+ text="the foxes jumping quickly",
+)
+print(resp)
+----
diff --git a/docs/examples/630d127ccedd25a6cff31ea098ac2847.asciidoc b/docs/examples/630d127ccedd25a6cff31ea098ac2847.asciidoc
new file mode 100644
index 000000000..bff63ee62
--- /dev/null
+++ b/docs/examples/630d127ccedd25a6cff31ea098ac2847.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/t-test-aggregation.asciidoc:86
+
+[source, python]
+----
+resp = client.search(
+ index="node_upgrade",
+ size=0,
+ aggs={
+ "startup_time_ttest": {
+ "t_test": {
+ "a": {
+ "field": "startup_time_before",
+ "filter": {
+ "term": {
+ "group": "A"
+ }
+ }
+ },
+ "b": {
+ "field": "startup_time_before",
+ "filter": {
+ "term": {
+ "group": "B"
+ }
+ }
+ },
+ "type": "heteroscedastic"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6326f5c6fd2a6e6b1aff9a643b94f455.asciidoc b/docs/examples/6326f5c6fd2a6e6b1aff9a643b94f455.asciidoc
new file mode 100644
index 000000000..297ae195e
--- /dev/null
+++ b/docs/examples/6326f5c6fd2a6e6b1aff9a643b94f455.asciidoc
@@ -0,0 +1,47 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/fields.asciidoc:50
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "text": "quick brown fox",
+ "popularity": 1
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="2",
+ refresh=True,
+ document={
+ "text": "quick fox",
+ "popularity": 5
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ query={
+ "function_score": {
+ "query": {
+ "match": {
+ "text": "quick brown fox"
+ }
+ },
+ "script_score": {
+ "script": {
+ "lang": "expression",
+ "source": "_score * doc['popularity']"
+ }
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/633c8a9fc57268979d8735c557705809.asciidoc b/docs/examples/633c8a9fc57268979d8735c557705809.asciidoc
index dad960817..d9a6eaf22 100644
--- a/docs/examples/633c8a9fc57268979d8735c557705809.asciidoc
+++ b/docs/examples/633c8a9fc57268979d8735c557705809.asciidoc
@@ -1,22 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/keyword.asciidoc:219
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"kwd": {"type": "keyword", "store": True}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "kwd": {
+ "type": "keyword",
+ "store": True
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"kwd": ["foo", "foo", "bar", "baz"]},
+ document={
+ "kwd": [
+ "foo",
+ "foo",
+ "bar",
+ "baz"
+ ]
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/634ecacf14b83c5f0bb8b6273cf6418e.asciidoc b/docs/examples/634ecacf14b83c5f0bb8b6273cf6418e.asciidoc
new file mode 100644
index 000000000..401eb5f1f
--- /dev/null
+++ b/docs/examples/634ecacf14b83c5f0bb8b6273cf6418e.asciidoc
@@ -0,0 +1,63 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-security.asciidoc:128
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="website-product-search",
+ search_application={
+ "indices": [
+ "website-products"
+ ],
+ "template": {
+ "script": {
+ "source": {
+ "query": {
+ "term": {
+ "{{field_name}}": "{{field_value}}"
+ }
+ },
+ "aggs": {
+ "color_facet": {
+ "terms": {
+ "field": "color",
+ "size": "{{agg_size}}"
+ }
+ }
+ }
+ },
+ "params": {
+ "field_name": "product_name",
+ "field_value": "hello world",
+ "agg_size": 5
+ }
+ },
+ "dictionary": {
+ "properties": {
+ "field_name": {
+ "type": "string",
+ "enum": [
+ "name",
+ "color",
+ "description"
+ ]
+ },
+ "field_value": {
+ "type": "string"
+ },
+ "agg_size": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 10
+ }
+ },
+ "required": [
+ "field_name"
+ ],
+ "additionalProperties": False
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/63521e0089c631d6668c44a0a9d7fdcc.asciidoc b/docs/examples/63521e0089c631d6668c44a0a9d7fdcc.asciidoc
new file mode 100644
index 000000000..27bf958e0
--- /dev/null
+++ b/docs/examples/63521e0089c631d6668c44a0a9d7fdcc.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/limit-token-count-tokenfilter.asciidoc:123
+
+[source, python]
+----
+resp = client.indices.create(
+ index="custom_limit_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_five_token_limit": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "five_token_limit"
+ ]
+ }
+ },
+ "filter": {
+ "five_token_limit": {
+ "type": "limit",
+ "max_token_count": 5
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6352e846bb83725ae6d853aa64d8697d.asciidoc b/docs/examples/6352e846bb83725ae6d853aa64d8697d.asciidoc
new file mode 100644
index 000000000..d6a5df3a1
--- /dev/null
+++ b/docs/examples/6352e846bb83725ae6d853aa64d8697d.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-distance-query.asciidoc:158
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_distance": {
+ "distance": "12km",
+ "pin.location": {
+ "lat": 40,
+ "lon": -70
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6365312d470426cab1b77e9ffde49170.asciidoc b/docs/examples/6365312d470426cab1b77e9ffde49170.asciidoc
new file mode 100644
index 000000000..fc86d0dae
--- /dev/null
+++ b/docs/examples/6365312d470426cab1b77e9ffde49170.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/document-level-security.asciidoc:30
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="click_role",
+ indices=[
+ {
+ "names": [
+ "events-*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "query": "{\"match\": {\"category\": \"click\"}}"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/636ee2066450605247ec1f68d04b8ee4.asciidoc b/docs/examples/636ee2066450605247ec1f68d04b8ee4.asciidoc
index 9fa46eb89..f80d11e67 100644
--- a/docs/examples/636ee2066450605247ec1f68d04b8ee4.asciidoc
+++ b/docs/examples/636ee2066450605247ec1f68d04b8ee4.asciidoc
@@ -1,13 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1467
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "query": {"match": {"http.clientip": "40.135.0.0"}},
- "fields": ["*"],
+ query={
+ "match": {
+ "http.clientip": "40.135.0.0"
+ }
},
+ fields=[
+ "*"
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/63893e7e9479a9b60db71dcddcc79aaf.asciidoc b/docs/examples/63893e7e9479a9b60db71dcddcc79aaf.asciidoc
new file mode 100644
index 000000000..1ee6a288d
--- /dev/null
+++ b/docs/examples/63893e7e9479a9b60db71dcddcc79aaf.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/delete-calendar.asciidoc:38
+
+[source, python]
+----
+resp = client.ml.delete_calendar(
+ calendar_id="planned-outages",
+)
+print(resp)
+----
diff --git a/docs/examples/63bf3480627a89b4b4ede4150e1d6bc0.asciidoc b/docs/examples/63bf3480627a89b4b4ede4150e1d6bc0.asciidoc
new file mode 100644
index 000000000..5560f6733
--- /dev/null
+++ b/docs/examples/63bf3480627a89b4b4ede4150e1d6bc0.asciidoc
@@ -0,0 +1,92 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/bulk-create-roles.asciidoc:106
+
+[source, python]
+----
+resp = client.security.bulk_put_role(
+ roles={
+ "my_admin_role": {
+ "cluster": [
+ "all"
+ ],
+ "indices": [
+ {
+ "names": [
+ "index1",
+ "index2"
+ ],
+ "privileges": [
+ "all"
+ ],
+ "field_security": {
+ "grant": [
+ "title",
+ "body"
+ ]
+ },
+ "query": "{\"match\": {\"title\": \"foo\"}}"
+ }
+ ],
+ "applications": [
+ {
+ "application": "myapp",
+ "privileges": [
+ "admin",
+ "read"
+ ],
+ "resources": [
+ "*"
+ ]
+ }
+ ],
+ "run_as": [
+ "other_user"
+ ],
+ "metadata": {
+ "version": 1
+ }
+ },
+ "my_user_role": {
+ "cluster": [
+ "all"
+ ],
+ "indices": [
+ {
+ "names": [
+ "index1"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "field_security": {
+ "grant": [
+ "title",
+ "body"
+ ]
+ },
+ "query": "{\"match\": {\"title\": \"foo\"}}"
+ }
+ ],
+ "applications": [
+ {
+ "application": "myapp",
+ "privileges": [
+ "admin",
+ "read"
+ ],
+ "resources": [
+ "*"
+ ]
+ }
+ ],
+ "run_as": [
+ "other_user"
+ ],
+ "metadata": {
+ "version": 1
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/63cc960215ae83b359c12df3c0993bfa.asciidoc b/docs/examples/63cc960215ae83b359c12df3c0993bfa.asciidoc
index f227287f5..5529b0b89 100644
--- a/docs/examples/63cc960215ae83b359c12df3c0993bfa.asciidoc
+++ b/docs/examples/63cc960215ae83b359c12df3c0993bfa.asciidoc
@@ -1,14 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// indices/create-index.asciidoc:130
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "settings": {
- "index": {"number_of_shards": 3, "number_of_replicas": 2}
+ settings={
+ "index": {
+ "number_of_shards": 3,
+ "number_of_replicas": 2
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/63d1c07d22a3ca3b0ec6d950547c011c.asciidoc b/docs/examples/63d1c07d22a3ca3b0ec6d950547c011c.asciidoc
index 22e894a4c..cc72b2cce 100644
--- a/docs/examples/63d1c07d22a3ca3b0ec6d950547c011c.asciidoc
+++ b/docs/examples/63d1c07d22a3ca3b0ec6d950547c011c.asciidoc
@@ -1,22 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/keyword.asciidoc:189
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"kwd": {"type": "keyword"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "kwd": {
+ "type": "keyword"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"kwd": ["foo", "foo", "bar", "baz"]},
+ document={
+ "kwd": [
+ "foo",
+ "foo",
+ "bar",
+ "baz"
+ ]
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/63e20883732ec30b5400046be2efb0f1.asciidoc b/docs/examples/63e20883732ec30b5400046be2efb0f1.asciidoc
new file mode 100644
index 000000000..e6e5a0dd6
--- /dev/null
+++ b/docs/examples/63e20883732ec30b5400046be2efb0f1.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/flush.asciidoc:121
+
+[source, python]
+----
+resp = client.indices.flush(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/63ecdab34940af053acc409164914c32.asciidoc b/docs/examples/63ecdab34940af053acc409164914c32.asciidoc
index a6755148e..c44c3147f 100644
--- a/docs/examples/63ecdab34940af053acc409164914c32.asciidoc
+++ b/docs/examples/63ecdab34940af053acc409164914c32.asciidoc
@@ -1,25 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/sparse-vector.asciidoc:46
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "text": {"type": "text", "analyzer": "standard"},
- "impact": {"type": "sparse_vector"},
- "positive": {"type": "sparse_vector"},
- "negative": {"type": "sparse_vector"},
+ mappings={
+ "properties": {
+ "text": {
+ "type": "text",
+ "analyzer": "standard"
+ },
+ "impact": {
+ "type": "sparse_vector"
+ },
+ "positive": {
+ "type": "sparse_vector"
+ },
+ "negative": {
+ "type": "sparse_vector"
}
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
- body={
+ document={
"text": "I had some terribly delicious carrots.",
"impact": [
{
@@ -28,7 +36,7 @@ resp = client.index(
"some": 0.28,
"terribly": 0.01,
"delicious": 1.2,
- "carrots": 0.8,
+ "carrots": 0.8
},
{
"I": 0.54,
@@ -36,8 +44,8 @@ resp = client.index(
"some": 0.28,
"terribly": 2.01,
"delicious": 0.02,
- "carrots": 0.4,
- },
+ "carrots": 0.4
+ }
],
"positive": {
"I": 0.55,
@@ -45,7 +53,7 @@ resp = client.index(
"some": 0.28,
"terribly": 0.01,
"delicious": 1.2,
- "carrots": 0.8,
+ "carrots": 0.8
},
"negative": {
"I": 0.54,
@@ -53,15 +61,21 @@ resp = client.index(
"some": 0.28,
"terribly": 2.01,
"delicious": 0.02,
- "carrots": 0.4,
- },
+ "carrots": 0.4
+ }
},
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
- body={"query": {"term": {"impact": {"value": "delicious"}}}},
+ query={
+ "term": {
+ "impact": {
+ "value": "delicious"
+ }
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/640621cea39cdeeb76fbc95bff31a18d.asciidoc b/docs/examples/640621cea39cdeeb76fbc95bff31a18d.asciidoc
new file mode 100644
index 000000000..7d20c7a29
--- /dev/null
+++ b/docs/examples/640621cea39cdeeb76fbc95bff31a18d.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-last-sync-api.asciidoc:115
+
+[source, python]
+----
+resp = client.connector.last_sync(
+ connector_id="my-connector",
+ last_access_control_sync_error="Houston, we have a problem!",
+ last_access_control_sync_scheduled_at="2023-11-09T15:13:08.231Z",
+ last_access_control_sync_status="pending",
+ last_deleted_document_count=42,
+ last_incremental_sync_scheduled_at="2023-11-09T15:13:08.231Z",
+ last_indexed_document_count=42,
+ last_sync_error="Houston, we have a problem!",
+ last_sync_scheduled_at="2024-11-09T15:13:08.231Z",
+ last_sync_status="completed",
+ last_synced="2024-11-09T15:13:08.231Z",
+)
+print(resp)
+----
diff --git a/docs/examples/640a89d0b39630269433425ff476faf3.asciidoc b/docs/examples/640a89d0b39630269433425ff476faf3.asciidoc
index 15fa86493..5a46406af 100644
--- a/docs/examples/640a89d0b39630269433425ff476faf3.asciidoc
+++ b/docs/examples/640a89d0b39630269433425ff476faf3.asciidoc
@@ -1,9 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// upgrade/archived-settings.asciidoc:32
[source, python]
----
resp = client.cluster.put_settings(
- body={"persistent": {"archived.*": None}},
+ persistent={
+ "archived.*": None
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/640da6dd719a34975b5627dfa5fcdd55.asciidoc b/docs/examples/640da6dd719a34975b5627dfa5fcdd55.asciidoc
new file mode 100644
index 000000000..615429b35
--- /dev/null
+++ b/docs/examples/640da6dd719a34975b5627dfa5fcdd55.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:487
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "xpack.monitoring.collection.enabled": True
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/640e4f2c2d29f9851320a70927bd7a6c.asciidoc b/docs/examples/640e4f2c2d29f9851320a70927bd7a6c.asciidoc
new file mode 100644
index 000000000..b6f5482f5
--- /dev/null
+++ b/docs/examples/640e4f2c2d29f9851320a70927bd7a6c.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/ilm-with-existing-indices.asciidoc:185
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "indices.lifecycle.poll_interval": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/641009f2147e1ca56215c701f45c970b.asciidoc b/docs/examples/641009f2147e1ca56215c701f45c970b.asciidoc
new file mode 100644
index 000000000..d5ca1970c
--- /dev/null
+++ b/docs/examples/641009f2147e1ca56215c701f45c970b.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geotilegrid-aggregation.asciidoc:185
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggregations={
+ "tiles-in-bounds": {
+ "geotile_grid": {
+ "field": "location",
+ "precision": 22,
+ "bounds": {
+ "top_left": "POINT (4.9 52.4)",
+ "bottom_right": "POINT (5.0 52.3)"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6414b9276ba1c63898c3ff5cbe03c54e.asciidoc b/docs/examples/6414b9276ba1c63898c3ff5cbe03c54e.asciidoc
new file mode 100644
index 000000000..5227631bd
--- /dev/null
+++ b/docs/examples/6414b9276ba1c63898c3ff5cbe03c54e.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/segments.asciidoc:128
+
+[source, python]
+----
+resp = client.indices.segments()
+print(resp)
+----
diff --git a/docs/examples/641f75862c70e25e79d249d9e0a79f03.asciidoc b/docs/examples/641f75862c70e25e79d249d9e0a79f03.asciidoc
index 91f2899c9..8123ec233 100644
--- a/docs/examples/641f75862c70e25e79d249d9e0a79f03.asciidoc
+++ b/docs/examples/641f75862c70e25e79d249d9e0a79f03.asciidoc
@@ -1,25 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/nested-query.asciidoc:41
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "query": {
- "nested": {
- "path": "obj1",
- "query": {
- "bool": {
- "must": [
- {"match": {"obj1.name": "blue"}},
- {"range": {"obj1.count": {"gt": 5}}},
- ]
- }
- },
- "score_mode": "avg",
- }
+ query={
+ "nested": {
+ "path": "obj1",
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "obj1.name": "blue"
+ }
+ },
+ {
+ "range": {
+ "obj1.count": {
+ "gt": 5
+ }
+ }
+ }
+ ]
+ }
+ },
+ "score_mode": "avg"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/642161d70dacf7d153767d37d3726838.asciidoc b/docs/examples/642161d70dacf7d153767d37d3726838.asciidoc
new file mode 100644
index 000000000..3fb9f5242
--- /dev/null
+++ b/docs/examples/642161d70dacf7d153767d37d3726838.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/rollup-index-caps.asciidoc:163
+
+[source, python]
+----
+resp = client.rollup.get_rollup_index_caps(
+ index="*_rollup",
+)
+print(resp)
+----
diff --git a/docs/examples/642c0c1c76e9bf226cd216ebae9ab958.asciidoc b/docs/examples/642c0c1c76e9bf226cd216ebae9ab958.asciidoc
new file mode 100644
index 000000000..4796a190a
--- /dev/null
+++ b/docs/examples/642c0c1c76e9bf226cd216ebae9ab958.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keep-words-tokenfilter.asciidoc:118
+
+[source, python]
+----
+resp = client.indices.create(
+ index="keep_words_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_keep_word_array": {
+ "tokenizer": "standard",
+ "filter": [
+ "keep_word_array"
+ ]
+ },
+ "standard_keep_word_file": {
+ "tokenizer": "standard",
+ "filter": [
+ "keep_word_file"
+ ]
+ }
+ },
+ "filter": {
+ "keep_word_array": {
+ "type": "keep",
+ "keep_words": [
+ "one",
+ "two",
+ "three"
+ ]
+ },
+ "keep_word_file": {
+ "type": "keep",
+ "keep_words_path": "analysis/example_word_list.txt"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/643b9506d1129d5215f9a1bb0b509aba.asciidoc b/docs/examples/643b9506d1129d5215f9a1bb0b509aba.asciidoc
index 82c8e36d8..fa279feac 100644
--- a/docs/examples/643b9506d1129d5215f9a1bb0b509aba.asciidoc
+++ b/docs/examples/643b9506d1129d5215f9a1bb0b509aba.asciidoc
@@ -1,34 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:316
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "full_name": {
- "path_match": "name.*",
- "path_unmatch": "*.middle",
- "mapping": {
- "type": "text",
- "copy_to": "full_name",
- },
+ mappings={
+ "dynamic_templates": [
+ {
+ "full_name": {
+ "path_match": "name.*",
+ "path_unmatch": "*.middle",
+ "mapping": {
+ "type": "text",
+ "copy_to": "full_name"
}
}
- ]
- }
+ }
+ ]
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={
- "name": {"first": "John", "middle": "Winston", "last": "Lennon"}
+ document={
+ "name": {
+ "first": "John",
+ "middle": "Winston",
+ "last": "Lennon"
+ }
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/643e19c3b6ac1134554dd890e2249c2b.asciidoc b/docs/examples/643e19c3b6ac1134554dd890e2249c2b.asciidoc
new file mode 100644
index 000000000..8a0fb1610
--- /dev/null
+++ b/docs/examples/643e19c3b6ac1134554dd890e2249c2b.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/logs.asciidoc:26
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my-index-template",
+ index_patterns=[
+ "logs-*"
+ ],
+ data_stream={},
+ template={
+ "settings": {
+ "index.mode": "logsdb"
+ }
+ },
+ priority=101,
+)
+print(resp)
+----
diff --git a/docs/examples/645433e8e479e5d71c100f66dd2de5d0.asciidoc b/docs/examples/645433e8e479e5d71c100f66dd2de5d0.asciidoc
new file mode 100644
index 000000000..76d5de204
--- /dev/null
+++ b/docs/examples/645433e8e479e5d71c100f66dd2de5d0.asciidoc
@@ -0,0 +1,534 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-manual.asciidoc:256
+
+[source, python]
+----
+resp = client.bulk(
+ index="my-data-stream",
+ refresh=True,
+ pipeline="my-timestamp-pipeline",
+ operations=[
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:49:00Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 91153,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 463314616
+ },
+ "usage": {
+ "bytes": 307007078,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 585236
+ },
+ "rss": {
+ "bytes": 102728
+ },
+ "pagefaults": 120901,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:45:50Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 124501,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 982546514
+ },
+ "usage": {
+ "bytes": 360035574,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 1339884
+ },
+ "rss": {
+ "bytes": 381174
+ },
+ "pagefaults": 178473,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:44:50Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 38907,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 862723768
+ },
+ "usage": {
+ "bytes": 379572388,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 431227
+ },
+ "rss": {
+ "bytes": 386580
+ },
+ "pagefaults": 233166,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:44:40Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 86706,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 567160996
+ },
+ "usage": {
+ "bytes": 103266017,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 1724908
+ },
+ "rss": {
+ "bytes": 105431
+ },
+ "pagefaults": 233166,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:44:00Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 150069,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 639054643
+ },
+ "usage": {
+ "bytes": 265142477,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 1786511
+ },
+ "rss": {
+ "bytes": 189235
+ },
+ "pagefaults": 138172,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:42:40Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 82260,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 854735585
+ },
+ "usage": {
+ "bytes": 309798052,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 924058
+ },
+ "rss": {
+ "bytes": 110838
+ },
+ "pagefaults": 259073,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:42:10Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 153404,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 279586406
+ },
+ "usage": {
+ "bytes": 214904955,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 1047265
+ },
+ "rss": {
+ "bytes": 91914
+ },
+ "pagefaults": 302252,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:40:20Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 125613,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 822782853
+ },
+ "usage": {
+ "bytes": 100475044,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 2109932
+ },
+ "rss": {
+ "bytes": 278446
+ },
+ "pagefaults": 74843,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:40:10Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 100046,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 567160996
+ },
+ "usage": {
+ "bytes": 362826547,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 1986724
+ },
+ "rss": {
+ "bytes": 402801
+ },
+ "pagefaults": 296495,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2022-06-21T15:38:30Z",
+ "kubernetes": {
+ "host": "gke-apps-0",
+ "node": "gke-apps-0-0",
+ "pod": "gke-apps-0-0-0",
+ "container": {
+ "cpu": {
+ "usage": {
+ "nanocores": 40018,
+ "core": {
+ "ns": 12828317850
+ },
+ "node": {
+ "pct": 0.0000277905
+ },
+ "limit": {
+ "pct": 0.0000277905
+ }
+ }
+ },
+ "memory": {
+ "available": {
+ "bytes": 1062428344
+ },
+ "usage": {
+ "bytes": 265142477,
+ "node": {
+ "pct": 0.01770037710617187
+ },
+ "limit": {
+ "pct": 0.00009923134671484496
+ }
+ },
+ "workingset": {
+ "bytes": 2294743
+ },
+ "rss": {
+ "bytes": 340623
+ },
+ "pagefaults": 224530,
+ "majorpagefaults": 0
+ },
+ "start_time": "2021-03-30T07:59:06Z",
+ "name": "container-name-44"
+ },
+ "namespace": "namespace26"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/64622409407316d2d47094e692d9b516.asciidoc b/docs/examples/64622409407316d2d47094e692d9b516.asciidoc
new file mode 100644
index 000000000..b5cabc544
--- /dev/null
+++ b/docs/examples/64622409407316d2d47094e692d9b516.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/evaluate-dfanalytics.asciidoc:395
+
+[source, python]
+----
+resp = client.ml.evaluate_data_frame(
+ index="student_performance_mathematics_reg",
+ query={
+ "term": {
+ "ml.is_training": {
+ "value": False
+ }
+ }
+ },
+ evaluation={
+ "regression": {
+ "actual_field": "G3",
+ "predicted_field": "ml.G3_prediction",
+ "metrics": {
+ "r_squared": {},
+ "mse": {},
+ "msle": {},
+ "huber": {}
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6464124d1677f4552ddddd95a340ca3a.asciidoc b/docs/examples/6464124d1677f4552ddddd95a340ca3a.asciidoc
new file mode 100644
index 000000000..183391826
--- /dev/null
+++ b/docs/examples/6464124d1677f4552ddddd95a340ca3a.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/common-options.asciidoc:196
+
+[source, python]
+----
+resp = client.index(
+ index="library",
+ refresh=True,
+ document={
+ "title": "Book #1",
+ "rating": 200.1
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="library",
+ refresh=True,
+ document={
+ "title": "Book #2",
+ "rating": 1.7
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="library",
+ refresh=True,
+ document={
+ "title": "Book #3",
+ "rating": 0.1
+ },
+)
+print(resp2)
+
+resp3 = client.search(
+ filter_path="hits.hits._source",
+ source="title",
+ sort="rating:desc",
+)
+print(resp3)
+----
diff --git a/docs/examples/646d71869f1a18c5bede7759559bfc47.asciidoc b/docs/examples/646d71869f1a18c5bede7759559bfc47.asciidoc
new file mode 100644
index 000000000..4b28aad02
--- /dev/null
+++ b/docs/examples/646d71869f1a18c5bede7759559bfc47.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-field-mapping.asciidoc:236
+
+[source, python]
+----
+resp = client.indices.get_field_mapping(
+ index="_all",
+ fields="message",
+)
+print(resp)
+----
diff --git a/docs/examples/6490d89a4e43cac5e6b9bc19840d5478.asciidoc b/docs/examples/6490d89a4e43cac5e6b9bc19840d5478.asciidoc
new file mode 100644
index 000000000..04f447de6
--- /dev/null
+++ b/docs/examples/6490d89a4e43cac5e6b9bc19840d5478.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/fingerprint-analyzer.asciidoc:19
+
+[source, python]
+----
+resp = client.indices.analyze(
+ analyzer="fingerprint",
+ text="Yes yes, Gödel said this sentence is consistent and.",
+)
+print(resp)
+----
diff --git a/docs/examples/64a6fb4bcb8cfea139a0e5d3765c063a.asciidoc b/docs/examples/64a6fb4bcb8cfea139a0e5d3765c063a.asciidoc
new file mode 100644
index 000000000..5c6d43bcf
--- /dev/null
+++ b/docs/examples/64a6fb4bcb8cfea139a0e5d3765c063a.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/translate.asciidoc:9
+
+[source, python]
+----
+resp = client.sql.translate(
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=10,
+)
+print(resp)
+----
diff --git a/docs/examples/64a79861225553799b26e118d7851dcc.asciidoc b/docs/examples/64a79861225553799b26e118d7851dcc.asciidoc
new file mode 100644
index 000000000..13d42948d
--- /dev/null
+++ b/docs/examples/64a79861225553799b26e118d7851dcc.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/error-handling.asciidoc:57
+
+[source, python]
+----
+resp = client.ilm.explain_lifecycle(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/64aff98cf477555e7411714c17006572.asciidoc b/docs/examples/64aff98cf477555e7411714c17006572.asciidoc
index 017db0ff6..bcb9395ec 100644
--- a/docs/examples/64aff98cf477555e7411714c17006572.asciidoc
+++ b/docs/examples/64aff98cf477555e7411714c17006572.asciidoc
@@ -1,13 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/range-query.asciidoc:150
[source, python]
----
resp = client.search(
- body={
- "query": {
- "range": {"timestamp": {"gte": "now-1d/d", "lte": "now/d"}}
+ query={
+ "range": {
+ "timestamp": {
+ "gte": "now-1d/d",
+ "lte": "now/d"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/64c572abc23394a77b6cca0b5368ee1d.asciidoc b/docs/examples/64c572abc23394a77b6cca0b5368ee1d.asciidoc
new file mode 100644
index 000000000..87b81e8e4
--- /dev/null
+++ b/docs/examples/64c572abc23394a77b6cca0b5368ee1d.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// features/apis/get-features-api.asciidoc:12
+
+[source, python]
+----
+resp = client.features.get_features()
+print(resp)
+----
diff --git a/docs/examples/64c804869ddfbcb9075817d0bbf71b5c.asciidoc b/docs/examples/64c804869ddfbcb9075817d0bbf71b5c.asciidoc
new file mode 100644
index 000000000..e0b2afb44
--- /dev/null
+++ b/docs/examples/64c804869ddfbcb9075817d0bbf71b5c.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:592
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my_search_application",
+ params={
+ "elser": True,
+ "query_string": "where is the best mountain climbing?",
+ "elser_fields": [
+ {
+ "name": "title",
+ "boost": 1
+ },
+ {
+ "name": "description",
+ "boost": 1
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/64ca2ccb79a8f4add5b8fe2d3322ae92.asciidoc b/docs/examples/64ca2ccb79a8f4add5b8fe2d3322ae92.asciidoc
new file mode 100644
index 000000000..fcbd1d341
--- /dev/null
+++ b/docs/examples/64ca2ccb79a8f4add5b8fe2d3322ae92.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/avg-aggregation.asciidoc:13
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size="0",
+ aggs={
+ "avg_grade": {
+ "avg": {
+ "field": "grade"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/64d24f4b2a57dba48092dafe3eb68ad1.asciidoc b/docs/examples/64d24f4b2a57dba48092dafe3eb68ad1.asciidoc
new file mode 100644
index 000000000..381ddf143
--- /dev/null
+++ b/docs/examples/64d24f4b2a57dba48092dafe3eb68ad1.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/multi-get.asciidoc:239
+
+[source, python]
+----
+resp = client.mget(
+ index="test",
+ stored_fields="field1,field2",
+ docs=[
+ {
+ "_id": "1"
+ },
+ {
+ "_id": "2",
+ "stored_fields": [
+ "field3",
+ "field4"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/64ffaa6814ec1ec4f59b8f33b47cffb4.asciidoc b/docs/examples/64ffaa6814ec1ec4f59b8f33b47cffb4.asciidoc
index cad8da6c0..bca9a3eca 100644
--- a/docs/examples/64ffaa6814ec1ec4f59b8f33b47cffb4.asciidoc
+++ b/docs/examples/64ffaa6814ec1ec4f59b8f33b47cffb4.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// upgrade/archived-settings.asciidoc:73
[source, python]
----
resp = client.indices.put_settings(
index="my-index",
- body={"archived.*": None},
+ settings={
+ "archived.*": None
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/650a0fb27c66a790c4687267423af1da.asciidoc b/docs/examples/650a0fb27c66a790c4687267423af1da.asciidoc
new file mode 100644
index 000000000..8bf376bd6
--- /dev/null
+++ b/docs/examples/650a0fb27c66a790c4687267423af1da.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:102
+
+[source, python]
+----
+resp = client.indices.update_aliases(
+ actions=[
+ {
+ "remove": {
+ "index": "logs-nginx.access-prod",
+ "alias": "logs"
+ }
+ },
+ {
+ "add": {
+ "index": "logs-my_app-default",
+ "alias": "logs"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/6521c3578dc4ad4a6db697700986e78e.asciidoc b/docs/examples/6521c3578dc4ad4a6db697700986e78e.asciidoc
new file mode 100644
index 000000000..ecba52a86
--- /dev/null
+++ b/docs/examples/6521c3578dc4ad4a6db697700986e78e.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/context-suggest.asciidoc:315
+
+[source, python]
+----
+resp = client.search(
+ index="place",
+ pretty=True,
+ suggest={
+ "place_suggestion": {
+ "prefix": "tim",
+ "completion": {
+ "field": "suggest",
+ "size": 10,
+ "contexts": {
+ "location": [
+ {
+ "lat": 43.6624803,
+ "lon": -79.3863353,
+ "precision": 2
+ },
+ {
+ "context": {
+ "lat": 43.6624803,
+ "lon": -79.3863353
+ },
+ "boost": 2
+ }
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/653c0d0ef146c997ef6bc6450d4f5f94.asciidoc b/docs/examples/653c0d0ef146c997ef6bc6450d4f5f94.asciidoc
index 566b66519..4d067de16 100644
--- a/docs/examples/653c0d0ef146c997ef6bc6450d4f5f94.asciidoc
+++ b/docs/examples/653c0d0ef146c997ef6bc6450d4f5f94.asciidoc
@@ -1,18 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:700
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "actors": {
- "terms": {"field": "actors", "size": 10},
- "aggs": {
- "costars": {"terms": {"field": "actors", "size": 5}}
- },
+ aggs={
+ "actors": {
+ "terms": {
+ "field": "actors",
+ "size": 10
+ },
+ "aggs": {
+ "costars": {
+ "terms": {
+ "field": "actors",
+ "size": 5
+ }
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/654882f545eca8d7047695f867c63072.asciidoc b/docs/examples/654882f545eca8d7047695f867c63072.asciidoc
new file mode 100644
index 000000000..ed2907890
--- /dev/null
+++ b/docs/examples/654882f545eca8d7047695f867c63072.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/stop-transform.asciidoc:81
+
+[source, python]
+----
+resp = client.transform.stop_transform(
+ transform_id="ecommerce_transform",
+)
+print(resp)
+----
diff --git a/docs/examples/65578c390837cb4c0fcc77fb17857714.asciidoc b/docs/examples/65578c390837cb4c0fcc77fb17857714.asciidoc
new file mode 100644
index 000000000..341d19fdd
--- /dev/null
+++ b/docs/examples/65578c390837cb4c0fcc77fb17857714.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline.asciidoc:92
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "max_monthly_sales": {
+ "max_bucket": {
+ "buckets_path": "sales_per_month>sales"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/657cf67bbc48f3b8c7fa15e275a5ef72.asciidoc b/docs/examples/657cf67bbc48f3b8c7fa15e275a5ef72.asciidoc
new file mode 100644
index 000000000..9e07e2295
--- /dev/null
+++ b/docs/examples/657cf67bbc48f3b8c7fa15e275a5ef72.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/ignore-missing-component-templates.asciidoc:14
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="logs-foo_component1",
+ template={
+ "mappings": {
+ "properties": {
+ "host.name": {
+ "type": "keyword"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/658842bf41e0fcb7969937155946a0ff.asciidoc b/docs/examples/658842bf41e0fcb7969937155946a0ff.asciidoc
new file mode 100644
index 000000000..7c42f49d5
--- /dev/null
+++ b/docs/examples/658842bf41e0fcb7969937155946a0ff.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:157
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="slm-read-only",
+ cluster=[
+ "read_slm"
+ ],
+ indices=[
+ {
+ "names": [
+ ".slm-history-*"
+ ],
+ "privileges": [
+ "read"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/65b6185356f16f2f0d84bc5aee2ed0fc.asciidoc b/docs/examples/65b6185356f16f2f0d84bc5aee2ed0fc.asciidoc
new file mode 100644
index 000000000..6c0013855
--- /dev/null
+++ b/docs/examples/65b6185356f16f2f0d84bc5aee2ed0fc.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/sparse-vector-query.asciidoc:25
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "sparse_vector": {
+ "field": "ml.tokens",
+ "inference_id": "the inference ID to produce the token weights",
+ "query": "the query string"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/65c671fbecdb5b0d75c13d63f87e36f0.asciidoc b/docs/examples/65c671fbecdb5b0d75c13d63f87e36f0.asciidoc
new file mode 100644
index 000000000..570ac9d40
--- /dev/null
+++ b/docs/examples/65c671fbecdb5b0d75c13d63f87e36f0.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geodistance-aggregation.asciidoc:149
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggs={
+ "rings_around_amsterdam": {
+ "geo_distance": {
+ "field": "location",
+ "origin": "POINT (4.894 52.3760)",
+ "ranges": [
+ {
+ "to": 100000
+ },
+ {
+ "from": 100000,
+ "to": 300000
+ },
+ {
+ "from": 300000
+ }
+ ],
+ "keyed": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/65e892a362d940e4a74965f21c15ca09.asciidoc b/docs/examples/65e892a362d940e4a74965f21c15ca09.asciidoc
new file mode 100644
index 000000000..02927c0a2
--- /dev/null
+++ b/docs/examples/65e892a362d940e4a74965f21c15ca09.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-reindex.asciidoc:78
+
+[source, python]
+----
+resp = client.reindex(
+ wait_for_completion=False,
+ source={
+ "index": "test-data",
+ "size": 50
+ },
+ dest={
+ "index": "openai-embeddings",
+ "pipeline": "openai_embeddings"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6606d46685d10377b996b5f20f1229b5.asciidoc b/docs/examples/6606d46685d10377b996b5f20f1229b5.asciidoc
new file mode 100644
index 000000000..9e0132018
--- /dev/null
+++ b/docs/examples/6606d46685d10377b996b5f20f1229b5.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-index-name-api.asciidoc:75
+
+[source, python]
+----
+resp = client.connector.update_index_name(
+ connector_id="my-connector",
+ index_name="data-from-my-google-drive",
+)
+print(resp)
+----
diff --git a/docs/examples/6636701d31b0c9eb8316f1f8e99cc918.asciidoc b/docs/examples/6636701d31b0c9eb8316f1f8e99cc918.asciidoc
new file mode 100644
index 000000000..1afa9ad3b
--- /dev/null
+++ b/docs/examples/6636701d31b0c9eb8316f1f8e99cc918.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/scripted-metric-aggregation.asciidoc:15
+
+[source, python]
+----
+resp = client.search(
+ index="ledger",
+ size="0",
+ query={
+ "match_all": {}
+ },
+ aggs={
+ "profit": {
+ "scripted_metric": {
+ "init_script": "state.transactions = []",
+ "map_script": "state.transactions.add(doc.type.value == 'sale' ? doc.amount.value : -1 * doc.amount.value)",
+ "combine_script": "double profit = 0; for (t in state.transactions) { profit += t } return profit",
+ "reduce_script": "double profit = 0; for (a in states) { profit += a } return profit"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/66539dc6011dd2e0282cf81db1f3df27.asciidoc b/docs/examples/66539dc6011dd2e0282cf81db1f3df27.asciidoc
new file mode 100644
index 000000000..8e89820c4
--- /dev/null
+++ b/docs/examples/66539dc6011dd2e0282cf81db1f3df27.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat.asciidoc:85
+
+[source, python]
+----
+resp = client.cat.nodes(
+ h="ip,port,heapPercent,name",
+)
+print(resp)
+----
diff --git a/docs/examples/666c420fe61fa122386da3c356a64943.asciidoc b/docs/examples/666c420fe61fa122386da3c356a64943.asciidoc
new file mode 100644
index 000000000..4ccb7c58f
--- /dev/null
+++ b/docs/examples/666c420fe61fa122386da3c356a64943.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:600
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+ sort={
+ "_script": {
+ "type": "number",
+ "script": {
+ "lang": "painless",
+ "source": "doc['field_name'].value * params.factor",
+ "params": {
+ "factor": 1.1
+ }
+ },
+ "order": "asc"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6689aa213884196b47a6f482d4993749.asciidoc b/docs/examples/6689aa213884196b47a6f482d4993749.asciidoc
new file mode 100644
index 000000000..c850d3ee8
--- /dev/null
+++ b/docs/examples/6689aa213884196b47a6f482d4993749.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/put-pipeline.asciidoc:11
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline-id",
+ description="My optional pipeline description",
+ processors=[
+ {
+ "set": {
+ "description": "My optional processor description",
+ "field": "my-keyword-field",
+ "value": "foo"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/6693f0ffa0de3229b5dedda197810e70.asciidoc b/docs/examples/6693f0ffa0de3229b5dedda197810e70.asciidoc
new file mode 100644
index 000000000..500f95da4
--- /dev/null
+++ b/docs/examples/6693f0ffa0de3229b5dedda197810e70.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1368
+
+[source, python]
+----
+resp = client.eql.get(
+ id="FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
+ keep_alive="5d",
+)
+print(resp)
+----
diff --git a/docs/examples/669773766b041be768003055ad523038.asciidoc b/docs/examples/669773766b041be768003055ad523038.asciidoc
new file mode 100644
index 000000000..c2da6396f
--- /dev/null
+++ b/docs/examples/669773766b041be768003055ad523038.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/alias-privileges.asciidoc:47
+
+[source, python]
+----
+resp = client.get(
+ index=".ds-my-data-stream-2099.03.08-000002",
+ id="2",
+)
+print(resp)
+----
diff --git a/docs/examples/6705eca2095ade294548cfb25bf2dd86.asciidoc b/docs/examples/6705eca2095ade294548cfb25bf2dd86.asciidoc
new file mode 100644
index 000000000..3a5237ca2
--- /dev/null
+++ b/docs/examples/6705eca2095ade294548cfb25bf2dd86.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/diagnose-unassigned-shards.asciidoc:166
+
+[source, python]
+----
+resp = client.cat.shards(
+ v=True,
+ h="index,shard,prirep,state,node,unassigned.reason",
+ s="state",
+)
+print(resp)
+----
diff --git a/docs/examples/67154a4837cf996a9a9c3e61d6e9d1b3.asciidoc b/docs/examples/67154a4837cf996a9a9c3e61d6e9d1b3.asciidoc
new file mode 100644
index 000000000..647b80bda
--- /dev/null
+++ b/docs/examples/67154a4837cf996a9a9c3e61d6e9d1b3.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// migration/migrate_8_0/migrate_to_java_time.asciidoc:289
+
+[source, python]
+----
+resp = client.reindex(
+ source={
+ "index": "my-index-000001"
+ },
+ dest={
+ "index": "my-index-000002"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/672d30eb3af573140d966e88b14814f8.asciidoc b/docs/examples/672d30eb3af573140d966e88b14814f8.asciidoc
new file mode 100644
index 000000000..dd829806a
--- /dev/null
+++ b/docs/examples/672d30eb3af573140d966e88b14814f8.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/date-index-name.asciidoc:43
+
+[source, python]
+----
+resp = client.index(
+ index="my-index",
+ id="1",
+ pipeline="monthlyindex",
+ document={
+ "date1": "2016-04-25T12:02:01.789Z"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6742a8cd0b7b4c1c325ce2f22faf6cb4.asciidoc b/docs/examples/6742a8cd0b7b4c1c325ce2f22faf6cb4.asciidoc
new file mode 100644
index 000000000..6b9151d1d
--- /dev/null
+++ b/docs/examples/6742a8cd0b7b4c1c325ce2f22faf6cb4.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/categorize-text-aggregation.asciidoc:213
+
+[source, python]
+----
+resp = client.search(
+ index="log-messages",
+ filter_path="aggregations",
+ aggs={
+ "categories": {
+ "categorize_text": {
+ "field": "message",
+ "categorization_filters": [
+ "\\w+\\_\\d{3}"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/674bb755111c6fbaa4c5ac759395c122.asciidoc b/docs/examples/674bb755111c6fbaa4c5ac759395c122.asciidoc
new file mode 100644
index 000000000..a61c8c89c
--- /dev/null
+++ b/docs/examples/674bb755111c6fbaa4c5ac759395c122.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:128
+
+[source, python]
+----
+resp = client.indices.get_settings(
+ index="my-index",
+ flat_settings=True,
+ include_defaults=True,
+)
+print(resp)
+
+resp1 = client.cluster.get_settings(
+ flat_settings=True,
+ include_defaults=True,
+)
+print(resp1)
+----
diff --git a/docs/examples/67967388db610dcb9d24fb59ede348d8.asciidoc b/docs/examples/67967388db610dcb9d24fb59ede348d8.asciidoc
new file mode 100644
index 000000000..40dfa87ce
--- /dev/null
+++ b/docs/examples/67967388db610dcb9d24fb59ede348d8.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/min-aggregation.asciidoc:17
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "min_price": {
+ "min": {
+ "field": "price"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/67a1f31cf60773a2378c2c30723c4b96.asciidoc b/docs/examples/67a1f31cf60773a2378c2c30723c4b96.asciidoc
new file mode 100644
index 000000000..8b41253a0
--- /dev/null
+++ b/docs/examples/67a1f31cf60773a2378c2c30723c4b96.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-rank-aggregation.asciidoc:216
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_ranks": {
+ "percentile_ranks": {
+ "field": "load_time",
+ "values": [
+ 500,
+ 600
+ ],
+ "missing": 10
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/67a490d749a0c3bb16a266663423893d.asciidoc b/docs/examples/67a490d749a0c3bb16a266663423893d.asciidoc
new file mode 100644
index 000000000..2447b9157
--- /dev/null
+++ b/docs/examples/67a490d749a0c3bb16a266663423893d.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/getting-started.asciidoc:202
+
+[source, python]
+----
+resp = client.watcher.delete_watch(
+ id="log_error_watch",
+)
+print(resp)
+----
diff --git a/docs/examples/67a55ac3aaee09f4aeeb7d2763da3335.asciidoc b/docs/examples/67a55ac3aaee09f4aeeb7d2763da3335.asciidoc
new file mode 100644
index 000000000..f7c5e4612
--- /dev/null
+++ b/docs/examples/67a55ac3aaee09f4aeeb7d2763da3335.asciidoc
@@ -0,0 +1,82 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/geobounds-aggregation.asciidoc:104
+
+[source, python]
+----
+resp = client.indices.create(
+ index="places",
+ mappings={
+ "properties": {
+ "geometry": {
+ "type": "geo_shape"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="places",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "name": "NEMO Science Museum",
+ "geometry": "POINT(4.912350 52.374081)"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "name": "Sportpark De Weeren",
+ "geometry": {
+ "type": "Polygon",
+ "coordinates": [
+ [
+ [
+ 4.965305328369141,
+ 52.39347642069457
+ ],
+ [
+ 4.966979026794433,
+ 52.391721758934835
+ ],
+ [
+ 4.969425201416015,
+ 52.39238958618537
+ ],
+ [
+ 4.967944622039794,
+ 52.39420969150824
+ ],
+ [
+ 4.965305328369141,
+ 52.39347642069457
+ ]
+ ]
+ ]
+ }
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="places",
+ size="0",
+ aggs={
+ "viewport": {
+ "geo_bounds": {
+ "field": "geometry"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/67aac8882fa476db8a5878b67ea08eb3.asciidoc b/docs/examples/67aac8882fa476db8a5878b67ea08eb3.asciidoc
new file mode 100644
index 000000000..4ca7f4d84
--- /dev/null
+++ b/docs/examples/67aac8882fa476db8a5878b67ea08eb3.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/repo-analysis-api.asciidoc:26
+
+[source, python]
+----
+resp = client.perform_request(
+ "POST",
+ "/_snapshot/my_repository/_analyze",
+ params={
+ "blob_count": "10",
+ "max_blob_size": "1mb",
+ "timeout": "120s"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/67bab07fda27ef77e3bc948211051a33.asciidoc b/docs/examples/67bab07fda27ef77e3bc948211051a33.asciidoc
new file mode 100644
index 000000000..d7b22ab98
--- /dev/null
+++ b/docs/examples/67bab07fda27ef77e3bc948211051a33.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/hotspotting.asciidoc:154
+
+[source, python]
+----
+resp = client.cat.thread_pool(
+ thread_pool_patterns="write,search",
+ v=True,
+ s="n,nn",
+ h="n,nn,q,a,r,c",
+)
+print(resp)
+----
diff --git a/docs/examples/67c3808751223eef69a57e6fd02ddf4f.asciidoc b/docs/examples/67c3808751223eef69a57e6fd02ddf4f.asciidoc
new file mode 100644
index 000000000..7368be0c6
--- /dev/null
+++ b/docs/examples/67c3808751223eef69a57e6fd02ddf4f.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/mlt-query.asciidoc:38
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "more_like_this": {
+ "fields": [
+ "title",
+ "description"
+ ],
+ "like": [
+ {
+ "_index": "imdb",
+ "_id": "1"
+ },
+ {
+ "_index": "imdb",
+ "_id": "2"
+ },
+ "and potentially some more text here as well"
+ ],
+ "min_term_freq": 1,
+ "max_query_terms": 12
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/67ffa135c50c43d6788636c88078c7d1.asciidoc b/docs/examples/67ffa135c50c43d6788636c88078c7d1.asciidoc
new file mode 100644
index 000000000..263c02e41
--- /dev/null
+++ b/docs/examples/67ffa135c50c43d6788636c88078c7d1.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/simulate-pipeline.asciidoc:150
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ id="my-pipeline-id",
+ docs=[
+ {
+ "_index": "index",
+ "_id": "id",
+ "_source": {
+ "foo": "bar"
+ }
+ },
+ {
+ "_index": "index",
+ "_id": "id",
+ "_source": {
+ "foo": "rab"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/682336e5232c9ad3d866cb203d1c58c1.asciidoc b/docs/examples/682336e5232c9ad3d866cb203d1c58c1.asciidoc
new file mode 100644
index 000000000..69cbe7bf7
--- /dev/null
+++ b/docs/examples/682336e5232c9ad3d866cb203d1c58c1.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-mapping.asciidoc:135
+
+[source, python]
+----
+resp = client.indices.create(
+ index="azure-openai-embeddings",
+ mappings={
+ "properties": {
+ "content_embedding": {
+ "type": "dense_vector",
+ "dims": 1536,
+ "element_type": "float",
+ "similarity": "dot_product"
+ },
+ "content": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6843d859e2965d17cad4f033c81db83f.asciidoc b/docs/examples/6843d859e2965d17cad4f033c81db83f.asciidoc
new file mode 100644
index 000000000..cf63d9185
--- /dev/null
+++ b/docs/examples/6843d859e2965d17cad4f033c81db83f.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:351
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my-data-stream-template",
+ index_patterns=[
+ "my-data-stream*"
+ ],
+ data_stream={},
+ priority=500,
+ template={
+ "settings": {
+ "sort.field": [
+ "@timestamp"
+ ],
+ "sort.order": [
+ "desc"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6856f7c6a732ab55ca71c1ee2ec2bbad.asciidoc b/docs/examples/6856f7c6a732ab55ca71c1ee2ec2bbad.asciidoc
new file mode 100644
index 000000000..e57aa9c57
--- /dev/null
+++ b/docs/examples/6856f7c6a732ab55ca71c1ee2ec2bbad.asciidoc
@@ -0,0 +1,83 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/max-aggregation.asciidoc:126
+
+[source, python]
+----
+resp = client.indices.create(
+ index="metrics_index",
+ mappings={
+ "properties": {
+ "latency_histo": {
+ "type": "histogram"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="metrics_index",
+ id="1",
+ refresh=True,
+ document={
+ "network.name": "net-1",
+ "latency_histo": {
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 3,
+ 7,
+ 23,
+ 12,
+ 6
+ ]
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="metrics_index",
+ id="2",
+ refresh=True,
+ document={
+ "network.name": "net-2",
+ "latency_histo": {
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 8,
+ 17,
+ 8,
+ 7,
+ 6
+ ]
+ }
+ },
+)
+print(resp2)
+
+resp3 = client.search(
+ index="metrics_index",
+ size="0",
+ filter_path="aggregations",
+ aggs={
+ "max_latency": {
+ "max": {
+ "field": "latency_histo"
+ }
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/6859530dd9d85e59bd33a53ec96a3836.asciidoc b/docs/examples/6859530dd9d85e59bd33a53ec96a3836.asciidoc
new file mode 100644
index 000000000..04492bf88
--- /dev/null
+++ b/docs/examples/6859530dd9d85e59bd33a53ec96a3836.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/match-enrich-policy-type-ex.asciidoc:20
+
+[source, python]
+----
+resp = client.index(
+ index="users",
+ id="1",
+ refresh="wait_for",
+ document={
+ "email": "mardy.brown@asciidocsmith.com",
+ "first_name": "Mardy",
+ "last_name": "Brown",
+ "city": "New Orleans",
+ "county": "Orleans",
+ "state": "LA",
+ "zip": 70116,
+ "web": "mardy.asciidocsmith.com"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/686bc640b877de845c46bef372a9866c.asciidoc b/docs/examples/686bc640b877de845c46bef372a9866c.asciidoc
new file mode 100644
index 000000000..9e34ab969
--- /dev/null
+++ b/docs/examples/686bc640b877de845c46bef372a9866c.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/parent-aggregation.asciidoc:95
+
+[source, python]
+----
+resp = client.search(
+ index="parent_example",
+ size="0",
+ aggs={
+ "top-names": {
+ "terms": {
+ "field": "owner.display_name.keyword",
+ "size": 10
+ },
+ "aggs": {
+ "to-questions": {
+ "parent": {
+ "type": "answer"
+ },
+ "aggs": {
+ "top-tags": {
+ "terms": {
+ "field": "tags.keyword",
+ "size": 10
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/68721288dc9ad8aa1b55099b4d303051.asciidoc b/docs/examples/68721288dc9ad8aa1b55099b4d303051.asciidoc
index ffe8f7ba4..870a7a5ad 100644
--- a/docs/examples/68721288dc9ad8aa1b55099b4d303051.asciidoc
+++ b/docs/examples/68721288dc9ad8aa1b55099b4d303051.asciidoc
@@ -1,17 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:534
[source, python]
----
resp = client.search(
- body={
- "query": {
- "multi_match": {
- "query": "quick brown f",
- "type": "bool_prefix",
- "fields": ["subject", "message"],
- }
+ query={
+ "multi_match": {
+ "query": "quick brown f",
+ "type": "bool_prefix",
+ "fields": [
+ "subject",
+ "message"
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/68738b4fd0dda177022be45be95b4c84.asciidoc b/docs/examples/68738b4fd0dda177022be45be95b4c84.asciidoc
index 12900a524..632e5ba7d 100644
--- a/docs/examples/68738b4fd0dda177022be45be95b4c84.asciidoc
+++ b/docs/examples/68738b4fd0dda177022be45be95b4c84.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:202
[source, python]
@@ -7,4 +8,4 @@ resp = client.reindex_rethrottle(
requests_per_second="-1",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6884454f57c3a41059037ea762f48d77.asciidoc b/docs/examples/6884454f57c3a41059037ea762f48d77.asciidoc
new file mode 100644
index 000000000..8a1c11e8f
--- /dev/null
+++ b/docs/examples/6884454f57c3a41059037ea762f48d77.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/standard-analyzer.asciidoc:17
+
+[source, python]
+----
+resp = client.indices.analyze(
+ analyzer="standard",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/68a891f609ca3a379d2d64e4914f3067.asciidoc b/docs/examples/68a891f609ca3a379d2d64e4914f3067.asciidoc
new file mode 100644
index 000000000..0626c5e28
--- /dev/null
+++ b/docs/examples/68a891f609ca3a379d2d64e4914f3067.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/kstem-tokenfilter.asciidoc:29
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "kstem"
+ ],
+ text="the foxes jumping quickly",
+)
+print(resp)
+----
diff --git a/docs/examples/68b64313bf89ec3f2c645da61999dbb4.asciidoc b/docs/examples/68b64313bf89ec3f2c645da61999dbb4.asciidoc
new file mode 100644
index 000000000..bd40f4871
--- /dev/null
+++ b/docs/examples/68b64313bf89ec3f2c645da61999dbb4.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/nodes-info.asciidoc:221
+
+[source, python]
+----
+resp = client.nodes.info(
+ node_id="plugins",
+)
+print(resp)
+----
diff --git a/docs/examples/68cb8a452e780ca78b0cb761be3629af.asciidoc b/docs/examples/68cb8a452e780ca78b0cb761be3629af.asciidoc
new file mode 100644
index 000000000..71920658f
--- /dev/null
+++ b/docs/examples/68cb8a452e780ca78b0cb761be3629af.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:714
+
+[source, python]
+----
+resp = client.search(
+ stored_fields="_none_",
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/691fe20d467324ed43a36fd15852c492.asciidoc b/docs/examples/691fe20d467324ed43a36fd15852c492.asciidoc
new file mode 100644
index 000000000..707e0fd3a
--- /dev/null
+++ b/docs/examples/691fe20d467324ed43a36fd15852c492.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/uni-directional-disaster-recovery.asciidoc:174
+
+[source, python]
+----
+resp = client.ccr.follow(
+ index="kibana_sample_data_ecommerce",
+ wait_for_active_shards="1",
+ remote_cluster="clusterB",
+ leader_index="kibana_sample_data_ecommerce2",
+)
+print(resp)
+----
diff --git a/docs/examples/692606cc6d6462becc321d92961a3bac.asciidoc b/docs/examples/692606cc6d6462becc321d92961a3bac.asciidoc
new file mode 100644
index 000000000..176019bf1
--- /dev/null
+++ b/docs/examples/692606cc6d6462becc321d92961a3bac.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// text-structure/apis/test-grok-pattern.asciidoc:54
+
+[source, python]
+----
+resp = client.text_structure.test_grok_pattern(
+ grok_pattern="Hello %{WORD:first_name} %{WORD:last_name}",
+ text=[
+ "Hello John Doe",
+ "this does not match"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/69582847099ee62ed34feddfaba83ef6.asciidoc b/docs/examples/69582847099ee62ed34feddfaba83ef6.asciidoc
new file mode 100644
index 000000000..b08593a8b
--- /dev/null
+++ b/docs/examples/69582847099ee62ed34feddfaba83ef6.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/histogram-aggregation.asciidoc:307
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "quantity": {
+ "histogram": {
+ "field": "quantity",
+ "interval": 10,
+ "missing": 0
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/698e0a2b67ba7842caa801d9ef46ebe3.asciidoc b/docs/examples/698e0a2b67ba7842caa801d9ef46ebe3.asciidoc
new file mode 100644
index 000000000..b164965d1
--- /dev/null
+++ b/docs/examples/698e0a2b67ba7842caa801d9ef46ebe3.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:499
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ highlight={
+ "require_field_match": False,
+ "fields": {
+ "body": {
+ "pre_tags": [
+ ""
+ ],
+ "post_tags": [
+ ""
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/69a08e7bdcc616f3bdcb8ae842d9e30e.asciidoc b/docs/examples/69a08e7bdcc616f3bdcb8ae842d9e30e.asciidoc
index 5cedcfe10..87d427403 100644
--- a/docs/examples/69a08e7bdcc616f3bdcb8ae842d9e30e.asciidoc
+++ b/docs/examples/69a08e7bdcc616f3bdcb8ae842d9e30e.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:354
[source, python]
@@ -5,7 +6,7 @@
resp = client.get(
index="my-index-000001",
id="1",
- stored_fields=["tags", "counter"],
+ stored_fields="tags,counter",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/69ab708fe65a75f870223d2289c3d171.asciidoc b/docs/examples/69ab708fe65a75f870223d2289c3d171.asciidoc
new file mode 100644
index 000000000..342a15224
--- /dev/null
+++ b/docs/examples/69ab708fe65a75f870223d2289c3d171.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/redact.asciidoc:106
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "description": "Hide my IP",
+ "processors": [
+ {
+ "redact": {
+ "field": "message",
+ "patterns": [
+ "%{IP:REDACTED}",
+ "%{EMAILADDRESS:REDACTED}"
+ ],
+ "prefix": "*",
+ "suffix": "*"
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_source": {
+ "message": "55.3.244.1 GET /index.html 15824 0.043 test@elastic.co"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/69c07cfdf8054c301cd6186c5d71aa02.asciidoc b/docs/examples/69c07cfdf8054c301cd6186c5d71aa02.asciidoc
index cbeac05c0..b4add7199 100644
--- a/docs/examples/69c07cfdf8054c301cd6186c5d71aa02.asciidoc
+++ b/docs/examples/69c07cfdf8054c301cd6186c5d71aa02.asciidoc
@@ -1,9 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:344
[source, python]
----
resp = client.update_by_query(
- index=["my-index-000001", "my-index-000002"],
+ index="my-index-000001,my-index-000002",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/69d5710bdec73041c66f21d5f96637e8.asciidoc b/docs/examples/69d5710bdec73041c66f21d5f96637e8.asciidoc
new file mode 100644
index 000000000..ca1d05204
--- /dev/null
+++ b/docs/examples/69d5710bdec73041c66f21d5f96637e8.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:214
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index_long",
+ mappings={
+ "properties": {
+ "field": {
+ "type": "date_nanos"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/69d9b8fd364596aa37eae6864d8a6d89.asciidoc b/docs/examples/69d9b8fd364596aa37eae6864d8a6d89.asciidoc
new file mode 100644
index 000000000..df1157f4b
--- /dev/null
+++ b/docs/examples/69d9b8fd364596aa37eae6864d8a6d89.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/getting-started.asciidoc:61
+
+[source, python]
+----
+resp = client.search(
+ index=".watcher-history*",
+ pretty=True,
+ sort=[
+ {
+ "result.execution_time": "desc"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/69daf5ec2a9bc07096e1833286c36076.asciidoc b/docs/examples/69daf5ec2a9bc07096e1833286c36076.asciidoc
new file mode 100644
index 000000000..36215dc6c
--- /dev/null
+++ b/docs/examples/69daf5ec2a9bc07096e1833286c36076.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/ilm-tutorial.asciidoc:334
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="timeseries_template",
+ index_patterns=[
+ "timeseries-*"
+ ],
+ template={
+ "settings": {
+ "number_of_shards": 1,
+ "number_of_replicas": 1,
+ "index.lifecycle.name": "timeseries_policy",
+ "index.lifecycle.rollover_alias": "timeseries"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/69f8b0f2a9ba47e11f363d788cee9d6d.asciidoc b/docs/examples/69f8b0f2a9ba47e11f363d788cee9d6d.asciidoc
new file mode 100644
index 000000000..0325c8d27
--- /dev/null
+++ b/docs/examples/69f8b0f2a9ba47e11f363d788cee9d6d.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// migration/apis/deprecation.asciidoc:140
+
+[source, python]
+----
+resp = client.migration.deprecations(
+ index="logstash-*",
+)
+print(resp)
+----
diff --git a/docs/examples/6a1702dd50690cae833572e48a0ddf25.asciidoc b/docs/examples/6a1702dd50690cae833572e48a0ddf25.asciidoc
index 29f008037..56af10db2 100644
--- a/docs/examples/6a1702dd50690cae833572e48a0ddf25.asciidoc
+++ b/docs/examples/6a1702dd50690cae833572e48a0ddf25.asciidoc
@@ -1,16 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:33
[source, python]
----
resp = client.search(
- body={
- "query": {
- "multi_match": {
- "query": "Will Smith",
- "fields": ["title", "*_name"],
- }
+ query={
+ "multi_match": {
+ "query": "Will Smith",
+ "fields": [
+ "title",
+ "*_name"
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6a350a17701e8c8158407191f2718b66.asciidoc b/docs/examples/6a350a17701e8c8158407191f2718b66.asciidoc
new file mode 100644
index 000000000..a721d4b83
--- /dev/null
+++ b/docs/examples/6a350a17701e8c8158407191f2718b66.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/post-unfollow.asciidoc:74
+
+[source, python]
+----
+resp = client.ccr.unfollow(
+ index="follower_index",
+)
+print(resp)
+----
diff --git a/docs/examples/6a3a578ce37fb2c63ccfab7f75db9bae.asciidoc b/docs/examples/6a3a578ce37fb2c63ccfab7f75db9bae.asciidoc
new file mode 100644
index 000000000..9cb0ad31c
--- /dev/null
+++ b/docs/examples/6a3a578ce37fb2c63ccfab7f75db9bae.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:295
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "ingest.geoip.downloader.enabled": False,
+ "indices.lifecycle.history_index_enabled": False
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6a3a86ff58e5f20950d429cf2832c229.asciidoc b/docs/examples/6a3a86ff58e5f20950d429cf2832c229.asciidoc
new file mode 100644
index 000000000..a6761640a
--- /dev/null
+++ b/docs/examples/6a3a86ff58e5f20950d429cf2832c229.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/get-pipeline.asciidoc:76
+
+[source, python]
+----
+resp = client.ingest.get_pipeline(
+ id="my-pipeline-id",
+)
+print(resp)
+----
diff --git a/docs/examples/6a3f06962cceb3dfd3cd4fb5c679fa75.asciidoc b/docs/examples/6a3f06962cceb3dfd3cd4fb5c679fa75.asciidoc
new file mode 100644
index 000000000..fa6e3a6d4
--- /dev/null
+++ b/docs/examples/6a3f06962cceb3dfd3cd4fb5c679fa75.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/charfilters/mapping-charfilter.asciidoc:141
+
+[source, python]
+----
+resp = client.indices.analyze(
+ index="my-index-000001",
+ tokenizer="keyword",
+ char_filter=[
+ "my_mappings_char_filter"
+ ],
+ text="I'm delighted about it :(",
+)
+print(resp)
+----
diff --git a/docs/examples/6a50c1c53673fe9cc3cbda38a2853cdd.asciidoc b/docs/examples/6a50c1c53673fe9cc3cbda38a2853cdd.asciidoc
new file mode 100644
index 000000000..55fa331a2
--- /dev/null
+++ b/docs/examples/6a50c1c53673fe9cc3cbda38a2853cdd.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:683
+
+[source, python]
+----
+resp = client.sql.delete_async(
+ id="FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=",
+)
+print(resp)
+----
diff --git a/docs/examples/6a55dbba114c6c1408474f7e9cfdbb94.asciidoc b/docs/examples/6a55dbba114c6c1408474f7e9cfdbb94.asciidoc
new file mode 100644
index 000000000..220e41901
--- /dev/null
+++ b/docs/examples/6a55dbba114c6c1408474f7e9cfdbb94.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/register-repository.asciidoc:167
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_unverified_backup",
+ verify=False,
+ repository={
+ "type": "fs",
+ "settings": {
+ "location": "my_unverified_backup_location"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6a9655fe22fa5db7a540c145bcf1fb31.asciidoc b/docs/examples/6a9655fe22fa5db7a540c145bcf1fb31.asciidoc
index 349a3c0e6..ad3352e08 100644
--- a/docs/examples/6a9655fe22fa5db7a540c145bcf1fb31.asciidoc
+++ b/docs/examples/6a9655fe22fa5db7a540c145bcf1fb31.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/aggregate-metric-double.asciidoc:133
[source, python]
@@ -5,28 +6,28 @@
resp = client.index(
index="stats-index",
id="1",
- body={
+ document={
"agg_metric": {
"min": -302.5,
"max": 702.3,
"sum": 200,
- "value_count": 25,
+ "value_count": 25
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="stats-index",
id="2",
- body={
+ document={
"agg_metric": {
"min": -93,
"max": 1702.3,
"sum": 300,
- "value_count": 25,
+ "value_count": 25
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/6a969ebe7490d93d35be895b14e5a42a.asciidoc b/docs/examples/6a969ebe7490d93d35be895b14e5a42a.asciidoc
new file mode 100644
index 000000000..c52910b2b
--- /dev/null
+++ b/docs/examples/6a969ebe7490d93d35be895b14e5a42a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/set-up-lifecycle-policy.asciidoc:309
+
+[source, python]
+----
+resp = client.indices.get(
+ index="logs-my_app-default",
+)
+print(resp)
+----
diff --git a/docs/examples/6aa2941855d13f365f70aa8767ecb137.asciidoc b/docs/examples/6aa2941855d13f365f70aa8767ecb137.asciidoc
index feb9728e7..cf2ed0c43 100644
--- a/docs/examples/6aa2941855d13f365f70aa8767ecb137.asciidoc
+++ b/docs/examples/6aa2941855d13f365f70aa8767ecb137.asciidoc
@@ -1,15 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/params/multi-fields.asciidoc:10
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "city": {
- "type": "text",
- "fields": {"raw": {"type": "keyword"}},
+ mappings={
+ "properties": {
+ "city": {
+ "type": "text",
+ "fields": {
+ "raw": {
+ "type": "keyword"
+ }
}
}
}
@@ -17,27 +20,41 @@ resp = client.indices.create(
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"city": "New York"},
+ document={
+ "city": "New York"
+ },
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="my-index-000001",
id="2",
- body={"city": "York"},
+ document={
+ "city": "York"
+ },
)
-print(resp)
+print(resp2)
-resp = client.search(
+resp3 = client.search(
index="my-index-000001",
- body={
- "query": {"match": {"city": "york"}},
- "sort": {"city.raw": "asc"},
- "aggs": {"Cities": {"terms": {"field": "city.raw"}}},
+ query={
+ "match": {
+ "city": "york"
+ }
+ },
+ sort={
+ "city.raw": "asc"
+ },
+ aggs={
+ "Cities": {
+ "terms": {
+ "field": "city.raw"
+ }
+ }
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp3)
+----
diff --git a/docs/examples/6aca241c0361d26f134712821e2d09a9.asciidoc b/docs/examples/6aca241c0361d26f134712821e2d09a9.asciidoc
new file mode 100644
index 000000000..72da86fba
--- /dev/null
+++ b/docs/examples/6aca241c0361d26f134712821e2d09a9.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/clean-up-repo-api.asciidoc:79
+
+[source, python]
+----
+resp = client.snapshot.cleanup_repository(
+ name="my_repository",
+)
+print(resp)
+----
diff --git a/docs/examples/6af9dc1c3240aa8e623ff3622bcb1b48.asciidoc b/docs/examples/6af9dc1c3240aa8e623ff3622bcb1b48.asciidoc
new file mode 100644
index 000000000..185309639
--- /dev/null
+++ b/docs/examples/6af9dc1c3240aa8e623ff3622bcb1b48.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/cluster/allocation_filtering.asciidoc:70
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.exclude._ip": "192.168.2.*"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6b0288acb739c4667d41339e5100c327.asciidoc b/docs/examples/6b0288acb739c4667d41339e5100c327.asciidoc
index f39415645..26a2af93b 100644
--- a/docs/examples/6b0288acb739c4667d41339e5100c327.asciidoc
+++ b/docs/examples/6b0288acb739c4667d41339e5100c327.asciidoc
@@ -1,18 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/match-query.asciidoc:230
[source, python]
----
resp = client.search(
- body={
- "query": {
- "match": {
- "message": {
- "query": "this is a testt",
- "fuzziness": "AUTO",
- }
+ query={
+ "match": {
+ "message": {
+ "query": "this is a testt",
+ "fuzziness": "AUTO"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6b0d492c0f50103fefeab385a7bebd01.asciidoc b/docs/examples/6b0d492c0f50103fefeab385a7bebd01.asciidoc
new file mode 100644
index 000000000..94725f2fd
--- /dev/null
+++ b/docs/examples/6b0d492c0f50103fefeab385a7bebd01.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/types/constant-keyword.asciidoc:11
+
+[source, python]
+----
+resp = client.indices.create(
+ index="logs-debug",
+ mappings={
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ },
+ "message": {
+ "type": "text"
+ },
+ "level": {
+ "type": "constant_keyword",
+ "value": "debug"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6b104a66ab47fc1e1f24a5738f82feb4.asciidoc b/docs/examples/6b104a66ab47fc1e1f24a5738f82feb4.asciidoc
new file mode 100644
index 000000000..aef3941b4
--- /dev/null
+++ b/docs/examples/6b104a66ab47fc1e1f24a5738f82feb4.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/getting-started.asciidoc:288
+
+[source, python]
+----
+resp = client.ccr.put_auto_follow_pattern(
+ name="beats",
+ remote_cluster="leader",
+ leader_index_patterns=[
+ "metricbeat-*",
+ "packetbeat-*"
+ ],
+ follow_index_pattern="{{leader_index}}-copy",
+)
+print(resp)
+----
diff --git a/docs/examples/6b1336ff477f91d4a0db0b06db546ff0.asciidoc b/docs/examples/6b1336ff477f91d4a0db0b06db546ff0.asciidoc
new file mode 100644
index 000000000..1dccfee87
--- /dev/null
+++ b/docs/examples/6b1336ff477f91d4a0db0b06db546ff0.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/stop.asciidoc:45
+
+[source, python]
+----
+resp = client.watcher.stop()
+print(resp)
+----
diff --git a/docs/examples/6b1e837a8469eca2d03d5c36f5910f34.asciidoc b/docs/examples/6b1e837a8469eca2d03d5c36f5910f34.asciidoc
index a4e9e2207..b94ae7097 100644
--- a/docs/examples/6b1e837a8469eca2d03d5c36f5910f34.asciidoc
+++ b/docs/examples/6b1e837a8469eca2d03d5c36f5910f34.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/filter-aggregation.asciidoc:13
[source, python]
@@ -6,15 +7,27 @@ resp = client.search(
index="sales",
size="0",
filter_path="aggregations",
- body={
- "aggs": {
- "avg_price": {"avg": {"field": "price"}},
- "t_shirts": {
- "filter": {"term": {"type": "t-shirt"}},
- "aggs": {"avg_price": {"avg": {"field": "price"}}},
+ aggs={
+ "avg_price": {
+ "avg": {
+ "field": "price"
+ }
+ },
+ "t_shirts": {
+ "filter": {
+ "term": {
+ "type": "t-shirt"
+ }
},
+ "aggs": {
+ "avg_price": {
+ "avg": {
+ "field": "price"
+ }
+ }
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6b3dcde0656d3a96dbcfed1ec814e10a.asciidoc b/docs/examples/6b3dcde0656d3a96dbcfed1ec814e10a.asciidoc
new file mode 100644
index 000000000..650690a2c
--- /dev/null
+++ b/docs/examples/6b3dcde0656d3a96dbcfed1ec814e10a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// shutdown/apis/shutdown-delete.asciidoc:65
+
+[source, python]
+----
+resp = client.shutdown.delete_node(
+ node_id="USpTGYaBSIKbgSUJR2Z9lg",
+)
+print(resp)
+----
diff --git a/docs/examples/6b6f5e0ab4ef523fc9a3a4a655848f64.asciidoc b/docs/examples/6b6f5e0ab4ef523fc9a3a4a655848f64.asciidoc
new file mode 100644
index 000000000..9c8ff6008
--- /dev/null
+++ b/docs/examples/6b6f5e0ab4ef523fc9a3a4a655848f64.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/sparse-vector-query.asciidoc:43
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "sparse_vector": {
+ "field": "ml.tokens",
+ "query_vector": {
+ "token1": 0.5,
+ "token2": 0.3,
+ "token3": 0.2
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6b6fd0a5942dfb9762ad2790cf421a80.asciidoc b/docs/examples/6b6fd0a5942dfb9762ad2790cf421a80.asciidoc
new file mode 100644
index 000000000..941c5899b
--- /dev/null
+++ b/docs/examples/6b6fd0a5942dfb9762ad2790cf421a80.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-client.asciidoc:363
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my-example-app",
+ search_application={
+ "indices": [
+ "example-index"
+ ],
+ "template": {
+ "script": {
+ "lang": "mustache",
+ "source": "\n {\n \"query\": {\n \"bool\": {\n \"must\": [\n {{#query}}\n \n {{/query}}\n ],\n \"filter\": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n \"_source\": {\n \"includes\": [\"title\", \"plot\"]\n },\n \"aggs\": {{#toJson}}_es_aggs{{/toJson}},\n \"from\": {{from}},\n \"size\": {{size}},\n \"sort\": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ",
+ "params": {
+ "query": "",
+ "_es_filters": {},
+ "_es_aggs": {},
+ "_es_sort_fields": {},
+ "size": 10,
+ "from": 0
+ },
+ "dictionary": {}
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6b77795e9249c8d9865f7a49fd86a863.asciidoc b/docs/examples/6b77795e9249c8d9865f7a49fd86a863.asciidoc
index 5556da811..827235ed5 100644
--- a/docs/examples/6b77795e9249c8d9865f7a49fd86a863.asciidoc
+++ b/docs/examples/6b77795e9249c8d9865f7a49fd86a863.asciidoc
@@ -1,9 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/range-query.asciidoc:16
[source, python]
----
resp = client.search(
- body={"query": {"range": {"age": {"gte": 10, "lte": 20, "boost": 2}}}},
+ query={
+ "range": {
+ "age": {
+ "gte": 10,
+ "lte": 20,
+ "boost": 2
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6b8c5c8145c287c4fc535fa57ccf95a7.asciidoc b/docs/examples/6b8c5c8145c287c4fc535fa57ccf95a7.asciidoc
new file mode 100644
index 000000000..0b217472d
--- /dev/null
+++ b/docs/examples/6b8c5c8145c287c4fc535fa57ccf95a7.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/list-connector-sync-jobs-api.asciidoc:64
+
+[source, python]
+----
+resp = client.perform_request(
+ "GET",
+ "/_connector/_sync_job",
+ params={
+ "status": "pending"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6ba332596f5eb29660c90ab2d480e7dc.asciidoc b/docs/examples/6ba332596f5eb29660c90ab2d480e7dc.asciidoc
new file mode 100644
index 000000000..a24ccbc71
--- /dev/null
+++ b/docs/examples/6ba332596f5eb29660c90ab2d480e7dc.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template-v1.asciidoc:183
+
+[source, python]
+----
+resp = client.indices.put_template(
+ name="template_1",
+ index_patterns=[
+ "te*"
+ ],
+ order=0,
+ settings={
+ "number_of_shards": 1
+ },
+ mappings={
+ "_source": {
+ "enabled": False
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.put_template(
+ name="template_2",
+ index_patterns=[
+ "tes*"
+ ],
+ order=1,
+ settings={
+ "number_of_shards": 1
+ },
+ mappings={
+ "_source": {
+ "enabled": True
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc b/docs/examples/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc
index 4ee23b72d..b2dc7d28c 100644
--- a/docs/examples/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc
+++ b/docs/examples/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc
@@ -1,19 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:232
[source, python]
----
resp = client.search(
- body={
- "query": {
- "bool": {
- "should": [
- {"match": {"title": "quick brown fox"}},
- {"match": {"title.original": "quick brown fox"}},
- {"match": {"title.shingles": "quick brown fox"}},
- ]
- }
+ query={
+ "bool": {
+ "should": [
+ {
+ "match": {
+ "title": "quick brown fox"
+ }
+ },
+ {
+ "match": {
+ "title.original": "quick brown fox"
+ }
+ },
+ {
+ "match": {
+ "title.shingles": "quick brown fox"
+ }
+ }
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6bfa0a9a50c4e94276c7d63af1c31d9e.asciidoc b/docs/examples/6bfa0a9a50c4e94276c7d63af1c31d9e.asciidoc
new file mode 100644
index 000000000..7c68c2804
--- /dev/null
+++ b/docs/examples/6bfa0a9a50c4e94276c7d63af1c31d9e.asciidoc
@@ -0,0 +1,56 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/context-suggest.asciidoc:25
+
+[source, python]
+----
+resp = client.indices.create(
+ index="place",
+ mappings={
+ "properties": {
+ "suggest": {
+ "type": "completion",
+ "contexts": [
+ {
+ "name": "place_type",
+ "type": "category"
+ },
+ {
+ "name": "location",
+ "type": "geo",
+ "precision": 4
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.create(
+ index="place_path_category",
+ mappings={
+ "properties": {
+ "suggest": {
+ "type": "completion",
+ "contexts": [
+ {
+ "name": "place_type",
+ "type": "category",
+ "path": "cat"
+ },
+ {
+ "name": "location",
+ "type": "geo",
+ "precision": 4,
+ "path": "loc"
+ }
+ ]
+ },
+ "loc": {
+ "type": "geo_point"
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/6c00dae1a456ae5e854e98e895dca2ab.asciidoc b/docs/examples/6c00dae1a456ae5e854e98e895dca2ab.asciidoc
index 141eb58d0..e3638f4da 100644
--- a/docs/examples/6c00dae1a456ae5e854e98e895dca2ab.asciidoc
+++ b/docs/examples/6c00dae1a456ae5e854e98e895dca2ab.asciidoc
@@ -1,20 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/function-score-query.asciidoc:137
[source, python]
----
resp = client.search(
- body={
- "query": {
- "function_score": {
- "query": {"match": {"message": "elasticsearch"}},
- "script_score": {
- "script": {
- "source": "Math.log(2 + doc['my-int'].value)"
- }
- },
+ query={
+ "function_score": {
+ "query": {
+ "match": {
+ "message": "elasticsearch"
+ }
+ },
+ "script_score": {
+ "script": {
+ "source": "Math.log(2 + doc['my-int'].value)"
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6c0acbff2df9003ccaf4350c9e2e186e.asciidoc b/docs/examples/6c0acbff2df9003ccaf4350c9e2e186e.asciidoc
new file mode 100644
index 000000000..933495aa1
--- /dev/null
+++ b/docs/examples/6c0acbff2df9003ccaf4350c9e2e186e.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-polygon-query.asciidoc:62
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_polygon": {
+ "person.location": {
+ "points": [
+ [
+ -70,
+ 40
+ ],
+ [
+ -80,
+ 30
+ ],
+ [
+ -90,
+ 20
+ ]
+ ]
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6c3f7c8601e8cc13d36eef98a5e2cb34.asciidoc b/docs/examples/6c3f7c8601e8cc13d36eef98a5e2cb34.asciidoc
index e780e8d5f..f2f3b405e 100644
--- a/docs/examples/6c3f7c8601e8cc13d36eef98a5e2cb34.asciidoc
+++ b/docs/examples/6c3f7c8601e8cc13d36eef98a5e2cb34.asciidoc
@@ -1,28 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/nested-query.asciidoc:139
[source, python]
----
resp = client.indices.create(
index="drivers",
- body={
- "mappings": {
- "properties": {
- "driver": {
- "type": "nested",
- "properties": {
- "last_name": {"type": "text"},
- "vehicle": {
- "type": "nested",
- "properties": {
- "make": {"type": "text"},
- "model": {"type": "text"},
- },
- },
+ mappings={
+ "properties": {
+ "driver": {
+ "type": "nested",
+ "properties": {
+ "last_name": {
+ "type": "text"
},
+ "vehicle": {
+ "type": "nested",
+ "properties": {
+ "make": {
+ "type": "text"
+ },
+ "model": {
+ "type": "text"
+ }
+ }
+ }
}
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6c70b022a8a74b887fe46e514feb38c0.asciidoc b/docs/examples/6c70b022a8a74b887fe46e514feb38c0.asciidoc
new file mode 100644
index 000000000..4b7511daa
--- /dev/null
+++ b/docs/examples/6c70b022a8a74b887fe46e514feb38c0.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/recovery.asciidoc:12
+
+[source, python]
+----
+resp = client.indices.recovery(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/6c72460570307f23478100db04a84c8e.asciidoc b/docs/examples/6c72460570307f23478100db04a84c8e.asciidoc
new file mode 100644
index 000000000..883ddf576
--- /dev/null
+++ b/docs/examples/6c72460570307f23478100db04a84c8e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-component-template.asciidoc:86
+
+[source, python]
+----
+resp = client.cluster.get_component_template(
+ name="temp*",
+)
+print(resp)
+----
diff --git a/docs/examples/6c72f6791ba9223943f7556c5bfaa728.asciidoc b/docs/examples/6c72f6791ba9223943f7556c5bfaa728.asciidoc
new file mode 100644
index 000000000..94fd945ed
--- /dev/null
+++ b/docs/examples/6c72f6791ba9223943f7556c5bfaa728.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:58
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ fields=[
+ "user.id",
+ "http.response.*",
+ {
+ "field": "@timestamp",
+ "format": "epoch_millis"
+ }
+ ],
+ source=False,
+)
+print(resp)
+----
diff --git a/docs/examples/6c8bf6d4d68b7756f953be4c07655337.asciidoc b/docs/examples/6c8bf6d4d68b7756f953be4c07655337.asciidoc
new file mode 100644
index 000000000..4b01b060e
--- /dev/null
+++ b/docs/examples/6c8bf6d4d68b7756f953be4c07655337.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/nodes-reload-secure-settings.asciidoc:63
+
+[source, python]
+----
+resp = client.nodes.reload_secure_settings(
+ secure_settings_password="keystore-password",
+)
+print(resp)
+
+resp1 = client.nodes.reload_secure_settings(
+ node_id="nodeId1,nodeId2",
+ secure_settings_password="keystore-password",
+)
+print(resp1)
+----
diff --git a/docs/examples/6c927313867647e0ef3cd3a37cb410cc.asciidoc b/docs/examples/6c927313867647e0ef3cd3a37cb410cc.asciidoc
new file mode 100644
index 000000000..0c0e8d4e0
--- /dev/null
+++ b/docs/examples/6c927313867647e0ef3cd3a37cb410cc.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-api-keys.asciidoc:179
+
+[source, python]
+----
+resp = client.security.invalidate_api_key(
+ username="myuser",
+ realm_name="native1",
+)
+print(resp)
+----
diff --git a/docs/examples/6cd083045bf06e80b83889a939a18451.asciidoc b/docs/examples/6cd083045bf06e80b83889a939a18451.asciidoc
index ef268ceea..9188d249e 100644
--- a/docs/examples/6cd083045bf06e80b83889a939a18451.asciidoc
+++ b/docs/examples/6cd083045bf06e80b83889a939a18451.asciidoc
@@ -1,66 +1,95 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/nested.asciidoc:87
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"user": {"type": "nested"}}}},
+ mappings={
+ "properties": {
+ "user": {
+ "type": "nested"
+ }
+ }
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={
+ document={
"group": "fans",
"user": [
- {"first": "John", "last": "Smith"},
- {"first": "Alice", "last": "White"},
- ],
+ {
+ "first": "John",
+ "last": "Smith"
+ },
+ {
+ "first": "Alice",
+ "last": "White"
+ }
+ ]
},
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
- body={
- "query": {
- "nested": {
- "path": "user",
- "query": {
- "bool": {
- "must": [
- {"match": {"user.first": "Alice"}},
- {"match": {"user.last": "Smith"}},
- ]
- }
- },
+ query={
+ "nested": {
+ "path": "user",
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "user.first": "Alice"
+ }
+ },
+ {
+ "match": {
+ "user.last": "Smith"
+ }
+ }
+ ]
+ }
}
}
},
)
-print(resp)
+print(resp2)
-resp = client.search(
+resp3 = client.search(
index="my-index-000001",
- body={
- "query": {
- "nested": {
- "path": "user",
- "query": {
- "bool": {
- "must": [
- {"match": {"user.first": "Alice"}},
- {"match": {"user.last": "White"}},
- ]
+ query={
+ "nested": {
+ "path": "user",
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "user.first": "Alice"
+ }
+ },
+ {
+ "match": {
+ "user.last": "White"
+ }
+ }
+ ]
+ }
+ },
+ "inner_hits": {
+ "highlight": {
+ "fields": {
+ "user.first": {}
}
- },
- "inner_hits": {
- "highlight": {"fields": {"user.first": {}}}
- },
+ }
}
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp3)
+----
diff --git a/docs/examples/6ce8334def48552ba7d44025580d9105.asciidoc b/docs/examples/6ce8334def48552ba7d44025580d9105.asciidoc
new file mode 100644
index 000000000..68fce2f90
--- /dev/null
+++ b/docs/examples/6ce8334def48552ba7d44025580d9105.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:240
+
+[source, python]
+----
+resp = client.indices.create(
+ index="",
+ aliases={
+ "my-alias": {}
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6cf3307c00f464c46475e352e067d714.asciidoc b/docs/examples/6cf3307c00f464c46475e352e067d714.asciidoc
new file mode 100644
index 000000000..62960d780
--- /dev/null
+++ b/docs/examples/6cf3307c00f464c46475e352e067d714.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-bounding-box-query.asciidoc:103
+
+[source, python]
+----
+resp = client.search(
+ index="my_geoshapes",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_bounding_box": {
+ "pin.location": {
+ "top_left": {
+ "lat": 40.73,
+ "lon": -74.1
+ },
+ "bottom_right": {
+ "lat": 40.01,
+ "lon": -71.12
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6d48f83c4a36d0544d876d3eff48dcef.asciidoc b/docs/examples/6d48f83c4a36d0544d876d3eff48dcef.asciidoc
new file mode 100644
index 000000000..ce29a3fd7
--- /dev/null
+++ b/docs/examples/6d48f83c4a36d0544d876d3eff48dcef.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:262
+
+[source, python]
+----
+resp = client.slm.execute_retention()
+print(resp)
+----
diff --git a/docs/examples/6d81c749ff9554044ee5f3ad92dcb89a.asciidoc b/docs/examples/6d81c749ff9554044ee5f3ad92dcb89a.asciidoc
new file mode 100644
index 000000000..53abf4b0f
--- /dev/null
+++ b/docs/examples/6d81c749ff9554044ee5f3ad92dcb89a.asciidoc
@@ -0,0 +1,55 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-tsds.asciidoc:58
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my-weather-sensor-lifecycle-policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_age": "1d",
+ "max_primary_shard_size": "50gb"
+ }
+ }
+ },
+ "warm": {
+ "min_age": "30d",
+ "actions": {
+ "shrink": {
+ "number_of_shards": 1
+ },
+ "forcemerge": {
+ "max_num_segments": 1
+ }
+ }
+ },
+ "cold": {
+ "min_age": "60d",
+ "actions": {
+ "searchable_snapshot": {
+ "snapshot_repository": "found-snapshots"
+ }
+ }
+ },
+ "frozen": {
+ "min_age": "90d",
+ "actions": {
+ "searchable_snapshot": {
+ "snapshot_repository": "found-snapshots"
+ }
+ }
+ },
+ "delete": {
+ "min_age": "735d",
+ "actions": {
+ "delete": {}
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6db118771354792646229e7a3c30c7e9.asciidoc b/docs/examples/6db118771354792646229e7a3c30c7e9.asciidoc
index 0e6e04a74..ad36969c7 100644
--- a/docs/examples/6db118771354792646229e7a3c30c7e9.asciidoc
+++ b/docs/examples/6db118771354792646229e7a3c30c7e9.asciidoc
@@ -1,54 +1,67 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:993
[source, python]
----
resp = client.bulk(
index="my-index-000001",
- refresh="true",
- body=[
- {"index": {}},
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
{
"timestamp": 1516729294000,
"temperature": 200,
"voltage": 5.2,
- "node": "a",
+ "node": "a"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": 1516642894000,
"temperature": 201,
"voltage": 5.8,
- "node": "b",
+ "node": "b"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": 1516556494000,
"temperature": 202,
"voltage": 5.1,
- "node": "a",
+ "node": "a"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": 1516470094000,
"temperature": 198,
"voltage": 5.6,
- "node": "b",
+ "node": "b"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": 1516383694000,
"temperature": 200,
"voltage": 4.2,
- "node": "c",
+ "node": "c"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": 1516297294000,
"temperature": 202,
"voltage": 4,
- "node": "c",
- },
+ "node": "c"
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6dbfe5565a95508e65d304131847f9fc.asciidoc b/docs/examples/6dbfe5565a95508e65d304131847f9fc.asciidoc
new file mode 100644
index 000000000..445453bb2
--- /dev/null
+++ b/docs/examples/6dbfe5565a95508e65d304131847f9fc.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/edgengram-tokenfilter.asciidoc:34
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ {
+ "type": "edge_ngram",
+ "min_gram": 1,
+ "max_gram": 2
+ }
+ ],
+ text="the quick brown fox jumps",
+)
+print(resp)
+----
diff --git a/docs/examples/6dcd3916679f6aa64f79524c75991ebd.asciidoc b/docs/examples/6dcd3916679f6aa64f79524c75991ebd.asciidoc
new file mode 100644
index 000000000..10fcf33a0
--- /dev/null
+++ b/docs/examples/6dcd3916679f6aa64f79524c75991ebd.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-rest.asciidoc:245
+
+[source, python]
+----
+resp = client.esql.query(
+ query="\n FROM library\n | EVAL year = DATE_EXTRACT(\"year\", release_date)\n | WHERE page_count > 300 AND author == \"Frank Herbert\"\n | STATS count = COUNT(*) by year\n | WHERE count > 0\n | LIMIT 5\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/6dd2a107bc64fd6f058fb17c21640649.asciidoc b/docs/examples/6dd2a107bc64fd6f058fb17c21640649.asciidoc
new file mode 100644
index 000000000..4cf7cbec2
--- /dev/null
+++ b/docs/examples/6dd2a107bc64fd6f058fb17c21640649.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-tokens.asciidoc:210
+
+[source, python]
+----
+resp = client.security.invalidate_token(
+ username="myuser",
+ realm_name="saml1",
+)
+print(resp)
+----
diff --git a/docs/examples/6dd4c02fe3d6b800648a04d3e2d29fc1.asciidoc b/docs/examples/6dd4c02fe3d6b800648a04d3e2d29fc1.asciidoc
new file mode 100644
index 000000000..7682dc8ef
--- /dev/null
+++ b/docs/examples/6dd4c02fe3d6b800648a04d3e2d29fc1.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/delete-snapshot-api.asciidoc:72
+
+[source, python]
+----
+resp = client.snapshot.delete(
+ repository="my_repository",
+ snapshot="snapshot_2,snapshot_3",
+)
+print(resp)
+----
diff --git a/docs/examples/6ddd4e657efbf45def430a6419825796.asciidoc b/docs/examples/6ddd4e657efbf45def430a6419825796.asciidoc
new file mode 100644
index 000000000..b7861383a
--- /dev/null
+++ b/docs/examples/6ddd4e657efbf45def430a6419825796.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-azure-ai-studio.asciidoc:159
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="completion",
+ inference_id="azure_ai_studio_completion",
+ inference_config={
+ "service": "azureaistudio",
+ "service_settings": {
+ "api_key": "",
+ "target": "",
+ "provider": "",
+ "endpoint_type": ""
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6e000496a1fa8b57148518eaad692f35.asciidoc b/docs/examples/6e000496a1fa8b57148518eaad692f35.asciidoc
index da16c1ea1..72af66b49 100644
--- a/docs/examples/6e000496a1fa8b57148518eaad692f35.asciidoc
+++ b/docs/examples/6e000496a1fa8b57148518eaad692f35.asciidoc
@@ -1,9 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/match-all-query.asciidoc:39
[source, python]
----
resp = client.search(
- body={"query": {"match_none": {}}},
+ query={
+ "match_none": {}
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6e0b675eff7ed73c09a76a415930a486.asciidoc b/docs/examples/6e0b675eff7ed73c09a76a415930a486.asciidoc
new file mode 100644
index 000000000..f42b8e747
--- /dev/null
+++ b/docs/examples/6e0b675eff7ed73c09a76a415930a486.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/parent-id-query.asciidoc:24
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "my-join-field": {
+ "type": "join",
+ "relations": {
+ "my-parent": "my-child"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6e1157f3184fa192d47a3d0e3ea17a6c.asciidoc b/docs/examples/6e1157f3184fa192d47a3d0e3ea17a6c.asciidoc
new file mode 100644
index 000000000..b491952c5
--- /dev/null
+++ b/docs/examples/6e1157f3184fa192d47a3d0e3ea17a6c.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/unique-tokenfilter.asciidoc:130
+
+[source, python]
+----
+resp = client.indices.create(
+ index="letter_unique_pos_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "letter_unique_pos": {
+ "tokenizer": "letter",
+ "filter": [
+ "unique_pos"
+ ]
+ }
+ },
+ "filter": {
+ "unique_pos": {
+ "type": "unique",
+ "only_on_same_position": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6e1ae8d6103e0b77f14fb0ea1bfb7ffa.asciidoc b/docs/examples/6e1ae8d6103e0b77f14fb0ea1bfb7ffa.asciidoc
index ceaaad117..8373a7697 100644
--- a/docs/examples/6e1ae8d6103e0b77f14fb0ea1bfb7ffa.asciidoc
+++ b/docs/examples/6e1ae8d6103e0b77f14fb0ea1bfb7ffa.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:397
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "GEOMETRYCOLLECTION (POINT (1000.0 100.0), LINESTRING (1001.0 100.0, 1002.0 100.0))"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6e86225ed4a6e3be8078b83ef301f731.asciidoc b/docs/examples/6e86225ed4a6e3be8078b83ef301f731.asciidoc
new file mode 100644
index 000000000..d9d273192
--- /dev/null
+++ b/docs/examples/6e86225ed4a6e3be8078b83ef301f731.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:66
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "percolate": {
+ "field": "query",
+ "document": {
+ "message": "A new bonsai tree in the office"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6ea062455229151e311869a81ee40252.asciidoc b/docs/examples/6ea062455229151e311869a81ee40252.asciidoc
new file mode 100644
index 000000000..95f3a9047
--- /dev/null
+++ b/docs/examples/6ea062455229151e311869a81ee40252.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-multiple-indices.asciidoc:49
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+
+resp1 = client.search(
+ index="_all",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="*",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/6edfc35a66afd9b884431fccf48fdbf5.asciidoc b/docs/examples/6edfc35a66afd9b884431fccf48fdbf5.asciidoc
new file mode 100644
index 000000000..3a4f1a734
--- /dev/null
+++ b/docs/examples/6edfc35a66afd9b884431fccf48fdbf5.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-with-synonyms.asciidoc:114
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "lowercase",
+ {
+ "type": "synonym_graph",
+ "synonyms": [
+ "pc => personal computer",
+ "computer, pc, laptop"
+ ]
+ }
+ ],
+ text="Check how PC synonyms work",
+)
+print(resp)
+----
diff --git a/docs/examples/6eead05dd3b04722ef0ea5644c2e047d.asciidoc b/docs/examples/6eead05dd3b04722ef0ea5644c2e047d.asciidoc
new file mode 100644
index 000000000..f700218f0
--- /dev/null
+++ b/docs/examples/6eead05dd3b04722ef0ea5644c2e047d.asciidoc
@@ -0,0 +1,49 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/bucket-script-aggregation.asciidoc:50
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "total_sales": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "t-shirts": {
+ "filter": {
+ "term": {
+ "type": "t-shirt"
+ }
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "t-shirt-percentage": {
+ "bucket_script": {
+ "buckets_path": {
+ "tShirtSales": "t-shirts>sales",
+ "totalSales": "total_sales"
+ },
+ "script": "params.tShirtSales / params.totalSales * 100"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6f0389ac52808df23bb6081a1acd4eed.asciidoc b/docs/examples/6f0389ac52808df23bb6081a1acd4eed.asciidoc
new file mode 100644
index 000000000..0c1fbb92d
--- /dev/null
+++ b/docs/examples/6f0389ac52808df23bb6081a1acd4eed.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/built-in-users.asciidoc:158
+
+[source, python]
+----
+resp = client.security.enable_user(
+ username="logstash_system",
+)
+print(resp)
+----
diff --git a/docs/examples/6f07152055e99416deb10e95b428b847.asciidoc b/docs/examples/6f07152055e99416deb10e95b428b847.asciidoc
new file mode 100644
index 000000000..e3554a9c9
--- /dev/null
+++ b/docs/examples/6f07152055e99416deb10e95b428b847.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/edgengram-tokenfilter.asciidoc:203
+
+[source, python]
+----
+resp = client.indices.create(
+ index="edge_ngram_custom_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "default": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "3_5_edgegrams"
+ ]
+ }
+ },
+ "filter": {
+ "3_5_edgegrams": {
+ "type": "edge_ngram",
+ "min_gram": 3,
+ "max_gram": 5
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6f34e27481460a95e59ffbacb76bd637.asciidoc b/docs/examples/6f34e27481460a95e59ffbacb76bd637.asciidoc
new file mode 100644
index 000000000..f9b10ff40
--- /dev/null
+++ b/docs/examples/6f34e27481460a95e59ffbacb76bd637.asciidoc
@@ -0,0 +1,54 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/custom-analyzer.asciidoc:159
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_custom_analyzer": {
+ "char_filter": [
+ "emoticons"
+ ],
+ "tokenizer": "punctuation",
+ "filter": [
+ "lowercase",
+ "english_stop"
+ ]
+ }
+ },
+ "tokenizer": {
+ "punctuation": {
+ "type": "pattern",
+ "pattern": "[ .,!?]"
+ }
+ },
+ "char_filter": {
+ "emoticons": {
+ "type": "mapping",
+ "mappings": [
+ ":) => _happy_",
+ ":( => _sad_"
+ ]
+ }
+ },
+ "filter": {
+ "english_stop": {
+ "type": "stop",
+ "stopwords": "_english_"
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_custom_analyzer",
+ text="I'm a :) person, and you?",
+)
+print(resp1)
+----
diff --git a/docs/examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc b/docs/examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc
new file mode 100644
index 000000000..0ffe6b433
--- /dev/null
+++ b/docs/examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/bulk-update-api-keys.asciidoc:296
+
+[source, python]
+----
+resp = client.security.bulk_update_api_keys(
+ body={
+ "ids": [
+ "VuaCfGcBCdbkQm-e5aOx",
+ "H3_AhoIBA9hmeQJdg7ij"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6f48ab7cbb8a4a46d0e9272c07166eaf.asciidoc b/docs/examples/6f48ab7cbb8a4a46d0e9272c07166eaf.asciidoc
new file mode 100644
index 000000000..9942c771f
--- /dev/null
+++ b/docs/examples/6f48ab7cbb8a4a46d0e9272c07166eaf.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/apis/sql-translate-api.asciidoc:12
+
+[source, python]
+----
+resp = client.sql.translate(
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=10,
+)
+print(resp)
+----
diff --git a/docs/examples/6f4cbebfd6d2cee54aa3e7a86a755ef8.asciidoc b/docs/examples/6f4cbebfd6d2cee54aa3e7a86a755ef8.asciidoc
new file mode 100644
index 000000000..b3acd844e
--- /dev/null
+++ b/docs/examples/6f4cbebfd6d2cee54aa3e7a86a755ef8.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/knn-query.asciidoc:204
+
+[source, python]
+----
+resp = client.search(
+ index="my-image-index",
+ size=3,
+ query={
+ "bool": {
+ "should": [
+ {
+ "match": {
+ "title": {
+ "query": "mountain lake",
+ "boost": 1
+ }
+ }
+ },
+ {
+ "knn": {
+ "field": "image-vector",
+ "query_vector": [
+ -5,
+ 9,
+ -12
+ ],
+ "k": 10,
+ "boost": 2
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6f5adbd55a3a2760e7fe9d32df18b1a1.asciidoc b/docs/examples/6f5adbd55a3a2760e7fe9d32df18b1a1.asciidoc
new file mode 100644
index 000000000..ab04cb527
--- /dev/null
+++ b/docs/examples/6f5adbd55a3a2760e7fe9d32df18b1a1.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/getting-started.asciidoc:114
+
+[source, python]
+----
+resp = client.index(
+ index="logs",
+ document={
+ "timestamp": "2015-05-17T18:12:07.613Z",
+ "request": "GET index.html",
+ "status_code": 404,
+ "message": "Error: File not found"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6f6d5a4a90e1265822628d4ced963639.asciidoc b/docs/examples/6f6d5a4a90e1265822628d4ced963639.asciidoc
index 85a25d536..80e859416 100644
--- a/docs/examples/6f6d5a4a90e1265822628d4ced963639.asciidoc
+++ b/docs/examples/6f6d5a4a90e1265822628d4ced963639.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/field-mapping.asciidoc:63
[source, python]
@@ -5,12 +6,14 @@
resp = client.index(
index="my-index-000001",
id="1",
- body={"create_date": "2015/09/02"},
+ document={
+ "create_date": "2015/09/02"
+ },
)
print(resp)
-resp = client.indices.get_mapping(
+resp1 = client.indices.get_mapping(
index="my-index-000001",
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/6f842819c50e8490080dd085e0c6aca3.asciidoc b/docs/examples/6f842819c50e8490080dd085e0c6aca3.asciidoc
new file mode 100644
index 000000000..be5c19114
--- /dev/null
+++ b/docs/examples/6f842819c50e8490080dd085e0c6aca3.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/normalizer.asciidoc:125
+
+[source, python]
+----
+resp = client.search(
+ index="index",
+ size=0,
+ aggs={
+ "foo_terms": {
+ "terms": {
+ "field": "foo"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6f855bc92b4cc6e6a63f95bce1cb4441.asciidoc b/docs/examples/6f855bc92b4cc6e6a63f95bce1cb4441.asciidoc
new file mode 100644
index 000000000..139cdcd7b
--- /dev/null
+++ b/docs/examples/6f855bc92b4cc6e6a63f95bce1cb4441.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/logstash/get-pipeline.asciidoc:69
+
+[source, python]
+----
+resp = client.logstash.get_pipeline(
+ id="my_pipeline",
+)
+print(resp)
+----
diff --git a/docs/examples/6f8a682c908b826ca90cadd9d2f582b4.asciidoc b/docs/examples/6f8a682c908b826ca90cadd9d2f582b4.asciidoc
new file mode 100644
index 000000000..9694c6211
--- /dev/null
+++ b/docs/examples/6f8a682c908b826ca90cadd9d2f582b4.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:670
+
+[source, python]
+----
+resp = client.search(
+ stored_fields=[
+ "user",
+ "postDate"
+ ],
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6fa570ae7039171e2ab722344ec1063f.asciidoc b/docs/examples/6fa570ae7039171e2ab722344ec1063f.asciidoc
new file mode 100644
index 000000000..787c451f0
--- /dev/null
+++ b/docs/examples/6fa570ae7039171e2ab722344ec1063f.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-field-mapping.asciidoc:14
+
+[source, python]
+----
+resp = client.indices.get_field_mapping(
+ index="my-index-000001",
+ fields="user",
+)
+print(resp)
+----
diff --git a/docs/examples/6fbb88f399618e1b47412082062ce2bd.asciidoc b/docs/examples/6fbb88f399618e1b47412082062ce2bd.asciidoc
new file mode 100644
index 000000000..f29073f21
--- /dev/null
+++ b/docs/examples/6fbb88f399618e1b47412082062ce2bd.asciidoc
@@ -0,0 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/examples.asciidoc:537
+
+[source, python]
+----
+resp = client.transform.preview_transform(
+ source={
+ "index": "kibana_sample_data_logs"
+ },
+ pivot={
+ "group_by": {
+ "timestamp": {
+ "date_histogram": {
+ "field": "timestamp",
+ "fixed_interval": "1h"
+ }
+ }
+ },
+ "aggregations": {
+ "bytes.max": {
+ "max": {
+ "field": "bytes"
+ }
+ },
+ "top": {
+ "top_metrics": {
+ "metrics": [
+ {
+ "field": "clientip"
+ },
+ {
+ "field": "geo.src"
+ }
+ ],
+ "sort": {
+ "bytes": "desc"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/6fbbf40cab0187f544ff7bca31d18d57.asciidoc b/docs/examples/6fbbf40cab0187f544ff7bca31d18d57.asciidoc
index bc9a445fa..c4728add8 100644
--- a/docs/examples/6fbbf40cab0187f544ff7bca31d18d57.asciidoc
+++ b/docs/examples/6fbbf40cab0187f544ff7bca31d18d57.asciidoc
@@ -1,24 +1,61 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:254
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "Polygon",
"coordinates": [
- [[100, 0], [101, 0], [101, 1], [100, 1], [100, 0]],
[
- [100.2, 0.2],
- [100.8, 0.2],
- [100.8, 0.8],
- [100.2, 0.8],
- [100.2, 0.2],
+ [
+ 100,
+ 0
+ ],
+ [
+ 101,
+ 0
+ ],
+ [
+ 101,
+ 1
+ ],
+ [
+ 100,
+ 1
+ ],
+ [
+ 100,
+ 0
+ ]
],
- ],
+ [
+ [
+ 100.2,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.8
+ ],
+ [
+ 100.2,
+ 0.8
+ ],
+ [
+ 100.2,
+ 0.2
+ ]
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6fc778e9a888b16b937c5c2a7a1ec140.asciidoc b/docs/examples/6fc778e9a888b16b937c5c2a7a1ec140.asciidoc
new file mode 100644
index 000000000..3502d3a1a
--- /dev/null
+++ b/docs/examples/6fc778e9a888b16b937c5c2a7a1ec140.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// searchable-snapshots/apis/clear-cache.asciidoc:69
+
+[source, python]
+----
+resp = client.searchable_snapshots.clear_cache(
+ index="my-index",
+)
+print(resp)
+----
diff --git a/docs/examples/6fd82baa17a48e09e3d2eed514af7f46.asciidoc b/docs/examples/6fd82baa17a48e09e3d2eed514af7f46.asciidoc
index 31f92441f..a61d51e8e 100644
--- a/docs/examples/6fd82baa17a48e09e3d2eed514af7f46.asciidoc
+++ b/docs/examples/6fd82baa17a48e09e3d2eed514af7f46.asciidoc
@@ -1,19 +1,71 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:360
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "MultiLineString",
"coordinates": [
- [[102, 2], [103, 2], [103, 3], [102, 3]],
- [[100, 0], [101, 0], [101, 1], [100, 1]],
- [[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8]],
- ],
+ [
+ [
+ 102,
+ 2
+ ],
+ [
+ 103,
+ 2
+ ],
+ [
+ 103,
+ 3
+ ],
+ [
+ 102,
+ 3
+ ]
+ ],
+ [
+ [
+ 100,
+ 0
+ ],
+ [
+ 101,
+ 0
+ ],
+ [
+ 101,
+ 1
+ ],
+ [
+ 100,
+ 1
+ ]
+ ],
+ [
+ [
+ 100.2,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.8
+ ],
+ [
+ 100.2,
+ 0.8
+ ]
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/6fe6c095c6995e0f2214f5f3bc85d74e.asciidoc b/docs/examples/6fe6c095c6995e0f2214f5f3bc85d74e.asciidoc
new file mode 100644
index 000000000..cba318af2
--- /dev/null
+++ b/docs/examples/6fe6c095c6995e0f2214f5f3bc85d74e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/apis/delete-lifecycle.asciidoc:77
+
+[source, python]
+----
+resp = client.indices.delete_data_lifecycle(
+ name="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/6febf0e6883b23b15ac213abc4bac326.asciidoc b/docs/examples/6febf0e6883b23b15ac213abc4bac326.asciidoc
new file mode 100644
index 000000000..4b9635fac
--- /dev/null
+++ b/docs/examples/6febf0e6883b23b15ac213abc4bac326.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/context-suggest.asciidoc:282
+
+[source, python]
+----
+resp = client.search(
+ index="place",
+ suggest={
+ "place_suggestion": {
+ "prefix": "tim",
+ "completion": {
+ "field": "suggest",
+ "size": 10,
+ "contexts": {
+ "location": {
+ "lat": 43.662,
+ "lon": -79.38
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7011fcdd231804f9c3894154ae2c3fbc.asciidoc b/docs/examples/7011fcdd231804f9c3894154ae2c3fbc.asciidoc
index b7a4f17ab..e66b1c814 100644
--- a/docs/examples/7011fcdd231804f9c3894154ae2c3fbc.asciidoc
+++ b/docs/examples/7011fcdd231804f9c3894154ae2c3fbc.asciidoc
@@ -1,14 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/sparse-vector.asciidoc:14
[source, python]
----
resp = client.indices.create(
index="my-index",
- body={
- "mappings": {
- "properties": {"text.tokens": {"type": "sparse_vector"}}
+ mappings={
+ "properties": {
+ "text.tokens": {
+ "type": "sparse_vector"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/701f1fffc65e9e51c96aa60261e2eae3.asciidoc b/docs/examples/701f1fffc65e9e51c96aa60261e2eae3.asciidoc
new file mode 100644
index 000000000..46263db30
--- /dev/null
+++ b/docs/examples/701f1fffc65e9e51c96aa60261e2eae3.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/update-cross-cluster-api-key.asciidoc:120
+
+[source, python]
+----
+resp = client.security.get_api_key(
+ id="VuaCfGcBCdbkQm-e5aOx",
+)
+print(resp)
+----
diff --git a/docs/examples/7021ddb273a3a00847324d2f670c4c04.asciidoc b/docs/examples/7021ddb273a3a00847324d2f670c4c04.asciidoc
new file mode 100644
index 000000000..e9aaeefe3
--- /dev/null
+++ b/docs/examples/7021ddb273a3a00847324d2f670c4c04.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:548
+
+[source, python]
+----
+resp = client.search(
+ index="image-index",
+ query={
+ "match": {
+ "title": {
+ "query": "mountain lake",
+ "boost": 0.9
+ }
+ }
+ },
+ knn=[
+ {
+ "field": "image-vector",
+ "query_vector": [
+ 54,
+ 10,
+ -2
+ ],
+ "k": 5,
+ "num_candidates": 50,
+ "boost": 0.1
+ },
+ {
+ "field": "title-vector",
+ "query_vector": [
+ 1,
+ 20,
+ -52,
+ 23,
+ 10
+ ],
+ "k": 10,
+ "num_candidates": 10,
+ "boost": 0.5
+ }
+ ],
+ size=10,
+)
+print(resp)
+----
diff --git a/docs/examples/7067a498bb6c788854a26443a64b843a.asciidoc b/docs/examples/7067a498bb6c788854a26443a64b843a.asciidoc
new file mode 100644
index 000000000..d36c4c86e
--- /dev/null
+++ b/docs/examples/7067a498bb6c788854a26443a64b843a.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/script-query.asciidoc:87
+
+[source, python]
+----
+resp = client.search(
+ runtime_mappings={
+ "amount.signed": {
+ "type": "double",
+ "script": "\n double amount = doc['amount'].value;\n if (doc['type'].value == 'expense') {\n amount *= -1;\n }\n emit(amount);\n "
+ }
+ },
+ query={
+ "bool": {
+ "filter": {
+ "range": {
+ "amount.signed": {
+ "lt": 10
+ }
+ }
+ }
+ }
+ },
+ fields=[
+ {
+ "field": "amount.signed"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/708e7ec681be41791f232817a07cda82.asciidoc b/docs/examples/708e7ec681be41791f232817a07cda82.asciidoc
new file mode 100644
index 000000000..522239825
--- /dev/null
+++ b/docs/examples/708e7ec681be41791f232817a07cda82.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/get-snapshot-api.asciidoc:532
+
+[source, python]
+----
+resp = client.snapshot.get(
+ repository="my_repository",
+ snapshot="snapshot*",
+ size="2",
+ sort="name",
+ offset="2",
+)
+print(resp)
+----
diff --git a/docs/examples/70bbe14bc4d5a5d58e81ab2b02408817.asciidoc b/docs/examples/70bbe14bc4d5a5d58e81ab2b02408817.asciidoc
new file mode 100644
index 000000000..fa989dd57
--- /dev/null
+++ b/docs/examples/70bbe14bc4d5a5d58e81ab2b02408817.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/configuring-pki-realm.asciidoc:159
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="users",
+ roles=[
+ "user"
+ ],
+ rules={
+ "field": {
+ "dn": "cn=John Doe,ou=example,o=com"
+ }
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/70c736ecb3746dbe839af0e468712805.asciidoc b/docs/examples/70c736ecb3746dbe839af0e468712805.asciidoc
new file mode 100644
index 000000000..88e06c678
--- /dev/null
+++ b/docs/examples/70c736ecb3746dbe839af0e468712805.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/delete-transform.asciidoc:53
+
+[source, python]
+----
+resp = client.transform.delete_transform(
+ transform_id="ecommerce_transform",
+)
+print(resp)
+----
diff --git a/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc b/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc
index 558393ac8..eb9853587 100644
--- a/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc
+++ b/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc
@@ -1,10 +1,11 @@
-// ml/trained-models/apis/update-trained-model-deployment.asciidoc:74
+// This file is autogenerated, DO NOT EDIT
+// ml/trained-models/apis/update-trained-model-deployment.asciidoc:53
[source, python]
----
resp = client.ml.update_trained_model_deployment(
model_id="elastic__distilbert-base-uncased-finetuned-conll03-english",
- body={"number_of_allocations": 4},
+ number_of_allocations=4,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/70f89dd6b71ea890ad3cf47d83e43344.asciidoc b/docs/examples/70f89dd6b71ea890ad3cf47d83e43344.asciidoc
new file mode 100644
index 000000000..374576745
--- /dev/null
+++ b/docs/examples/70f89dd6b71ea890ad3cf47d83e43344.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:66
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ description="My optional pipeline description",
+ processors=[
+ {
+ "set": {
+ "description": "My optional processor description",
+ "field": "my-long-field",
+ "value": 10
+ }
+ },
+ {
+ "set": {
+ "description": "Set 'my-boolean-field' to true",
+ "field": "my-boolean-field",
+ "value": True
+ }
+ },
+ {
+ "lowercase": {
+ "field": "my-keyword-field"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/7106e6317e6368b9863cf64df9c6f0c9.asciidoc b/docs/examples/7106e6317e6368b9863cf64df9c6f0c9.asciidoc
new file mode 100644
index 000000000..6e7c9ce55
--- /dev/null
+++ b/docs/examples/7106e6317e6368b9863cf64df9c6f0c9.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/put-transform.asciidoc:378
+
+[source, python]
+----
+resp = client.transform.put_transform(
+ transform_id="ecommerce_transform2",
+ source={
+ "index": "kibana_sample_data_ecommerce"
+ },
+ latest={
+ "unique_key": [
+ "customer_id"
+ ],
+ "sort": "order_date"
+ },
+ description="Latest order for each customer",
+ dest={
+ "index": "kibana_sample_data_ecommerce_transform2"
+ },
+ frequency="5m",
+ sync={
+ "time": {
+ "field": "order_date",
+ "delay": "60s"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/711443504b69d0d296e717c716a223e2.asciidoc b/docs/examples/711443504b69d0d296e717c716a223e2.asciidoc
index 2293bf8fb..d030abaa5 100644
--- a/docs/examples/711443504b69d0d296e717c716a223e2.asciidoc
+++ b/docs/examples/711443504b69d0d296e717c716a223e2.asciidoc
@@ -1,37 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/nested-query.asciidoc:212
[source, python]
----
resp = client.search(
index="drivers",
- body={
- "query": {
- "nested": {
- "path": "driver",
- "query": {
- "nested": {
- "path": "driver.vehicle",
- "query": {
- "bool": {
- "must": [
- {
- "match": {
- "driver.vehicle.make": "Powell Motors"
- }
- },
- {
- "match": {
- "driver.vehicle.model": "Canyonero"
- }
- },
- ]
- }
- },
+ query={
+ "nested": {
+ "path": "driver",
+ "query": {
+ "nested": {
+ "path": "driver.vehicle",
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "driver.vehicle.make": "Powell Motors"
+ }
+ },
+ {
+ "match": {
+ "driver.vehicle.model": "Canyonero"
+ }
+ }
+ ]
+ }
}
- },
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7148c8512079d378af70302e65502dd2.asciidoc b/docs/examples/7148c8512079d378af70302e65502dd2.asciidoc
new file mode 100644
index 000000000..4f5a14b50
--- /dev/null
+++ b/docs/examples/7148c8512079d378af70302e65502dd2.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/ilm-tutorial.asciidoc:378
+
+[source, python]
+----
+resp = client.indices.create(
+ index="timeseries-000001",
+ aliases={
+ "timeseries": {
+ "is_write_index": True
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/719141517d83b7e8e929b347a8d67c9f.asciidoc b/docs/examples/719141517d83b7e8e929b347a8d67c9f.asciidoc
new file mode 100644
index 000000000..f9313dec2
--- /dev/null
+++ b/docs/examples/719141517d83b7e8e929b347a8d67c9f.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/restore-from-snapshot.asciidoc:337
+
+[source, python]
+----
+resp = client.indices.get(
+ index="kibana_sample_data_flights,.ds-my-data-stream-2022.06.17-000001",
+ features="settings",
+ flat_settings=True,
+)
+print(resp)
+----
diff --git a/docs/examples/71c629c44bf3c542a0daacbfc253c4b0.asciidoc b/docs/examples/71c629c44bf3c542a0daacbfc253c4b0.asciidoc
new file mode 100644
index 000000000..8bfa286ed
--- /dev/null
+++ b/docs/examples/71c629c44bf3c542a0daacbfc253c4b0.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/stats.asciidoc:1614
+
+[source, python]
+----
+resp = client.cluster.stats(
+ node_id="node1,node*,master:false",
+)
+print(resp)
+----
diff --git a/docs/examples/71de08a2d962c66f0c60677eff23f8d1.asciidoc b/docs/examples/71de08a2d962c66f0c60677eff23f8d1.asciidoc
new file mode 100644
index 000000000..1dd4de34d
--- /dev/null
+++ b/docs/examples/71de08a2d962c66f0c60677eff23f8d1.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/range-aggregation.asciidoc:123
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ aggs={
+ "price_ranges": {
+ "range": {
+ "field": "price",
+ "keyed": True,
+ "ranges": [
+ {
+ "key": "cheap",
+ "to": 100
+ },
+ {
+ "key": "average",
+ "from": 100,
+ "to": 200
+ },
+ {
+ "key": "expensive",
+ "from": 200
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/71e47a83f632ef159956287bbfe4ca12.asciidoc b/docs/examples/71e47a83f632ef159956287bbfe4ca12.asciidoc
new file mode 100644
index 000000000..3b0376acb
--- /dev/null
+++ b/docs/examples/71e47a83f632ef159956287bbfe4ca12.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/shape-query.asciidoc:54
+
+[source, python]
+----
+resp = client.search(
+ index="example",
+ query={
+ "shape": {
+ "geometry": {
+ "shape": {
+ "type": "envelope",
+ "coordinates": [
+ [
+ 1355,
+ 5355
+ ],
+ [
+ 1400,
+ 5200
+ ]
+ ]
+ },
+ "relation": "within"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/71fa652ddea811eb3c8bf8c5db21e549.asciidoc b/docs/examples/71fa652ddea811eb3c8bf8c5db21e549.asciidoc
new file mode 100644
index 000000000..94f43f795
--- /dev/null
+++ b/docs/examples/71fa652ddea811eb3c8bf8c5db21e549.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:224
+
+[source, python]
+----
+resp = client.indices.analyze(
+ index="analyze_sample",
+ analyzer="whitespace",
+ text="this is a test",
+)
+print(resp)
+----
diff --git a/docs/examples/722238b4e7b78cdb3c6a986780e7e286.asciidoc b/docs/examples/722238b4e7b78cdb3c6a986780e7e286.asciidoc
new file mode 100644
index 000000000..f1e03b04d
--- /dev/null
+++ b/docs/examples/722238b4e7b78cdb3c6a986780e7e286.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/range-field-note.asciidoc:105
+
+[source, python]
+----
+resp = client.search(
+ index="range_index",
+ size="0",
+ query={
+ "range": {
+ "time_frame": {
+ "gte": "2019-11-01",
+ "format": "yyyy-MM-dd"
+ }
+ }
+ },
+ aggs={
+ "november_data": {
+ "date_histogram": {
+ "field": "time_frame",
+ "calendar_interval": "day",
+ "format": "yyyy-MM-dd"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/726994d8f3793b86628255a797155a52.asciidoc b/docs/examples/726994d8f3793b86628255a797155a52.asciidoc
new file mode 100644
index 000000000..ebcdb54ef
--- /dev/null
+++ b/docs/examples/726994d8f3793b86628255a797155a52.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors.asciidoc:19
+
+[source, python]
+----
+resp = client.nodes.info(
+ node_id="ingest",
+ filter_path="nodes.*.ingest.processors",
+)
+print(resp)
+----
diff --git a/docs/examples/72a3668ddc95d9aec47cc679d1e7afc5.asciidoc b/docs/examples/72a3668ddc95d9aec47cc679d1e7afc5.asciidoc
new file mode 100644
index 000000000..a10d53464
--- /dev/null
+++ b/docs/examples/72a3668ddc95d9aec47cc679d1e7afc5.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-across-clusters.asciidoc:79
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster": {
+ "remote": {
+ "cluster_one": {
+ "seeds": [
+ "35.238.149.1:9300"
+ ],
+ "skip_unavailable": True
+ },
+ "cluster_two": {
+ "seeds": [
+ "35.238.149.2:9300"
+ ],
+ "skip_unavailable": False
+ },
+ "cluster_three": {
+ "seeds": [
+ "35.238.149.3:9300"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/72ae3851160fcf02b8e2cdfd4e57d238.asciidoc b/docs/examples/72ae3851160fcf02b8e2cdfd4e57d238.asciidoc
new file mode 100644
index 000000000..570c50a35
--- /dev/null
+++ b/docs/examples/72ae3851160fcf02b8e2cdfd4e57d238.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/apis/start.asciidoc:75
+
+[source, python]
+----
+resp = client.ilm.start()
+print(resp)
+----
diff --git a/docs/examples/72b999120785dfba2827268482e9be0a.asciidoc b/docs/examples/72b999120785dfba2827268482e9be0a.asciidoc
new file mode 100644
index 000000000..6a01a402e
--- /dev/null
+++ b/docs/examples/72b999120785dfba2827268482e9be0a.asciidoc
@@ -0,0 +1,98 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/geobounds-aggregation.asciidoc:12
+
+[source, python]
+----
+resp = client.indices.create(
+ index="museums",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="museums",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "location": "POINT (4.912350 52.374081)",
+ "name": "NEMO Science Museum"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "location": "POINT (4.901618 52.369219)",
+ "name": "Museum Het Rembrandthuis"
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "location": "POINT (4.914722 52.371667)",
+ "name": "Nederlands Scheepvaartmuseum"
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "location": "POINT (4.405200 51.222900)",
+ "name": "Letterenhuis"
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "location": "POINT (2.336389 48.861111)",
+ "name": "Musée du Louvre"
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "location": "POINT (2.327000 48.860000)",
+ "name": "Musée d'Orsay"
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="museums",
+ size="0",
+ query={
+ "match": {
+ "name": "musée"
+ }
+ },
+ aggs={
+ "viewport": {
+ "geo_bounds": {
+ "field": "location",
+ "wrap_longitude": True
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/72bae0252b74ff6fd9f0702ff008d84a.asciidoc b/docs/examples/72bae0252b74ff6fd9f0702ff008d84a.asciidoc
new file mode 100644
index 000000000..733bae91a
--- /dev/null
+++ b/docs/examples/72bae0252b74ff6fd9f0702ff008d84a.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/get-snapshot-api.asciidoc:664
+
+[source, python]
+----
+resp = client.snapshot.get(
+ repository="my_repository",
+ snapshot="*",
+ sort="name",
+ from_sort_value="snapshot_2",
+)
+print(resp)
+----
diff --git a/docs/examples/72beebe779a258c225dee7b023e60c52.asciidoc b/docs/examples/72beebe779a258c225dee7b023e60c52.asciidoc
new file mode 100644
index 000000000..ce6925d22
--- /dev/null
+++ b/docs/examples/72beebe779a258c225dee7b023e60c52.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// search/point-in-time-api.asciidoc:108
+
+[source, python]
+----
+resp = client.nodes.stats(
+ metric="indices",
+ index_metric="search",
+)
+print(resp)
+----
diff --git a/docs/examples/72d33fbd72b0766b2f14ea27d9ccf0fa.asciidoc b/docs/examples/72d33fbd72b0766b2f14ea27d9ccf0fa.asciidoc
new file mode 100644
index 000000000..6acb0bfc5
--- /dev/null
+++ b/docs/examples/72d33fbd72b0766b2f14ea27d9ccf0fa.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/disk-usage-exceeded.asciidoc:77
+
+[source, python]
+----
+resp = client.indices.delete(
+ index="my-index",
+)
+print(resp)
+----
diff --git a/docs/examples/73250f845738c428246a3ade66a8f54c.asciidoc b/docs/examples/73250f845738c428246a3ade66a8f54c.asciidoc
new file mode 100644
index 000000000..5c121a602
--- /dev/null
+++ b/docs/examples/73250f845738c428246a3ade66a8f54c.asciidoc
@@ -0,0 +1,53 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/weighted-avg-aggregation.asciidoc:152
+
+[source, python]
+----
+resp = client.index(
+ index="exams",
+ refresh=True,
+ document={
+ "grade": 100,
+ "weight": [
+ 2,
+ 3
+ ]
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="exams",
+ refresh=True,
+ document={
+ "grade": 80,
+ "weight": 3
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="exams",
+ filter_path="aggregations",
+ size=0,
+ runtime_mappings={
+ "weight.combined": {
+ "type": "double",
+ "script": "\n double s = 0;\n for (double w : doc['weight']) {\n s += w;\n }\n emit(s);\n "
+ }
+ },
+ aggs={
+ "weighted_grade": {
+ "weighted_avg": {
+ "value": {
+ "script": "doc.grade.value + 1"
+ },
+ "weight": {
+ "field": "weight.combined"
+ }
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/734e2b1d1ca84a305240a449738f0eba.asciidoc b/docs/examples/734e2b1d1ca84a305240a449738f0eba.asciidoc
new file mode 100644
index 000000000..a7597859b
--- /dev/null
+++ b/docs/examples/734e2b1d1ca84a305240a449738f0eba.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/restore-from-snapshot.asciidoc:467
+
+[source, python]
+----
+resp = client.cat.indices(
+ v=True,
+ index=".ds-my-data-stream-2022.06.17-000001,kibana_sample_data_flightsh=index,status,health",
+)
+print(resp)
+----
diff --git a/docs/examples/73646c12ad33a813ab2280f1dc83500e.asciidoc b/docs/examples/73646c12ad33a813ab2280f1dc83500e.asciidoc
new file mode 100644
index 000000000..3ca8489e1
--- /dev/null
+++ b/docs/examples/73646c12ad33a813ab2280f1dc83500e.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/put-follow.asciidoc:24
+
+[source, python]
+----
+resp = client.ccr.follow(
+ index="",
+ wait_for_active_shards="1",
+ remote_cluster="",
+ leader_index="",
+)
+print(resp)
+----
diff --git a/docs/examples/738db420e3ad2a127ea75fb8e5051926.asciidoc b/docs/examples/738db420e3ad2a127ea75fb8e5051926.asciidoc
new file mode 100644
index 000000000..1f6157572
--- /dev/null
+++ b/docs/examples/738db420e3ad2a127ea75fb8e5051926.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/examples.asciidoc:455
+
+[source, python]
+----
+resp = client.search(
+ index="last-log-from-clientip",
+)
+print(resp)
+----
diff --git a/docs/examples/73b07b24ab2c4cd304a57f9cbda8b863.asciidoc b/docs/examples/73b07b24ab2c4cd304a57f9cbda8b863.asciidoc
new file mode 100644
index 000000000..6fe97c17f
--- /dev/null
+++ b/docs/examples/73b07b24ab2c4cd304a57f9cbda8b863.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// behavioral-analytics/apis/list-analytics-collection.asciidoc:60
+
+[source, python]
+----
+resp = client.search_application.get_behavioral_analytics()
+print(resp)
+----
diff --git a/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc b/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc
index a40392283..0222a857f 100644
--- a/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc
+++ b/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc
@@ -1,9 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// setup/logging-config.asciidoc:180
[source, python]
----
resp = client.cluster.put_settings(
- body={"persistent": {"logger.org.elasticsearch.discovery": "DEBUG"}},
+ persistent={
+ "logger.org.elasticsearch.discovery": "DEBUG"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/73d1a6c5ef90b7e35d43a0bfdc1e158d.asciidoc b/docs/examples/73d1a6c5ef90b7e35d43a0bfdc1e158d.asciidoc
new file mode 100644
index 000000000..adff218d6
--- /dev/null
+++ b/docs/examples/73d1a6c5ef90b7e35d43a0bfdc1e158d.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/rollup-index-caps.asciidoc:88
+
+[source, python]
+----
+resp = client.rollup.get_rollup_index_caps(
+ index="sensor_rollup",
+)
+print(resp)
+----
diff --git a/docs/examples/73df03be6ee78b10106581dbd7cb39ef.asciidoc b/docs/examples/73df03be6ee78b10106581dbd7cb39ef.asciidoc
new file mode 100644
index 000000000..00422a6b3
--- /dev/null
+++ b/docs/examples/73df03be6ee78b10106581dbd7cb39ef.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/movfn-aggregation.asciidoc:489
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "the_movavg": {
+ "moving_fn": {
+ "buckets_path": "the_sum",
+ "window": 10,
+ "script": "MovingFunctions.ewma(values, 0.3)"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/73ebc89cb32adb389ae16bb088d7c7e6.asciidoc b/docs/examples/73ebc89cb32adb389ae16bb088d7c7e6.asciidoc
new file mode 100644
index 000000000..54424173c
--- /dev/null
+++ b/docs/examples/73ebc89cb32adb389ae16bb088d7c7e6.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:84
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.enable": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/73f9271dee9b8539b6aa7e17f323c623.asciidoc b/docs/examples/73f9271dee9b8539b6aa7e17f323c623.asciidoc
new file mode 100644
index 000000000..d8f9feb43
--- /dev/null
+++ b/docs/examples/73f9271dee9b8539b6aa7e17f323c623.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/multi-terms-aggregation.asciidoc:342
+
+[source, python]
+----
+resp = client.search(
+ index="products",
+ aggs={
+ "genres_and_products": {
+ "multi_terms": {
+ "terms": [
+ {
+ "field": "genre"
+ },
+ {
+ "field": "product"
+ }
+ ],
+ "order": {
+ "total_quantity": "desc"
+ }
+ },
+ "aggs": {
+ "total_quantity": {
+ "sum": {
+ "field": "quantity"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/73fa0d6d03cd98ea538fff9e89d99eed.asciidoc b/docs/examples/73fa0d6d03cd98ea538fff9e89d99eed.asciidoc
new file mode 100644
index 000000000..7a44e748a
--- /dev/null
+++ b/docs/examples/73fa0d6d03cd98ea538fff9e89d99eed.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-service-accounts.asciidoc:57
+
+[source, python]
+----
+resp = client.security.get_service_accounts(
+ namespace="elastic",
+ service="fleet-server",
+)
+print(resp)
+----
diff --git a/docs/examples/7404c6e809fee5d7eb9678a82a872806.asciidoc b/docs/examples/7404c6e809fee5d7eb9678a82a872806.asciidoc
new file mode 100644
index 000000000..249d25ca0
--- /dev/null
+++ b/docs/examples/7404c6e809fee5d7eb9678a82a872806.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations.asciidoc:180
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ aggs={
+ "my-agg-name": {
+ "terms": {
+ "field": "my-field"
+ },
+ "aggs": {
+ "my-sub-agg-name": {
+ "avg": {
+ "field": "my-other-field"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/741180473ba526219578ad0422f4fe81.asciidoc b/docs/examples/741180473ba526219578ad0422f4fe81.asciidoc
new file mode 100644
index 000000000..bb11e7c3e
--- /dev/null
+++ b/docs/examples/741180473ba526219578ad0422f4fe81.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-features-api.asciidoc:90
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_connector/my-connector/_features",
+ headers={"Content-Type": "application/json"},
+ body={
+ "features": {
+ "document_level_security": {
+ "enabled": True
+ },
+ "incremental_sync": {
+ "enabled": True
+ },
+ "sync_rules": {
+ "advanced": {
+ "enabled": False
+ },
+ "basic": {
+ "enabled": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc b/docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc
index c16f2f1e5..a124435ab 100644
--- a/docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc
+++ b/docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// inference/post-inference.asciidoc:248
[source, python]
@@ -5,10 +6,10 @@
resp = client.inference.inference(
task_type="text_embedding",
inference_id="my-cohere-endpoint",
- body={
- "input": "The sky above the port was the color of television tuned to a dead channel.",
- "task_settings": {"input_type": "ingest"},
+ input="The sky above the port was the color of television tuned to a dead channel.",
+ task_settings={
+ "input_type": "ingest"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/744aeb2af40f519e430e21e004e3c3b7.asciidoc b/docs/examples/744aeb2af40f519e430e21e004e3c3b7.asciidoc
new file mode 100644
index 000000000..8cf092fe3
--- /dev/null
+++ b/docs/examples/744aeb2af40f519e430e21e004e3c3b7.asciidoc
@@ -0,0 +1,51 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/multivalued-fields.asciidoc:91
+
+[source, python]
+----
+resp = client.indices.create(
+ index="mv",
+ mappings={
+ "properties": {
+ "b": {
+ "type": "long"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="mv",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "a": 1,
+ "b": [
+ 2,
+ 2,
+ 1
+ ]
+ },
+ {
+ "index": {}
+ },
+ {
+ "a": 2,
+ "b": [
+ 1,
+ 1
+ ]
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.esql.query(
+ query="FROM mv | LIMIT 2",
+)
+print(resp2)
+----
diff --git a/docs/examples/7456ef459d510d66ba4492cc9fbdc6c6.asciidoc b/docs/examples/7456ef459d510d66ba4492cc9fbdc6c6.asciidoc
new file mode 100644
index 000000000..4bb5541d1
--- /dev/null
+++ b/docs/examples/7456ef459d510d66ba4492cc9fbdc6c6.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/cluster/remote-clusters-connect.asciidoc:194
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster": {
+ "remote": {
+ "cluster_two": {
+ "mode": None,
+ "seeds": None,
+ "skip_unavailable": None,
+ "transport.compress": None
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/74678f8bbc7e4fc1885719d1cf63ac67.asciidoc b/docs/examples/74678f8bbc7e4fc1885719d1cf63ac67.asciidoc
new file mode 100644
index 000000000..f93e39a72
--- /dev/null
+++ b/docs/examples/74678f8bbc7e4fc1885719d1cf63ac67.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/daterange-aggregation.asciidoc:354
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "range": {
+ "date_range": {
+ "field": "date",
+ "format": "MM-yyy",
+ "ranges": [
+ {
+ "from": "01-2015",
+ "to": "03-2015",
+ "key": "quarter_01"
+ },
+ {
+ "from": "03-2015",
+ "to": "06-2015",
+ "key": "quarter_02"
+ }
+ ],
+ "keyed": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/746e0a1cb5984f2672963b363505c7b3.asciidoc b/docs/examples/746e0a1cb5984f2672963b363505c7b3.asciidoc
index c848996db..265bb0fb3 100644
--- a/docs/examples/746e0a1cb5984f2672963b363505c7b3.asciidoc
+++ b/docs/examples/746e0a1cb5984f2672963b363505c7b3.asciidoc
@@ -1,33 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/date.asciidoc:189
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "date": {
- "type": "date",
- "format": "strict_date_optional_time||epoch_second",
- }
+ mappings={
+ "properties": {
+ "date": {
+ "type": "date",
+ "format": "strict_date_optional_time||epoch_second"
}
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="example",
- refresh="true",
- body={"date": 1618321898},
+ refresh=True,
+ document={
+ "date": 1618321898
+ },
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
- body={"fields": [{"field": "date"}], "_source": False},
+ fields=[
+ {
+ "field": "date"
+ }
+ ],
+ source=False,
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/746e87db7e1e8b5e6b40d8b5b188de42.asciidoc b/docs/examples/746e87db7e1e8b5e6b40d8b5b188de42.asciidoc
new file mode 100644
index 000000000..4b79be329
--- /dev/null
+++ b/docs/examples/746e87db7e1e8b5e6b40d8b5b188de42.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/stats-aggregation.asciidoc:14
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size="0",
+ aggs={
+ "grades_stats": {
+ "stats": {
+ "field": "grade"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7471e97aaaf21c3a200abdd89f15c3cc.asciidoc b/docs/examples/7471e97aaaf21c3a200abdd89f15c3cc.asciidoc
new file mode 100644
index 000000000..63f567ecd
--- /dev/null
+++ b/docs/examples/7471e97aaaf21c3a200abdd89f15c3cc.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/intervals-query.asciidoc:312
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "intervals": {
+ "my_text": {
+ "match": {
+ "query": "hot porridge",
+ "max_gaps": 10,
+ "filter": {
+ "not_containing": {
+ "match": {
+ "query": "salty"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/747a4b5001423938d7d05399d28f1995.asciidoc b/docs/examples/747a4b5001423938d7d05399d28f1995.asciidoc
new file mode 100644
index 000000000..b23e2cc58
--- /dev/null
+++ b/docs/examples/747a4b5001423938d7d05399d28f1995.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/ilm-with-existing-indices.asciidoc:74
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "indices.lifecycle.poll_interval": "1m"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/74a80c28737a0648db0dfe7f049d12f2.asciidoc b/docs/examples/74a80c28737a0648db0dfe7f049d12f2.asciidoc
index 32a60a025..c94c2b279 100644
--- a/docs/examples/74a80c28737a0648db0dfe7f049d12f2.asciidoc
+++ b/docs/examples/74a80c28737a0648db0dfe7f049d12f2.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:272
[source, python]
@@ -7,4 +8,4 @@ resp = client.exists(
id="0",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/74b13ceb6cda3acaa9e9f58c9e5e2431.asciidoc b/docs/examples/74b13ceb6cda3acaa9e9f58c9e5e2431.asciidoc
new file mode 100644
index 000000000..dcf829c3d
--- /dev/null
+++ b/docs/examples/74b13ceb6cda3acaa9e9f58c9e5e2431.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/meta-field.asciidoc:31
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my-index-000001",
+ meta={
+ "class": "MyApp2::User3",
+ "version": {
+ "min": "1.3",
+ "max": "1.5"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/74b229a6e020113e5749099451979c89.asciidoc b/docs/examples/74b229a6e020113e5749099451979c89.asciidoc
new file mode 100644
index 000000000..d4560e688
--- /dev/null
+++ b/docs/examples/74b229a6e020113e5749099451979c89.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/semantic-query.asciidoc:172
+
+[source, python]
+----
+resp = client.search(
+ index="test-index",
+ query={
+ "nested": {
+ "path": "inference_field.inference.chunks",
+ "query": {
+ "knn": {
+ "field": "inference_field.inference.chunks.embeddings",
+ "query_vector_builder": {
+ "text_embedding": {
+ "model_id": "my_inference_id",
+ "model_text": "mountain lake"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/74da377bccad43da2b0e276c086d26ba.asciidoc b/docs/examples/74da377bccad43da2b0e276c086d26ba.asciidoc
new file mode 100644
index 000000000..731c683e3
--- /dev/null
+++ b/docs/examples/74da377bccad43da2b0e276c086d26ba.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/cluster-info.asciidoc:382
+
+[source, python]
+----
+resp = client.cluster.info(
+ target="_all",
+)
+print(resp)
+
+resp1 = client.cluster.info(
+ target="http",
+)
+print(resp1)
+
+resp2 = client.cluster.info(
+ target="ingest",
+)
+print(resp2)
+
+resp3 = client.cluster.info(
+ target="thread_pool",
+)
+print(resp3)
+
+resp4 = client.cluster.info(
+ target="script",
+)
+print(resp4)
+
+resp5 = client.cluster.info(
+ target="http,ingest",
+)
+print(resp5)
+----
diff --git a/docs/examples/7594a9a85c8511701e281974cbc253e1.asciidoc b/docs/examples/7594a9a85c8511701e281974cbc253e1.asciidoc
new file mode 100644
index 000000000..5341b6947
--- /dev/null
+++ b/docs/examples/7594a9a85c8511701e281974cbc253e1.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-task.asciidoc:204
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="amazon_bedrock_embeddings",
+ inference_config={
+ "service": "amazonbedrock",
+ "service_settings": {
+ "access_key": "",
+ "secret_key": "",
+ "region": "",
+ "provider": "",
+ "model": ""
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/75957a7d1b67e3d47899c5f18b32cb61.asciidoc b/docs/examples/75957a7d1b67e3d47899c5f18b32cb61.asciidoc
new file mode 100644
index 000000000..c6b6cad6c
--- /dev/null
+++ b/docs/examples/75957a7d1b67e3d47899c5f18b32cb61.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/close-job.asciidoc:99
+
+[source, python]
+----
+resp = client.ml.close_job(
+ job_id="low_request_rate",
+)
+print(resp)
+----
diff --git a/docs/examples/75aba7b1d3a22dce62f26b8b1e6bee58.asciidoc b/docs/examples/75aba7b1d3a22dce62f26b8b1e6bee58.asciidoc
new file mode 100644
index 000000000..d603f109b
--- /dev/null
+++ b/docs/examples/75aba7b1d3a22dce62f26b8b1e6bee58.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/validate.asciidoc:167
+
+[source, python]
+----
+resp = client.indices.validate_query(
+ index="my-index-000001",
+ explain=True,
+ query={
+ "query_string": {
+ "query": "@timestamp:foo",
+ "lenient": False
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/75c347b181112d2c4538c01ade903afe.asciidoc b/docs/examples/75c347b181112d2c4538c01ade903afe.asciidoc
new file mode 100644
index 000000000..385575973
--- /dev/null
+++ b/docs/examples/75c347b181112d2c4538c01ade903afe.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:257
+
+[source, python]
+----
+resp = client.indices.validate_query(
+ index="my-index-000001",
+ rewrite=True,
+ query={
+ "match": {
+ "user.id": {
+ "query": "kimchy",
+ "fuzziness": "auto"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/75e13a00f0909c955031ff62acc14a79.asciidoc b/docs/examples/75e13a00f0909c955031ff62acc14a79.asciidoc
new file mode 100644
index 000000000..01d7717cd
--- /dev/null
+++ b/docs/examples/75e13a00f0909c955031ff62acc14a79.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/collapse-search-results.asciidoc:12
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "message": "GET /search"
+ }
+ },
+ collapse={
+ "field": "user.id"
+ },
+ sort=[
+ {
+ "http.response.bytes": {
+ "order": "desc"
+ }
+ }
+ ],
+ from_=0,
+)
+print(resp)
+----
diff --git a/docs/examples/75e360d03fb416f0a65ca37c662c2e9c.asciidoc b/docs/examples/75e360d03fb416f0a65ca37c662c2e9c.asciidoc
new file mode 100644
index 000000000..ba108824b
--- /dev/null
+++ b/docs/examples/75e360d03fb416f0a65ca37c662c2e9c.asciidoc
@@ -0,0 +1,49 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/scripted-metric-aggregation.asciidoc:155
+
+[source, python]
+----
+resp = client.bulk(
+ index="transactions",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "type": "sale",
+ "amount": 80
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "type": "cost",
+ "amount": 10
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "type": "cost",
+ "amount": 30
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "type": "sale",
+ "amount": 130
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/75e6d66e94e61bd8a555beaaee255c36.asciidoc b/docs/examples/75e6d66e94e61bd8a555beaaee255c36.asciidoc
new file mode 100644
index 000000000..b8e011dc5
--- /dev/null
+++ b/docs/examples/75e6d66e94e61bd8a555beaaee255c36.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/rollup-search.asciidoc:170
+
+[source, python]
+----
+resp = client.rollup.rollup_search(
+ index="sensor_rollup",
+ size=0,
+ aggregations={
+ "avg_temperature": {
+ "avg": {
+ "field": "temperature"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/763ce1377c8dfa1ca6a042d8ee99f4f5.asciidoc b/docs/examples/763ce1377c8dfa1ca6a042d8ee99f4f5.asciidoc
new file mode 100644
index 000000000..a30332ff6
--- /dev/null
+++ b/docs/examples/763ce1377c8dfa1ca6a042d8ee99f4f5.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/tsds-reindex.asciidoc:284
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="k9s",
+)
+print(resp)
+----
diff --git a/docs/examples/76448aaaaa2c352bb6e09d2f83a3fbb3.asciidoc b/docs/examples/76448aaaaa2c352bb6e09d2f83a3fbb3.asciidoc
new file mode 100644
index 000000000..b01f4861b
--- /dev/null
+++ b/docs/examples/76448aaaaa2c352bb6e09d2f83a3fbb3.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/letter-tokenizer.asciidoc:16
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="letter",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/7659f2f2b0fbe8584b855a01638b95ed.asciidoc b/docs/examples/7659f2f2b0fbe8584b855a01638b95ed.asciidoc
new file mode 100644
index 000000000..147d29f43
--- /dev/null
+++ b/docs/examples/7659f2f2b0fbe8584b855a01638b95ed.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:777
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "user_name": {
+ "terms": {
+ "field": "user_name"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/765c9c8b40b67a42121648045dbf10fb.asciidoc b/docs/examples/765c9c8b40b67a42121648045dbf10fb.asciidoc
new file mode 100644
index 000000000..d982e4527
--- /dev/null
+++ b/docs/examples/765c9c8b40b67a42121648045dbf10fb.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/jvm-memory-pressure.asciidoc:11
+
+[source, python]
+----
+resp = client.nodes.stats(
+ filter_path="nodes.*.jvm.mem.pools.old",
+)
+print(resp)
+----
diff --git a/docs/examples/766cfc1c9fcd2c186e965761ceb2c07d.asciidoc b/docs/examples/766cfc1c9fcd2c186e965761ceb2c07d.asciidoc
new file mode 100644
index 000000000..23e3db786
--- /dev/null
+++ b/docs/examples/766cfc1c9fcd2c186e965761ceb2c07d.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/increase-tier-capacity.asciidoc:300
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my-index-000001",
+ settings={
+ "index": {
+ "number_of_replicas": 1
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/769f75829a8e6670aa4cf83d0d737046.asciidoc b/docs/examples/769f75829a8e6670aa4cf83d0d737046.asciidoc
new file mode 100644
index 000000000..92011cd79
--- /dev/null
+++ b/docs/examples/769f75829a8e6670aa4cf83d0d737046.asciidoc
@@ -0,0 +1,49 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/autodatehistogram-aggregation.asciidoc:124
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "date": "2015-10-01T00:30:00Z"
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="2",
+ refresh=True,
+ document={
+ "date": "2015-10-01T01:30:00Z"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="my-index-000001",
+ id="3",
+ refresh=True,
+ document={
+ "date": "2015-10-01T02:30:00Z"
+ },
+)
+print(resp2)
+
+resp3 = client.search(
+ index="my-index-000001",
+ size="0",
+ aggs={
+ "by_day": {
+ "auto_date_histogram": {
+ "field": "date",
+ "buckets": 3
+ }
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/76b279835936ee4b546a171c671c3cd7.asciidoc b/docs/examples/76b279835936ee4b546a171c671c3cd7.asciidoc
new file mode 100644
index 000000000..56bc6ae2c
--- /dev/null
+++ b/docs/examples/76b279835936ee4b546a171c671c3cd7.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/cjk-width-tokenfilter.asciidoc:28
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "cjk_width"
+ ],
+ text="シーサイドライナー",
+)
+print(resp)
+----
diff --git a/docs/examples/76bc87c2592864152768687c2963d1d1.asciidoc b/docs/examples/76bc87c2592864152768687c2963d1d1.asciidoc
new file mode 100644
index 000000000..204b2d14b
--- /dev/null
+++ b/docs/examples/76bc87c2592864152768687c2963d1d1.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/update-api-key.asciidoc:148
+
+[source, python]
+----
+resp = client.security.update_api_key(
+ id="VuaCfGcBCdbkQm-e5aOx",
+ role_descriptors={
+ "role-a": {
+ "indices": [
+ {
+ "names": [
+ "*"
+ ],
+ "privileges": [
+ "write"
+ ]
+ }
+ ]
+ }
+ },
+ metadata={
+ "environment": {
+ "level": 2,
+ "trusted": True,
+ "tags": [
+ "production"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/76c167d8ab305cb43b594f140c902dfe.asciidoc b/docs/examples/76c167d8ab305cb43b594f140c902dfe.asciidoc
new file mode 100644
index 000000000..9a6d854d8
--- /dev/null
+++ b/docs/examples/76c167d8ab305cb43b594f140c902dfe.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/shrink-index.asciidoc:162
+
+[source, python]
+----
+resp = client.indices.shrink(
+ index="my_source_index",
+ target="my_target_index",
+ settings={
+ "index.number_of_replicas": 1,
+ "index.number_of_shards": 1,
+ "index.codec": "best_compression"
+ },
+ aliases={
+ "my_search_indices": {}
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/76dbdd0b2bd48c3c6b1a8d81e23bafd6.asciidoc b/docs/examples/76dbdd0b2bd48c3c6b1a8d81e23bafd6.asciidoc
new file mode 100644
index 000000000..88bbfb22e
--- /dev/null
+++ b/docs/examples/76dbdd0b2bd48c3c6b1a8d81e23bafd6.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:143
+
+[source, python]
+----
+resp = client.indices.analyze(
+ analyzer="standard",
+ text="this is a test",
+)
+print(resp)
+----
diff --git a/docs/examples/7709a48020a6cefbbe547fb944541cdb.asciidoc b/docs/examples/7709a48020a6cefbbe547fb944541cdb.asciidoc
index 3e69ce086..10db24405 100644
--- a/docs/examples/7709a48020a6cefbbe547fb944541cdb.asciidoc
+++ b/docs/examples/7709a48020a6cefbbe547fb944541cdb.asciidoc
@@ -1,16 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/dense-vector.asciidoc:392
[source, python]
----
resp = client.bulk(
index="my-bit-vectors",
- refresh="true",
- body=[
- {"index": {"_id": "1"}},
- {"my_vector": [127, -127, 0, 1, 42]},
- {"index": {"_id": "2"}},
- {"my_vector": "8100012a7f"},
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "1"
+ }
+ },
+ {
+ "my_vector": [
+ 127,
+ -127,
+ 0,
+ 1,
+ 42
+ ]
+ },
+ {
+ "index": {
+ "_id": "2"
+ }
+ },
+ {
+ "my_vector": "8100012a7f"
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/77113c65e1755313183a8969233a5a07.asciidoc b/docs/examples/77113c65e1755313183a8969233a5a07.asciidoc
index 846821791..2bce7f079 100644
--- a/docs/examples/77113c65e1755313183a8969233a5a07.asciidoc
+++ b/docs/examples/77113c65e1755313183a8969233a5a07.asciidoc
@@ -1,22 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/keyword.asciidoc:249
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"kwd": {"type": "keyword", "ignore_above": 3}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "kwd": {
+ "type": "keyword",
+ "ignore_above": 3
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"kwd": ["foo", "foo", "bang", "bar", "baz"]},
+ document={
+ "kwd": [
+ "foo",
+ "foo",
+ "bang",
+ "bar",
+ "baz"
+ ]
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/7741a04e7e621c528cd72848d875776d.asciidoc b/docs/examples/7741a04e7e621c528cd72848d875776d.asciidoc
new file mode 100644
index 000000000..13cb70528
--- /dev/null
+++ b/docs/examples/7741a04e7e621c528cd72848d875776d.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-manage-new-data-stream.asciidoc:56
+
+[source, python]
+----
+resp = client.indices.create_data_stream(
+ name="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/77447e2966708e92f5e219d43ac3f00d.asciidoc b/docs/examples/77447e2966708e92f5e219d43ac3f00d.asciidoc
new file mode 100644
index 000000000..10b268ae4
--- /dev/null
+++ b/docs/examples/77447e2966708e92f5e219d43ac3f00d.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/tasks.asciidoc:226
+
+[source, python]
+----
+resp = client.tasks.list(
+ actions="*reindex",
+ wait_for_completion=True,
+ timeout="10s",
+)
+print(resp)
+----
diff --git a/docs/examples/774bfde8793dc4927f7cad2dd91c5b5f.asciidoc b/docs/examples/774bfde8793dc4927f7cad2dd91c5b5f.asciidoc
new file mode 100644
index 000000000..40889a7d3
--- /dev/null
+++ b/docs/examples/774bfde8793dc4927f7cad2dd91c5b5f.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// search/multi-search-template-api.asciidoc:38
+
+[source, python]
+----
+resp = client.msearch_template(
+ index="my-index",
+ search_templates=[
+ {},
+ {
+ "id": "my-search-template",
+ "params": {
+ "query_string": "hello world",
+ "from": 0,
+ "size": 10
+ }
+ },
+ {},
+ {
+ "id": "my-other-search-template",
+ "params": {
+ "query_type": "match_all"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc b/docs/examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc
new file mode 100644
index 000000000..12661f21d
--- /dev/null
+++ b/docs/examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// text-structure/apis/find-message-structure.asciidoc:87
+
+[source, python]
+----
+resp = client.text_structure.find_message_structure(
+ body={
+ "messages": [
+ "[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128",
+ "[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]",
+ "[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]",
+ "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]",
+ "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]",
+ "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]",
+ "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]",
+ "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]",
+ "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]",
+ "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]",
+ "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]",
+ "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]",
+ "[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]",
+ "[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]",
+ "[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]",
+ "[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled",
+ "[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled",
+ "[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled",
+ "[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]",
+ "[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]",
+ "[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized",
+ "[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ..."
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7752b677825523bfb0c38ad9325a6d47.asciidoc b/docs/examples/7752b677825523bfb0c38ad9325a6d47.asciidoc
new file mode 100644
index 000000000..3d71c943a
--- /dev/null
+++ b/docs/examples/7752b677825523bfb0c38ad9325a6d47.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/delete-connector-api.asciidoc:69
+
+[source, python]
+----
+resp = client.connector.delete(
+ connector_id="another-connector",
+ delete_sync_jobs=True,
+)
+print(resp)
+----
diff --git a/docs/examples/776b553df0e507c96dbdbaedecaca0cc.asciidoc b/docs/examples/776b553df0e507c96dbdbaedecaca0cc.asciidoc
index 2246fd547..3794702c4 100644
--- a/docs/examples/776b553df0e507c96dbdbaedecaca0cc.asciidoc
+++ b/docs/examples/776b553df0e507c96dbdbaedecaca0cc.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/infer-trained-model.asciidoc:880
[source, python]
----
resp = client.ml.infer_trained_model(
model_id="model2",
- body={"docs": [{"text_field": "The movie was awesome!!"}]},
+ docs=[
+ {
+ "text_field": "The movie was awesome!!"
+ }
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7777326c6052fee28061e5b82540aedc.asciidoc b/docs/examples/7777326c6052fee28061e5b82540aedc.asciidoc
new file mode 100644
index 000000000..eb61c2f5f
--- /dev/null
+++ b/docs/examples/7777326c6052fee28061e5b82540aedc.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-aggregation.asciidoc:402
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "grade_percentiles": {
+ "percentiles": {
+ "field": "grade",
+ "missing": 10
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7781b13b0ffff6026d10c4e3ab4a3a51.asciidoc b/docs/examples/7781b13b0ffff6026d10c4e3ab4a3a51.asciidoc
new file mode 100644
index 000000000..ed9f75c24
--- /dev/null
+++ b/docs/examples/7781b13b0ffff6026d10c4e3ab4a3a51.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// behavioral-analytics/apis/put-analytics-collection.asciidoc:49
+
+[source, python]
+----
+resp = client.search_application.put_behavioral_analytics(
+ name="my_analytics_collection",
+)
+print(resp)
+----
diff --git a/docs/examples/77828fcaecc3f058c48b955928198ff6.asciidoc b/docs/examples/77828fcaecc3f058c48b955928198ff6.asciidoc
new file mode 100644
index 000000000..ae805b61d
--- /dev/null
+++ b/docs/examples/77828fcaecc3f058c48b955928198ff6.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/grok.asciidoc:132
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "description": "parse multiple patterns",
+ "processors": [
+ {
+ "grok": {
+ "field": "message",
+ "patterns": [
+ "%{FAVORITE_DOG:pet}",
+ "%{FAVORITE_CAT:pet}"
+ ],
+ "pattern_definitions": {
+ "FAVORITE_DOG": "beagle",
+ "FAVORITE_CAT": "burmese"
+ }
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_source": {
+ "message": "I love burmese cats!"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc b/docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc
new file mode 100644
index 000000000..5590d6b84
--- /dev/null
+++ b/docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-azure-openai.asciidoc:121
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="azure_openai_embeddings",
+ inference_config={
+ "service": "azureopenai",
+ "service_settings": {
+ "api_key": "",
+ "resource_name": "",
+ "deployment_id": "",
+ "api_version": "2024-02-01"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/77c099c97ea6911e2dd6e996da7dcca0.asciidoc b/docs/examples/77c099c97ea6911e2dd6e996da7dcca0.asciidoc
new file mode 100644
index 000000000..5536af5cf
--- /dev/null
+++ b/docs/examples/77c099c97ea6911e2dd6e996da7dcca0.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/nodes-hot-threads.asciidoc:72
+
+[source, python]
+----
+resp = client.nodes.hot_threads()
+print(resp)
+
+resp1 = client.nodes.hot_threads(
+ node_id="nodeId1,nodeId2",
+)
+print(resp1)
+----
diff --git a/docs/examples/77c50f982906718ecc59aa708aed728f.asciidoc b/docs/examples/77c50f982906718ecc59aa708aed728f.asciidoc
new file mode 100644
index 000000000..498e9f892
--- /dev/null
+++ b/docs/examples/77c50f982906718ecc59aa708aed728f.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:294
+
+[source, python]
+----
+resp = client.update(
+ index="my-index-000001",
+ id="1",
+ script={
+ "source": "ctx._source.counter += params.count",
+ "lang": "painless",
+ "params": {
+ "count": 4
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/77ca1a3193f75651e0bf9e8fe5227a04.asciidoc b/docs/examples/77ca1a3193f75651e0bf9e8fe5227a04.asciidoc
new file mode 100644
index 000000000..3800f0b25
--- /dev/null
+++ b/docs/examples/77ca1a3193f75651e0bf9e8fe5227a04.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-job-model-snapshot-upgrade-stats.asciidoc:121
+
+[source, python]
+----
+resp = client.ml.get_model_snapshot_upgrade_stats(
+ job_id="low_request_rate",
+ snapshot_id="_all",
+)
+print(resp)
+----
diff --git a/docs/examples/77d0780c5faea4c9ec51a322a6811b3b.asciidoc b/docs/examples/77d0780c5faea4c9ec51a322a6811b3b.asciidoc
index 02b066880..80d2beda2 100644
--- a/docs/examples/77d0780c5faea4c9ec51a322a6811b3b.asciidoc
+++ b/docs/examples/77d0780c5faea4c9ec51a322a6811b3b.asciidoc
@@ -1,47 +1,62 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1311
[source, python]
----
resp = client.bulk(
index="my-index-000001",
- refresh="true",
- body=[
- {"index": {}},
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
{
"timestamp": "2020-04-30T14:30:17-05:00",
- "message": '40.135.0.0 - - [30/Apr/2020:14:30:17 -0500] "GET /images/hm_bg.jpg HTTP/1.0" 200 24736',
+ "message": "40.135.0.0 - - [30/Apr/2020:14:30:17 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": "2020-04-30T14:30:53-05:00",
- "message": '232.0.0.0 - - [30/Apr/2020:14:30:53 -0500] "GET /images/hm_bg.jpg HTTP/1.0" 200 24736',
+ "message": "232.0.0.0 - - [30/Apr/2020:14:30:53 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": "2020-04-30T14:31:12-05:00",
- "message": '26.1.0.0 - - [30/Apr/2020:14:31:12 -0500] "GET /images/hm_bg.jpg HTTP/1.0" 200 24736',
+ "message": "26.1.0.0 - - [30/Apr/2020:14:31:12 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": "2020-04-30T14:31:19-05:00",
- "message": '247.37.0.0 - - [30/Apr/2020:14:31:19 -0500] "GET /french/splash_inet.html HTTP/1.0" 200 3781',
+ "message": "247.37.0.0 - - [30/Apr/2020:14:31:19 -0500] \"GET /french/splash_inet.html HTTP/1.0\" 200 3781"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": "2020-04-30T14:31:22-05:00",
- "message": '247.37.0.0 - - [30/Apr/2020:14:31:22 -0500] "GET /images/hm_nbg.jpg HTTP/1.0" 304 0',
+ "message": "247.37.0.0 - - [30/Apr/2020:14:31:22 -0500] \"GET /images/hm_nbg.jpg HTTP/1.0\" 304 0"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": "2020-04-30T14:31:27-05:00",
- "message": '252.0.0.0 - - [30/Apr/2020:14:31:27 -0500] "GET /images/hm_bg.jpg HTTP/1.0" 200 24736',
+ "message": "252.0.0.0 - - [30/Apr/2020:14:31:27 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
},
- {"index": {}},
{
- "timestamp": "2020-04-30T14:31:28-05:00",
- "message": "not a valid apache log",
+ "index": {}
},
+ {
+ "timestamp": "2020-04-30T14:31:28-05:00",
+ "message": "not a valid apache log"
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/77e3dcd87d2b2c8e6ec842462b02df1f.asciidoc b/docs/examples/77e3dcd87d2b2c8e6ec842462b02df1f.asciidoc
new file mode 100644
index 000000000..80b434a2f
--- /dev/null
+++ b/docs/examples/77e3dcd87d2b2c8e6ec842462b02df1f.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/clone-index.asciidoc:10
+
+[source, python]
+----
+resp = client.indices.clone(
+ index="my-index-000001",
+ target="cloned-my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/78176cd6f570e1534bb40b19e6e900b6.asciidoc b/docs/examples/78176cd6f570e1534bb40b19e6e900b6.asciidoc
new file mode 100644
index 000000000..62ff4fba8
--- /dev/null
+++ b/docs/examples/78176cd6f570e1534bb40b19e6e900b6.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/alias.asciidoc:87
+
+[source, python]
+----
+resp = client.cat.aliases(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/783c4fa5351a242364210fc32496beb2.asciidoc b/docs/examples/783c4fa5351a242364210fc32496beb2.asciidoc
new file mode 100644
index 000000000..0e7da1c3c
--- /dev/null
+++ b/docs/examples/783c4fa5351a242364210fc32496beb2.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/concurrency-control.asciidoc:102
+
+[source, python]
+----
+resp = client.index(
+ index="products",
+ id="1567",
+ if_seq_no="362",
+ if_primary_term="2",
+ document={
+ "product": "r2d2",
+ "details": "A resourceful astromech droid",
+ "tags": [
+ "droid"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7841b65a3bb880ed66cec453925a50cf.asciidoc b/docs/examples/7841b65a3bb880ed66cec453925a50cf.asciidoc
index 63a93884b..c114f375c 100644
--- a/docs/examples/7841b65a3bb880ed66cec453925a50cf.asciidoc
+++ b/docs/examples/7841b65a3bb880ed66cec453925a50cf.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:380
[source, python]
----
resp = client.delete_by_query(
- index=["my-index-000001", "my-index-000002"],
- body={"query": {"match_all": {}}},
+ index="my-index-000001,my-index-000002",
+ query={
+ "match_all": {}
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7846974b47a3eab1832a475663d23ad9.asciidoc b/docs/examples/7846974b47a3eab1832a475663d23ad9.asciidoc
new file mode 100644
index 000000000..c0dd53dea
--- /dev/null
+++ b/docs/examples/7846974b47a3eab1832a475663d23ad9.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:290
+
+[source, python]
+----
+resp = client.search(
+ size=10000,
+ query={
+ "match": {
+ "user.id": "elkbee"
+ }
+ },
+ pit={
+ "id": "46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==",
+ "keep_alive": "1m"
+ },
+ sort=[
+ {
+ "@timestamp": {
+ "order": "asc",
+ "format": "strict_date_optional_time_nanos"
+ }
+ }
+ ],
+ search_after=[
+ "2021-05-20T05:30:04.832Z",
+ 4294967298
+ ],
+ track_total_hits=False,
+)
+print(resp)
+----
diff --git a/docs/examples/7885ca9d7c61050095288eef6bc6cca9.asciidoc b/docs/examples/7885ca9d7c61050095288eef6bc6cca9.asciidoc
new file mode 100644
index 000000000..2367c5ae1
--- /dev/null
+++ b/docs/examples/7885ca9d7c61050095288eef6bc6cca9.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/jwt-realm.asciidoc:676
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="jwt8_users",
+ refresh=True,
+ roles=[
+ "user"
+ ],
+ rules={
+ "all": [
+ {
+ "field": {
+ "realm.name": "jwt8"
+ }
+ },
+ {
+ "field": {
+ "username": "principalname1"
+ }
+ }
+ ]
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/78c4035e4fbf6851140660f6ed2a1fa5.asciidoc b/docs/examples/78c4035e4fbf6851140660f6ed2a1fa5.asciidoc
new file mode 100644
index 000000000..b980e41a9
--- /dev/null
+++ b/docs/examples/78c4035e4fbf6851140660f6ed2a1fa5.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/stats.asciidoc:115
+
+[source, python]
+----
+resp = client.indices.stats()
+print(resp)
+----
diff --git a/docs/examples/78c96113ae4ed0054e581b17542528a7.asciidoc b/docs/examples/78c96113ae4ed0054e581b17542528a7.asciidoc
index b43590212..d7e332f84 100644
--- a/docs/examples/78c96113ae4ed0054e581b17542528a7.asciidoc
+++ b/docs/examples/78c96113ae4ed0054e581b17542528a7.asciidoc
@@ -1,15 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:403
[source, python]
----
resp = client.reindex(
- body={
- "source": {
- "index": "source",
- "query": {"match": {"company": "cat"}},
- },
- "dest": {"index": "dest", "routing": "=cat"},
+ source={
+ "index": "source",
+ "query": {
+ "match": {
+ "company": "cat"
+ }
+ }
+ },
+ dest={
+ "index": "dest",
+ "routing": "=cat"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/78e20b4cff470ed7357de1fd74bcfeb7.asciidoc b/docs/examples/78e20b4cff470ed7357de1fd74bcfeb7.asciidoc
new file mode 100644
index 000000000..b14f14162
--- /dev/null
+++ b/docs/examples/78e20b4cff470ed7357de1fd74bcfeb7.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:135
+
+[source, python]
+----
+resp = client.indices.update_aliases(
+ actions=[
+ {
+ "remove": {
+ "index": "index1",
+ "alias": "logs-non-existing"
+ }
+ },
+ {
+ "add": {
+ "index": "index2",
+ "alias": "logs-non-existing"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/790c49fe2ec638e5e8db51a9236bba35.asciidoc b/docs/examples/790c49fe2ec638e5e8db51a9236bba35.asciidoc
new file mode 100644
index 000000000..e4d76f592
--- /dev/null
+++ b/docs/examples/790c49fe2ec638e5e8db51a9236bba35.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-bounding-box-query.asciidoc:133
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations,my_geoshapes",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_bounding_box": {
+ "pin.location": {
+ "top_left": {
+ "lat": 40.73,
+ "lon": -74.1
+ },
+ "bottom_right": {
+ "lat": 40.01,
+ "lon": -71.12
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/794d9a321b944347d2a8834a07b5eb22.asciidoc b/docs/examples/794d9a321b944347d2a8834a07b5eb22.asciidoc
index 34f7b8233..45c76d191 100644
--- a/docs/examples/794d9a321b944347d2a8834a07b5eb22.asciidoc
+++ b/docs/examples/794d9a321b944347d2a8834a07b5eb22.asciidoc
@@ -1,22 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/range.asciidoc:394
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"my_range": {"type": "integer_range"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "my_range": {
+ "type": "integer_range"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"my_range": {"lte": 2147483647}},
+ document={
+ "my_range": {
+ "lte": 2147483647
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/7965d4dbafdc7ca9e1ee6759939dd2e8.asciidoc b/docs/examples/7965d4dbafdc7ca9e1ee6759939dd2e8.asciidoc
new file mode 100644
index 000000000..a70c0882a
--- /dev/null
+++ b/docs/examples/7965d4dbafdc7ca9e1ee6759939dd2e8.asciidoc
@@ -0,0 +1,80 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/how-watcher-works.asciidoc:50
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="log_errors",
+ metadata={
+ "color": "red"
+ },
+ trigger={
+ "schedule": {
+ "interval": "5m"
+ }
+ },
+ input={
+ "search": {
+ "request": {
+ "indices": "log-events",
+ "body": {
+ "size": 0,
+ "query": {
+ "match": {
+ "status": "error"
+ }
+ }
+ }
+ }
+ }
+ },
+ condition={
+ "compare": {
+ "ctx.payload.hits.total": {
+ "gt": 5
+ }
+ }
+ },
+ transform={
+ "search": {
+ "request": {
+ "indices": "log-events",
+ "body": {
+ "query": {
+ "match": {
+ "status": "error"
+ }
+ }
+ }
+ }
+ }
+ },
+ actions={
+ "my_webhook": {
+ "webhook": {
+ "method": "POST",
+ "host": "mylisteninghost",
+ "port": 9200,
+ "path": "/{{watch_id}}",
+ "body": "Encountered {{ctx.payload.hits.total}} errors"
+ }
+ },
+ "email_administrator": {
+ "email": {
+ "to": "sys.admino@host.domain",
+ "subject": "Encountered {{ctx.payload.hits.total}} errors",
+ "body": "Too many error in the system, see attached data",
+ "attachments": {
+ "attached_data": {
+ "data": {
+ "format": "json"
+ }
+ }
+ },
+ "priority": "high"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/79b43a1bf02fb5b38f54b8d5aa5dab53.asciidoc b/docs/examples/79b43a1bf02fb5b38f54b8d5aa5dab53.asciidoc
new file mode 100644
index 000000000..bfa6324d9
--- /dev/null
+++ b/docs/examples/79b43a1bf02fb5b38f54b8d5aa5dab53.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/autodatehistogram-aggregation.asciidoc:43
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "sales_over_time": {
+ "auto_date_histogram": {
+ "field": "date",
+ "buckets": 5,
+ "format": "yyyy-MM-dd"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/79bf91ace935d095d8e44b3ef3fe2efa.asciidoc b/docs/examples/79bf91ace935d095d8e44b3ef3fe2efa.asciidoc
new file mode 100644
index 000000000..242b68d99
--- /dev/null
+++ b/docs/examples/79bf91ace935d095d8e44b3ef3fe2efa.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/diagnose-unassigned-shards.asciidoc:269
+
+[source, python]
+----
+resp = client.indices.get_settings(
+ index="my-index-000001",
+ flat_settings=True,
+ include_defaults=True,
+)
+print(resp)
+
+resp1 = client.cluster.get_settings(
+ flat_settings=True,
+ include_defaults=True,
+)
+print(resp1)
+----
diff --git a/docs/examples/79cb85efd5e4c435e73b253cb9feabb1.asciidoc b/docs/examples/79cb85efd5e4c435e73b253cb9feabb1.asciidoc
new file mode 100644
index 000000000..9ea1eb83d
--- /dev/null
+++ b/docs/examples/79cb85efd5e4c435e73b253cb9feabb1.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/dissect-syntax.asciidoc:250
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ runtime_mappings={
+ "http.response": {
+ "type": "long",
+ "script": "\n String response=dissect('%{clientip} %{ident} %{auth} [%{@timestamp}] \"%{verb} %{request} HTTP/%{httpversion}\" %{response} %{size}').extract(doc[\"message\"].value)?.response;\n if (response != null) emit(Integer.parseInt(response));\n "
+ }
+ },
+ query={
+ "match": {
+ "http.response": "304"
+ }
+ },
+ fields=[
+ "http.response"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/79e053326a3a8eec828523a035393f66.asciidoc b/docs/examples/79e053326a3a8eec828523a035393f66.asciidoc
new file mode 100644
index 000000000..ad3783c7f
--- /dev/null
+++ b/docs/examples/79e053326a3a8eec828523a035393f66.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:354
+
+[source, python]
+----
+resp = client.delete(
+ index=".ds-my-data-stream-2099.03.08-000003",
+ id="bfspvnIBr7VVZlfp2lqX",
+)
+print(resp)
+----
diff --git a/docs/examples/79e8bbbd6c440a21b0b4260c8cb1a61c.asciidoc b/docs/examples/79e8bbbd6c440a21b0b4260c8cb1a61c.asciidoc
index 0126f7231..57a900b92 100644
--- a/docs/examples/79e8bbbd6c440a21b0b4260c8cb1a61c.asciidoc
+++ b/docs/examples/79e8bbbd6c440a21b0b4260c8cb1a61c.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:208
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "LINESTRING (-77.03653 38.897676, -77.009051 38.889939)"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/79f33e05b203eb46eef7958fbc95ef77.asciidoc b/docs/examples/79f33e05b203eb46eef7958fbc95ef77.asciidoc
new file mode 100644
index 000000000..01da4fc57
--- /dev/null
+++ b/docs/examples/79f33e05b203eb46eef7958fbc95ef77.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/auto-follow/get-auto-follow-pattern.asciidoc:87
+
+[source, python]
+----
+resp = client.ccr.get_auto_follow_pattern(
+ name="my_auto_follow_pattern",
+)
+print(resp)
+----
diff --git a/docs/examples/79feb4a0c0a21b7015a52f9736cd4683.asciidoc b/docs/examples/79feb4a0c0a21b7015a52f9736cd4683.asciidoc
new file mode 100644
index 000000000..240e3b3ab
--- /dev/null
+++ b/docs/examples/79feb4a0c0a21b7015a52f9736cd4683.asciidoc
@@ -0,0 +1,69 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-inner-hits.asciidoc:324
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test",
+ mappings={
+ "properties": {
+ "comments": {
+ "type": "nested",
+ "properties": {
+ "votes": {
+ "type": "nested"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="test",
+ id="1",
+ refresh=True,
+ document={
+ "title": "Test title",
+ "comments": [
+ {
+ "author": "kimchy",
+ "text": "comment text",
+ "votes": []
+ },
+ {
+ "author": "nik9000",
+ "text": "words words words",
+ "votes": [
+ {
+ "value": 1,
+ "voter": "kimchy"
+ },
+ {
+ "value": -1,
+ "voter": "other"
+ }
+ ]
+ }
+ ]
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="test",
+ query={
+ "nested": {
+ "path": "comments.votes",
+ "query": {
+ "match": {
+ "comments.votes.voter": "kimchy"
+ }
+ },
+ "inner_hits": {}
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/7a0c633a67244e9703344d036e584d95.asciidoc b/docs/examples/7a0c633a67244e9703344d036e584d95.asciidoc
new file mode 100644
index 000000000..db177d476
--- /dev/null
+++ b/docs/examples/7a0c633a67244e9703344d036e584d95.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/enable-user-profile.asciidoc:54
+
+[source, python]
+----
+resp = client.security.enable_user_profile(
+ uid="u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0",
+)
+print(resp)
+----
diff --git a/docs/examples/7a0eb2222fe282d3aab66e12feff2a3b.asciidoc b/docs/examples/7a0eb2222fe282d3aab66e12feff2a3b.asciidoc
index 0200c695a..77928735e 100644
--- a/docs/examples/7a0eb2222fe282d3aab66e12feff2a3b.asciidoc
+++ b/docs/examples/7a0eb2222fe282d3aab66e12feff2a3b.asciidoc
@@ -1,45 +1,61 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:834
[source, python]
----
resp = client.index(
index="ip_location",
- refresh="true",
- body={"ip": "192.168.1.1", "country": "Canada", "city": "Montreal"},
+ refresh=True,
+ document={
+ "ip": "192.168.1.1",
+ "country": "Canada",
+ "city": "Montreal"
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="logs",
id="1",
- refresh="true",
- body={"host": "192.168.1.1", "message": "the first message"},
+ refresh=True,
+ document={
+ "host": "192.168.1.1",
+ "message": "the first message"
+ },
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="logs",
id="2",
- refresh="true",
- body={"host": "192.168.1.2", "message": "the second message"},
+ refresh=True,
+ document={
+ "host": "192.168.1.2",
+ "message": "the second message"
+ },
)
-print(resp)
+print(resp2)
-resp = client.search(
+resp3 = client.search(
index="logs",
- body={
- "runtime_mappings": {
- "location": {
- "type": "lookup",
- "target_index": "ip_location",
- "input_field": "host",
- "target_field": "ip",
- "fetch_fields": ["country", "city"],
- }
- },
- "fields": ["host", "message", "location"],
- "_source": False,
+ runtime_mappings={
+ "location": {
+ "type": "lookup",
+ "target_index": "ip_location",
+ "input_field": "host",
+ "target_field": "ip",
+ "fetch_fields": [
+ "country",
+ "city"
+ ]
+ }
},
+ fields=[
+ "host",
+ "message",
+ "location"
+ ],
+ source=False,
)
-print(resp)
-----
\ No newline at end of file
+print(resp3)
+----
diff --git a/docs/examples/7a23a385a63c87cab58fd494870450fd.asciidoc b/docs/examples/7a23a385a63c87cab58fd494870450fd.asciidoc
new file mode 100644
index 000000000..c38503fb5
--- /dev/null
+++ b/docs/examples/7a23a385a63c87cab58fd494870450fd.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-role-mappings.asciidoc:175
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="mapping4",
+ roles=[
+ "superuser"
+ ],
+ enabled=True,
+ rules={
+ "any": [
+ {
+ "field": {
+ "username": "esadmin"
+ }
+ },
+ {
+ "field": {
+ "groups": "cn=admins,dc=example,dc=com"
+ }
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7a2b9a7b2b6553a48bd4db60a939c0fc.asciidoc b/docs/examples/7a2b9a7b2b6553a48bd4db60a939c0fc.asciidoc
index 641a6547d..3a52af89a 100644
--- a/docs/examples/7a2b9a7b2b6553a48bd4db60a939c0fc.asciidoc
+++ b/docs/examples/7a2b9a7b2b6553a48bd4db60a939c0fc.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:331
[source, python]
@@ -5,14 +6,17 @@
resp = client.index(
index="test_index",
id="1",
- refresh="true",
- body={
+ refresh=True,
+ document={
"query": {
"match": {
- "body": {"query": "miss bicycl", "analyzer": "whitespace"}
+ "body": {
+ "query": "miss bicycl",
+ "analyzer": "whitespace"
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7a32f44a1511ecb0d3f0b0ff2aca5c44.asciidoc b/docs/examples/7a32f44a1511ecb0d3f0b0ff2aca5c44.asciidoc
new file mode 100644
index 000000000..984cd88e4
--- /dev/null
+++ b/docs/examples/7a32f44a1511ecb0d3f0b0ff2aca5c44.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// migration/migrate_8_0/migrate_to_java_time.asciidoc:305
+
+[source, python]
+----
+resp = client.indices.update_aliases(
+ actions=[
+ {
+ "remove": {
+ "index": "my-index-000001",
+ "alias": "my-index"
+ }
+ },
+ {
+ "add": {
+ "index": "my-index-000002",
+ "alias": "my-index"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/7a3a7fbd81e5050b42e8c1eca26c7c1d.asciidoc b/docs/examples/7a3a7fbd81e5050b42e8c1eca26c7c1d.asciidoc
new file mode 100644
index 000000000..a1990bd3f
--- /dev/null
+++ b/docs/examples/7a3a7fbd81e5050b42e8c1eca26c7c1d.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/async-search.asciidoc:334
+
+[source, python]
+----
+resp = client.async_search.delete(
+ id="FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=",
+)
+print(resp)
+----
diff --git a/docs/examples/7a8de5606f283f4ef171b015eef6befa.asciidoc b/docs/examples/7a8de5606f283f4ef171b015eef6befa.asciidoc
new file mode 100644
index 000000000..3c62552a4
--- /dev/null
+++ b/docs/examples/7a8de5606f283f4ef171b015eef6befa.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/stats.asciidoc:143
+
+[source, python]
+----
+resp = client.indices.stats(
+ metric="search",
+ groups="group1,group2",
+)
+print(resp)
+----
diff --git a/docs/examples/7a987cd13383bdc990155d7bd5fb221e.asciidoc b/docs/examples/7a987cd13383bdc990155d7bd5fb221e.asciidoc
new file mode 100644
index 000000000..dedf07677
--- /dev/null
+++ b/docs/examples/7a987cd13383bdc990155d7bd5fb221e.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/field-level-security.asciidoc:114
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="test_role5",
+ indices=[
+ {
+ "names": [
+ "*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "field_security": {
+ "grant": [
+ "*"
+ ],
+ "except": [
+ "customer.handle"
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/7ab968a61bb0783f563dd6d29b253901.asciidoc b/docs/examples/7ab968a61bb0783f563dd6d29b253901.asciidoc
new file mode 100644
index 000000000..e5f0a1bf1
--- /dev/null
+++ b/docs/examples/7ab968a61bb0783f563dd6d29b253901.asciidoc
@@ -0,0 +1,54 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:379
+
+[source, python]
+----
+resp = client.indices.create(
+ index="catalan_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "catalan_elision": {
+ "type": "elision",
+ "articles": [
+ "d",
+ "l",
+ "m",
+ "n",
+ "s",
+ "t"
+ ],
+ "articles_case": True
+ },
+ "catalan_stop": {
+ "type": "stop",
+ "stopwords": "_catalan_"
+ },
+ "catalan_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "example"
+ ]
+ },
+ "catalan_stemmer": {
+ "type": "stemmer",
+ "language": "catalan"
+ }
+ },
+ "analyzer": {
+ "rebuilt_catalan": {
+ "tokenizer": "standard",
+ "filter": [
+ "catalan_elision",
+ "lowercase",
+ "catalan_stop",
+ "catalan_keywords",
+ "catalan_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7ae434b3667c589a8e70fe560f4ee3f9.asciidoc b/docs/examples/7ae434b3667c589a8e70fe560f4ee3f9.asciidoc
index 56f2ae857..782dd3688 100644
--- a/docs/examples/7ae434b3667c589a8e70fe560f4ee3f9.asciidoc
+++ b/docs/examples/7ae434b3667c589a8e70fe560f4ee3f9.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:12
[source, python]
@@ -7,4 +8,4 @@ resp = client.update_by_query(
conflicts="proceed",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7b3e913368e96eaa6e22e0d03c81310e.asciidoc b/docs/examples/7b3e913368e96eaa6e22e0d03c81310e.asciidoc
index 2ec03ab3b..09bafa07f 100644
--- a/docs/examples/7b3e913368e96eaa6e22e0d03c81310e.asciidoc
+++ b/docs/examples/7b3e913368e96eaa6e22e0d03c81310e.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/store.asciidoc:30
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"settings": {"index.store.type": "hybridfs"}},
+ settings={
+ "index.store.type": "hybridfs"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7b3f255d28ce5b46d111402b96b41351.asciidoc b/docs/examples/7b3f255d28ce5b46d111402b96b41351.asciidoc
new file mode 100644
index 000000000..a34134d67
--- /dev/null
+++ b/docs/examples/7b3f255d28ce5b46d111402b96b41351.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/run-as-privilege.asciidoc:170
+
+[source, python]
+----
+resp = client.security.put_user(
+ username="admin_user",
+ refresh=True,
+ password="l0ng-r4nd0m-p@ssw0rd",
+ roles=[
+ "my_admin_role"
+ ],
+ full_name="Eirian Zola",
+ metadata={
+ "intelligence": 7
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7b5c231526846f2f7b98d78f3656ae6a.asciidoc b/docs/examples/7b5c231526846f2f7b98d78f3656ae6a.asciidoc
index 56f336f76..66cd93a86 100644
--- a/docs/examples/7b5c231526846f2f7b98d78f3656ae6a.asciidoc
+++ b/docs/examples/7b5c231526846f2f7b98d78f3656ae6a.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:362
[source, python]
@@ -5,7 +6,10 @@
resp = client.update(
index="test",
id="1",
- body={"doc": {"name": "new_name"}, "doc_as_upsert": True},
+ doc={
+ "name": "new_name"
+ },
+ doc_as_upsert=True,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7b7a828c21c856a3cbc41fd2f85108bf.asciidoc b/docs/examples/7b7a828c21c856a3cbc41fd2f85108bf.asciidoc
index 2a6990ca9..d6cc4e321 100644
--- a/docs/examples/7b7a828c21c856a3cbc41fd2f85108bf.asciidoc
+++ b/docs/examples/7b7a828c21c856a3cbc41fd2f85108bf.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:483
[source, python]
@@ -5,11 +6,17 @@
resp = client.indices.refresh()
print(resp)
-resp = client.search(
+resp1 = client.search(
index="my-index-000001",
size="0",
filter_path="hits.total",
- body={"query": {"range": {"http.response.bytes": {"lt": 2000000}}}},
+ query={
+ "range": {
+ "http.response.bytes": {
+ "lt": 2000000
+ }
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/7b864d61767ab283cfd5f9b9ba784b1f.asciidoc b/docs/examples/7b864d61767ab283cfd5f9b9ba784b1f.asciidoc
new file mode 100644
index 000000000..510099f4a
--- /dev/null
+++ b/docs/examples/7b864d61767ab283cfd5f9b9ba784b1f.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:201
+
+[source, python]
+----
+resp = client.security.get_api_key(
+ name="my-api-key",
+)
+print(resp)
+----
diff --git a/docs/examples/7b908b1189f076942de8cd497ff1fa59.asciidoc b/docs/examples/7b908b1189f076942de8cd497ff1fa59.asciidoc
index 1c7070a6a..53f80a042 100644
--- a/docs/examples/7b908b1189f076942de8cd497ff1fa59.asciidoc
+++ b/docs/examples/7b908b1189f076942de8cd497ff1fa59.asciidoc
@@ -1,17 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:216
[source, python]
----
resp = client.search(
- body={
- "query": {
- "multi_match": {
- "query": "quick brown fox",
- "type": "most_fields",
- "fields": ["title", "title.original", "title.shingles"],
- }
+ query={
+ "multi_match": {
+ "query": "quick brown fox",
+ "type": "most_fields",
+ "fields": [
+ "title",
+ "title.original",
+ "title.shingles"
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7b9dfe5857bde1bd8483ea3241656714.asciidoc b/docs/examples/7b9dfe5857bde1bd8483ea3241656714.asciidoc
new file mode 100644
index 000000000..f3dab13d5
--- /dev/null
+++ b/docs/examples/7b9dfe5857bde1bd8483ea3241656714.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/whitespace-tokenizer.asciidoc:14
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/7c24d4bef3f2045407fbf1b95c5416f9.asciidoc b/docs/examples/7c24d4bef3f2045407fbf1b95c5416f9.asciidoc
index 4d988bd51..8765d6e47 100644
--- a/docs/examples/7c24d4bef3f2045407fbf1b95c5416f9.asciidoc
+++ b/docs/examples/7c24d4bef3f2045407fbf1b95c5416f9.asciidoc
@@ -1,32 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/range.asciidoc:34
[source, python]
----
resp = client.indices.create(
index="range_index",
- body={
- "settings": {"number_of_shards": 2},
- "mappings": {
- "properties": {
- "expected_attendees": {"type": "integer_range"},
- "time_frame": {
- "type": "date_range",
- "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis",
- },
+ settings={
+ "number_of_shards": 2
+ },
+ mappings={
+ "properties": {
+ "expected_attendees": {
+ "type": "integer_range"
+ },
+ "time_frame": {
+ "type": "date_range",
+ "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
}
- },
+ }
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="range_index",
id="1",
- refresh="true",
- body={
- "expected_attendees": {"gte": 10, "lt": 20},
- "time_frame": {"gte": "2015-10-31 12:00:00", "lte": "2015-11-01"},
+ refresh=True,
+ document={
+ "expected_attendees": {
+ "gte": 10,
+ "lt": 20
+ },
+ "time_frame": {
+ "gte": "2015-10-31 12:00:00",
+ "lte": "2015-11-01"
+ }
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/7c3414279d47e9c29105d061ed316ef8.asciidoc b/docs/examples/7c3414279d47e9c29105d061ed316ef8.asciidoc
new file mode 100644
index 000000000..cb0f3776d
--- /dev/null
+++ b/docs/examples/7c3414279d47e9c29105d061ed316ef8.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/completion-suggest.asciidoc:104
+
+[source, python]
+----
+resp = client.index(
+ index="music",
+ id="1",
+ refresh=True,
+ document={
+ "suggest": [
+ "Nevermind",
+ "Nirvana"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7c4551abbb7a5f3841109f7664bc4aad.asciidoc b/docs/examples/7c4551abbb7a5f3841109f7664bc4aad.asciidoc
new file mode 100644
index 000000000..96919aa01
--- /dev/null
+++ b/docs/examples/7c4551abbb7a5f3841109f7664bc4aad.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/pattern-analyzer.asciidoc:267
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "camel": {
+ "type": "pattern",
+ "pattern": "([^\\p{L}\\d]+)|(?<=\\D)(?=\\d)|(?<=\\d)(?=\\D)|(?<=[\\p{L}&&[^\\p{Lu}]])(?=\\p{Lu})|(?<=\\p{Lu})(?=\\p{Lu}[\\p{L}&&[^\\p{Lu}]])"
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="camel",
+ text="MooseX::FTPClass2_beta",
+)
+print(resp1)
+----
diff --git a/docs/examples/7c5aed55a2a1dce4b63c18e1ce8146ff.asciidoc b/docs/examples/7c5aed55a2a1dce4b63c18e1ce8146ff.asciidoc
new file mode 100644
index 000000000..75006c7e9
--- /dev/null
+++ b/docs/examples/7c5aed55a2a1dce4b63c18e1ce8146ff.asciidoc
@@ -0,0 +1,109 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/ipprefix-aggregation.asciidoc:14
+
+[source, python]
+----
+resp = client.indices.create(
+ index="network-traffic",
+ mappings={
+ "properties": {
+ "ipv4": {
+ "type": "ip"
+ },
+ "ipv6": {
+ "type": "ip"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="network-traffic",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 0
+ }
+ },
+ {
+ "ipv4": "192.168.1.10",
+ "ipv6": "2001:db8:a4f8:112a:6001:0:12:7f10"
+ },
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "ipv4": "192.168.1.12",
+ "ipv6": "2001:db8:a4f8:112a:6001:0:12:7f12"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "ipv4": "192.168.1.33",
+ "ipv6": "2001:db8:a4f8:112a:6001:0:12:7f33"
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "ipv4": "192.168.1.10",
+ "ipv6": "2001:db8:a4f8:112a:6001:0:12:7f10"
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "ipv4": "192.168.2.41",
+ "ipv6": "2001:db8:a4f8:112c:6001:0:12:7f41"
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "ipv4": "192.168.2.10",
+ "ipv6": "2001:db8:a4f8:112c:6001:0:12:7f10"
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "ipv4": "192.168.2.23",
+ "ipv6": "2001:db8:a4f8:112c:6001:0:12:7f23"
+ },
+ {
+ "index": {
+ "_id": 7
+ }
+ },
+ {
+ "ipv4": "192.168.3.201",
+ "ipv6": "2001:db8:a4f8:114f:6001:0:12:7201"
+ },
+ {
+ "index": {
+ "_id": 8
+ }
+ },
+ {
+ "ipv4": "192.168.3.107",
+ "ipv6": "2001:db8:a4f8:114f:6001:0:12:7307"
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/7c5e41a7c0075d87b8f8348a6efa990c.asciidoc b/docs/examples/7c5e41a7c0075d87b8f8348a6efa990c.asciidoc
new file mode 100644
index 000000000..abc8f7f2f
--- /dev/null
+++ b/docs/examples/7c5e41a7c0075d87b8f8348a6efa990c.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/managing.asciidoc:102
+
+[source, python]
+----
+resp = client.ccr.pause_follow(
+ index="follower_index",
+)
+print(resp)
+
+resp1 = client.indices.close(
+ index="follower_index",
+)
+print(resp1)
+
+resp2 = client.ccr.follow(
+ index="follower_index",
+ wait_for_active_shards="1",
+ remote_cluster="remote_cluster",
+ leader_index="leader_index",
+)
+print(resp2)
+----
diff --git a/docs/examples/7c8f207e43115ea8f20d2298be5aaebc.asciidoc b/docs/examples/7c8f207e43115ea8f20d2298be5aaebc.asciidoc
new file mode 100644
index 000000000..106984537
--- /dev/null
+++ b/docs/examples/7c8f207e43115ea8f20d2298be5aaebc.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/simulate-ingest.asciidoc:56
+
+[source, python]
+----
+resp = client.simulate.ingest(
+ body={
+ "docs": [
+ {
+ "_index": "my-index",
+ "_id": "id",
+ "_source": {
+ "foo": "bar"
+ }
+ },
+ {
+ "_index": "my-index",
+ "_id": "id",
+ "_source": {
+ "foo": "rab"
+ }
+ }
+ ],
+ "pipeline_substitutions": {
+ "my-pipeline": {
+ "processors": [
+ {
+ "set": {
+ "field": "field3",
+ "value": "value3"
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7c9076f3e93a8f61189783c736bf6082.asciidoc b/docs/examples/7c9076f3e93a8f61189783c736bf6082.asciidoc
new file mode 100644
index 000000000..70992dea6
--- /dev/null
+++ b/docs/examples/7c9076f3e93a8f61189783c736bf6082.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/field-level-security.asciidoc:43
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="test_role2",
+ indices=[
+ {
+ "names": [
+ "*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "field_security": {
+ "grant": [
+ "event_*"
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/7ca224d1a7de20a15c008e1b9dbda377.asciidoc b/docs/examples/7ca224d1a7de20a15c008e1b9dbda377.asciidoc
index 2bdd311f7..b1a0d6098 100644
--- a/docs/examples/7ca224d1a7de20a15c008e1b9dbda377.asciidoc
+++ b/docs/examples/7ca224d1a7de20a15c008e1b9dbda377.asciidoc
@@ -1,11 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:807
[source, python]
----
resp = client.search(
- body={
- "aggs": {"tags": {"terms": {"field": "tags", "missing": "N/A"}}}
+ aggs={
+ "tags": {
+ "terms": {
+ "field": "tags",
+ "missing": "N/A"
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7cd23457e220c8b64c5b0041d2acc27a.asciidoc b/docs/examples/7cd23457e220c8b64c5b0041d2acc27a.asciidoc
index 75061a19c..6685a274c 100644
--- a/docs/examples/7cd23457e220c8b64c5b0041d2acc27a.asciidoc
+++ b/docs/examples/7cd23457e220c8b64c5b0041d2acc27a.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// setup/advanced-configuration.asciidoc:124
[source, python]
@@ -7,4 +8,4 @@ resp = client.nodes.info(
metric="jvm",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7cd3d8388c51a9f6ee3f730cdaddbb89.asciidoc b/docs/examples/7cd3d8388c51a9f6ee3f730cdaddbb89.asciidoc
index f0f3437d1..0bbe1f915 100644
--- a/docs/examples/7cd3d8388c51a9f6ee3f730cdaddbb89.asciidoc
+++ b/docs/examples/7cd3d8388c51a9f6ee3f730cdaddbb89.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// indices/update-settings.asciidoc:91
[source, python]
----
resp = client.indices.put_settings(
index="my-index-000001",
- body={"index": {"refresh_interval": None}},
+ settings={
+ "index": {
+ "refresh_interval": None
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7d1cbcb545aa19260073dbb2b7ef5074.asciidoc b/docs/examples/7d1cbcb545aa19260073dbb2b7ef5074.asciidoc
new file mode 100644
index 000000000..0198eaf9f
--- /dev/null
+++ b/docs/examples/7d1cbcb545aa19260073dbb2b7ef5074.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:658
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "size": 2,
+ "sources": [
+ {
+ "date": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "1d"
+ }
+ }
+ },
+ {
+ "product": {
+ "terms": {
+ "field": "product"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7d880157a95f64ad339225d4af71c2de.asciidoc b/docs/examples/7d880157a95f64ad339225d4af71c2de.asciidoc
new file mode 100644
index 000000000..da85d0ee3
--- /dev/null
+++ b/docs/examples/7d880157a95f64ad339225d4af71c2de.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/suggest-user-profile.asciidoc:99
+
+[source, python]
+----
+resp = client.security.suggest_user_profiles(
+ name="jack",
+ hint={
+ "uids": [
+ "u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0",
+ "u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0"
+ ],
+ "labels": {
+ "direction": [
+ "north",
+ "east"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7d9eba51a269571ae62fb8b442b373ce.asciidoc b/docs/examples/7d9eba51a269571ae62fb8b442b373ce.asciidoc
new file mode 100644
index 000000000..1bd18aa0c
--- /dev/null
+++ b/docs/examples/7d9eba51a269571ae62fb8b442b373ce.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/stemmer-override-tokenfilter.asciidoc:25
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "custom_stems",
+ "porter_stem"
+ ]
+ }
+ },
+ "filter": {
+ "custom_stems": {
+ "type": "stemmer_override",
+ "rules_path": "analysis/stemmer_override.txt"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7dabae9b37d2cbd724f2a069be9e753b.asciidoc b/docs/examples/7dabae9b37d2cbd724f2a069be9e753b.asciidoc
new file mode 100644
index 000000000..0c8ed226f
--- /dev/null
+++ b/docs/examples/7dabae9b37d2cbd724f2a069be9e753b.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/reset-job.asciidoc:73
+
+[source, python]
+----
+resp = client.ml.reset_job(
+ job_id="total-requests",
+ wait_for_completion=False,
+)
+print(resp)
+----
diff --git a/docs/examples/7daff6b7e668ab8a762b8ab5dff7a167.asciidoc b/docs/examples/7daff6b7e668ab8a762b8ab5dff7a167.asciidoc
new file mode 100644
index 000000000..70e4049e8
--- /dev/null
+++ b/docs/examples/7daff6b7e668ab8a762b8ab5dff7a167.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/sparse-vector-query.asciidoc:255
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "sparse_vector": {
+ "field": "ml.tokens",
+ "inference_id": "my-elser-model",
+ "query": "How is the weather in Jamaica?",
+ "prune": True,
+ "pruning_config": {
+ "tokens_freq_ratio_threshold": 5,
+ "tokens_weight_threshold": 0.4,
+ "only_score_pruned_tokens": False
+ }
+ }
+ },
+ rescore={
+ "window_size": 100,
+ "query": {
+ "rescore_query": {
+ "sparse_vector": {
+ "field": "ml.tokens",
+ "inference_id": "my-elser-model",
+ "query": "How is the weather in Jamaica?",
+ "prune": True,
+ "pruning_config": {
+ "tokens_freq_ratio_threshold": 5,
+ "tokens_weight_threshold": 0.4,
+ "only_score_pruned_tokens": True
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7dc6c0a6386289ac6a34105e839ced55.asciidoc b/docs/examples/7dc6c0a6386289ac6a34105e839ced55.asciidoc
new file mode 100644
index 000000000..d2fb36aa9
--- /dev/null
+++ b/docs/examples/7dc6c0a6386289ac6a34105e839ced55.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/rate-aggregation.asciidoc:33
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "by_date": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "my_rate": {
+ "rate": {
+ "unit": "year"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7dc82f7d36686fd57a47e34cbda39a4e.asciidoc b/docs/examples/7dc82f7d36686fd57a47e34cbda39a4e.asciidoc
new file mode 100644
index 000000000..1f3e4192b
--- /dev/null
+++ b/docs/examples/7dc82f7d36686fd57a47e34cbda39a4e.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/delimited-payload-tokenfilter.asciidoc:47
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "delimited_payload"
+ ],
+ text="the|0 brown|10 fox|5 is|0 quick|10",
+)
+print(resp)
+----
diff --git a/docs/examples/7dd481337e40f16185f3baa3fc2cce15.asciidoc b/docs/examples/7dd481337e40f16185f3baa3fc2cce15.asciidoc
new file mode 100644
index 000000000..0fde426a7
--- /dev/null
+++ b/docs/examples/7dd481337e40f16185f3baa3fc2cce15.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/routing-field.asciidoc:38
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "terms": {
+ "_routing": [
+ "user1"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7de7e647c1c9cbe0a1df0d104fc0a947.asciidoc b/docs/examples/7de7e647c1c9cbe0a1df0d104fc0a947.asciidoc
new file mode 100644
index 000000000..493a2bbd7
--- /dev/null
+++ b/docs/examples/7de7e647c1c9cbe0a1df0d104fc0a947.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/repository-s3.asciidoc:20
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_s3_repository",
+ repository={
+ "type": "s3",
+ "settings": {
+ "bucket": "my-bucket"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7dedb148ff74912de81b8f8275f0d7f3.asciidoc b/docs/examples/7dedb148ff74912de81b8f8275f0d7f3.asciidoc
new file mode 100644
index 000000000..c7618c7f7
--- /dev/null
+++ b/docs/examples/7dedb148ff74912de81b8f8275f0d7f3.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:174
+
+[source, python]
+----
+resp = client.search(
+ index="index",
+ aggs={
+ "price_ranges": {
+ "terms": {
+ "field": "price_range"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7df191cc7f814e410a4ac7261065e6ef.asciidoc b/docs/examples/7df191cc7f814e410a4ac7261065e6ef.asciidoc
index eceb43542..6550ab9e4 100644
--- a/docs/examples/7df191cc7f814e410a4ac7261065e6ef.asciidoc
+++ b/docs/examples/7df191cc7f814e410a4ac7261065e6ef.asciidoc
@@ -1,10 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:468
[source, python]
----
resp = client.tasks.list(
- detailed="true",
+ detailed=True,
actions="*byquery",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7e126e2751311db60cfcbb22c9c41caa.asciidoc b/docs/examples/7e126e2751311db60cfcbb22c9c41caa.asciidoc
new file mode 100644
index 000000000..3a10e81ef
--- /dev/null
+++ b/docs/examples/7e126e2751311db60cfcbb22c9c41caa.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/shards.asciidoc:386
+
+[source, python]
+----
+resp = client.cat.shards()
+print(resp)
+----
diff --git a/docs/examples/7e16d21cba51eb8960835b63a1a7266a.asciidoc b/docs/examples/7e16d21cba51eb8960835b63a1a7266a.asciidoc
index 58a4f4a7e..dbb5d7fe8 100644
--- a/docs/examples/7e16d21cba51eb8960835b63a1a7266a.asciidoc
+++ b/docs/examples/7e16d21cba51eb8960835b63a1a7266a.asciidoc
@@ -1,17 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/field-mapping.asciidoc:103
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"dynamic_date_formats": ["MM/dd/yyyy"]}},
+ mappings={
+ "dynamic_date_formats": [
+ "MM/dd/yyyy"
+ ]
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"create_date": "09/25/2015"},
+ document={
+ "create_date": "09/25/2015"
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/7e20b6e15e409b02a5e452ceddf1e1e0.asciidoc b/docs/examples/7e20b6e15e409b02a5e452ceddf1e1e0.asciidoc
new file mode 100644
index 000000000..e017a1ada
--- /dev/null
+++ b/docs/examples/7e20b6e15e409b02a5e452ceddf1e1e0.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:579
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "date": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "1d",
+ "order": "desc"
+ }
+ }
+ },
+ {
+ "product": {
+ "terms": {
+ "field": "product",
+ "order": "asc"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7e2b9bf4ab353c377b761101775edf93.asciidoc b/docs/examples/7e2b9bf4ab353c377b761101775edf93.asciidoc
new file mode 100644
index 000000000..a22a0be09
--- /dev/null
+++ b/docs/examples/7e2b9bf4ab353c377b761101775edf93.asciidoc
@@ -0,0 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-tsds.asciidoc:220
+
+[source, python]
+----
+resp = client.bulk(
+ index="metrics-weather_sensors-dev",
+ operations=[
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2099-05-06T16:21:15.000Z",
+ "sensor_id": "HAL-000001",
+ "location": "plains",
+ "temperature": 26.7,
+ "humidity": 49.9
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2099-05-06T16:25:42.000Z",
+ "sensor_id": "SYKENET-000001",
+ "location": "swamp",
+ "temperature": 32.4,
+ "humidity": 88.9
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.index(
+ index="metrics-weather_sensors-dev",
+ document={
+ "@timestamp": "2099-05-06T16:21:15.000Z",
+ "sensor_id": "SYKENET-000001",
+ "location": "swamp",
+ "temperature": 32.4,
+ "humidity": 88.9
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/7e484b8b41f9dbc2bcf1f340db197c1d.asciidoc b/docs/examples/7e484b8b41f9dbc2bcf1f340db197c1d.asciidoc
index cbafc80b7..acbcbaafd 100644
--- a/docs/examples/7e484b8b41f9dbc2bcf1f340db197c1d.asciidoc
+++ b/docs/examples/7e484b8b41f9dbc2bcf1f340db197c1d.asciidoc
@@ -1,12 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:25
[source, python]
----
resp = client.reindex(
- body={
- "source": {"index": "my-index-000001"},
- "dest": {"index": "my-new-index-000001"},
+ source={
+ "index": "my-index-000001"
+ },
+ dest={
+ "index": "my-new-index-000001"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7e48648ca27024831c60b455e836c496.asciidoc b/docs/examples/7e48648ca27024831c60b455e836c496.asciidoc
new file mode 100644
index 000000000..d9749cec7
--- /dev/null
+++ b/docs/examples/7e48648ca27024831c60b455e836c496.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/pinned-query.asciidoc:55
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "pinned": {
+ "docs": [
+ {
+ "_index": "my-index-000001",
+ "_id": "1"
+ },
+ {
+ "_id": "4"
+ }
+ ],
+ "organic": {
+ "match": {
+ "description": "iphone"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7e49705769c42895fb7b1e2ca028ff47.asciidoc b/docs/examples/7e49705769c42895fb7b1e2ca028ff47.asciidoc
index 8932ecc56..31f9c89ec 100644
--- a/docs/examples/7e49705769c42895fb7b1e2ca028ff47.asciidoc
+++ b/docs/examples/7e49705769c42895fb7b1e2ca028ff47.asciidoc
@@ -1,7 +1,8 @@
-// setup/restart-cluster.asciidoc:219
+// This file is autogenerated, DO NOT EDIT
+// security/securing-communications/update-tls-certificates.asciidoc:713
[source, python]
----
resp = client.cat.nodes()
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7e4cb3de3e3c75646b60f9f81ddc59cc.asciidoc b/docs/examples/7e4cb3de3e3c75646b60f9f81ddc59cc.asciidoc
index c150b3e98..f14130819 100644
--- a/docs/examples/7e4cb3de3e3c75646b60f9f81ddc59cc.asciidoc
+++ b/docs/examples/7e4cb3de3e3c75646b60f9f81ddc59cc.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/clear-trained-model-deployment-cache.asciidoc:43
[source, python]
@@ -6,4 +7,4 @@ resp = client.ml.clear_trained_model_deployment_cache(
model_id="elastic__distilbert-base-uncased-finetuned-conll03-english",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7e5bee18e61d950e823782da1b733903.asciidoc b/docs/examples/7e5bee18e61d950e823782da1b733903.asciidoc
new file mode 100644
index 000000000..5fee705ec
--- /dev/null
+++ b/docs/examples/7e5bee18e61d950e823782da1b733903.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-semantic-text.asciidoc:173
+
+[source, python]
+----
+resp = client.search(
+ index="semantic-embeddings",
+ query={
+ "semantic": {
+ "field": "semantic_text",
+ "query": "How to avoid muscle soreness while running?"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7e5faa551f2c95ffd627da352563d450.asciidoc b/docs/examples/7e5faa551f2c95ffd627da352563d450.asciidoc
new file mode 100644
index 000000000..00324ab22
--- /dev/null
+++ b/docs/examples/7e5faa551f2c95ffd627da352563d450.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-role-mappings.asciidoc:269
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="mapping6",
+ roles=[
+ "example-user"
+ ],
+ enabled=True,
+ rules={
+ "field": {
+ "dn": "*,ou=subtree,dc=example,dc=com"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7e74d1a54e816e8f40cfdaa01b070788.asciidoc b/docs/examples/7e74d1a54e816e8f40cfdaa01b070788.asciidoc
new file mode 100644
index 000000000..1e29d8d13
--- /dev/null
+++ b/docs/examples/7e74d1a54e816e8f40cfdaa01b070788.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// search/rrf.asciidoc:246
+
+[source, python]
+----
+resp = client.search(
+ index="example-index",
+ retriever={
+ "rrf": {
+ "retrievers": [
+ {
+ "standard": {
+ "query": {
+ "term": {
+ "text": "rrf"
+ }
+ }
+ }
+ },
+ {
+ "knn": {
+ "field": "vector",
+ "query_vector": [
+ 3
+ ],
+ "k": 5,
+ "num_candidates": 5
+ }
+ }
+ ],
+ "rank_window_size": 5,
+ "rank_constant": 1
+ }
+ },
+ size=3,
+ aggs={
+ "int_count": {
+ "terms": {
+ "field": "integer"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7e77509ab646276ff78f58bb38bec8dd.asciidoc b/docs/examples/7e77509ab646276ff78f58bb38bec8dd.asciidoc
new file mode 100644
index 000000000..9424c3552
--- /dev/null
+++ b/docs/examples/7e77509ab646276ff78f58bb38bec8dd.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// query-rules/apis/delete-query-ruleset.asciidoc:69
+
+[source, python]
+----
+resp = client.query_rules.delete_ruleset(
+ ruleset_id="my-ruleset",
+)
+print(resp)
+----
diff --git a/docs/examples/7ebeb6cf26be5b5ecdfd408bd0fc3215.asciidoc b/docs/examples/7ebeb6cf26be5b5ecdfd408bd0fc3215.asciidoc
new file mode 100644
index 000000000..52fc6bcb5
--- /dev/null
+++ b/docs/examples/7ebeb6cf26be5b5ecdfd408bd0fc3215.asciidoc
@@ -0,0 +1,64 @@
+// This file is autogenerated, DO NOT EDIT
+// search/profile.asciidoc:1243
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-knn-index",
+ mappings={
+ "properties": {
+ "my-vector": {
+ "type": "dense_vector",
+ "dims": 3,
+ "index": True,
+ "similarity": "l2_norm"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="my-knn-index",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "1"
+ }
+ },
+ {
+ "my-vector": [
+ 1,
+ 5,
+ -20
+ ]
+ },
+ {
+ "index": {
+ "_id": "2"
+ }
+ },
+ {
+ "my-vector": [
+ 42,
+ 8,
+ -15
+ ]
+ },
+ {
+ "index": {
+ "_id": "3"
+ }
+ },
+ {
+ "my-vector": [
+ 15,
+ 11,
+ 23
+ ]
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/7ebfb30b3ece855c1b783d9210939469.asciidoc b/docs/examples/7ebfb30b3ece855c1b783d9210939469.asciidoc
new file mode 100644
index 000000000..3b4263e19
--- /dev/null
+++ b/docs/examples/7ebfb30b3ece855c1b783d9210939469.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/flush-job.asciidoc:102
+
+[source, python]
+----
+resp = client.ml.flush_job(
+ job_id="total-requests",
+ advance_time="1514804400000",
+)
+print(resp)
+----
diff --git a/docs/examples/7ed26b34ce90192a1563dcddf0e45dc0.asciidoc b/docs/examples/7ed26b34ce90192a1563dcddf0e45dc0.asciidoc
new file mode 100644
index 000000000..40da12119
--- /dev/null
+++ b/docs/examples/7ed26b34ce90192a1563dcddf0e45dc0.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/derivative-aggregation.asciidoc:43
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "sales_deriv": {
+ "derivative": {
+ "buckets_path": "sales"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7f2d511cb64743c006225e5933a14bb4.asciidoc b/docs/examples/7f2d511cb64743c006225e5933a14bb4.asciidoc
new file mode 100644
index 000000000..4412a2a08
--- /dev/null
+++ b/docs/examples/7f2d511cb64743c006225e5933a14bb4.asciidoc
@@ -0,0 +1,47 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-across-clusters.asciidoc:67
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="remote1",
+ cluster=[
+ "cross_cluster_search"
+ ],
+ indices=[
+ {
+ "names": [
+ ""
+ ],
+ "privileges": [
+ "read"
+ ]
+ }
+ ],
+ remote_indices=[
+ {
+ "names": [
+ "logs-*"
+ ],
+ "privileges": [
+ "read",
+ "read_cross_cluster"
+ ],
+ "clusters": [
+ "my_remote_cluster"
+ ]
+ }
+ ],
+ remote_cluster=[
+ {
+ "privileges": [
+ "monitor_enrich"
+ ],
+ "clusters": [
+ "my_remote_cluster"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/7f37031fb40b68a61255b7c71d7eed0b.asciidoc b/docs/examples/7f37031fb40b68a61255b7c71d7eed0b.asciidoc
new file mode 100644
index 000000000..1bd88d1ea
--- /dev/null
+++ b/docs/examples/7f37031fb40b68a61255b7c71d7eed0b.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/execute-watch.asciidoc:299
+
+[source, python]
+----
+resp = client.watcher.execute_watch(
+ id="my_watch",
+ action_modes={
+ "action1": "force_simulate",
+ "action2": "skip"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7f514e9e785e4323d16396359cb184f2.asciidoc b/docs/examples/7f514e9e785e4323d16396359cb184f2.asciidoc
index c6a25cd9f..f7d5f81d5 100644
--- a/docs/examples/7f514e9e785e4323d16396359cb184f2.asciidoc
+++ b/docs/examples/7f514e9e785e4323d16396359cb184f2.asciidoc
@@ -1,17 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/range.asciidoc:195
[source, python]
----
resp = client.indices.put_mapping(
index="range_index",
- body={"properties": {"ip_allowlist": {"type": "ip_range"}}},
+ properties={
+ "ip_allowlist": {
+ "type": "ip_range"
+ }
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="range_index",
id="2",
- body={"ip_allowlist": "192.168.0.0/16"},
+ document={
+ "ip_allowlist": "192.168.0.0/16"
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/7f56755fb6c42f7e6203339a6d0cb6e6.asciidoc b/docs/examples/7f56755fb6c42f7e6203339a6d0cb6e6.asciidoc
index 99076f388..08132ba5d 100644
--- a/docs/examples/7f56755fb6c42f7e6203339a6d0cb6e6.asciidoc
+++ b/docs/examples/7f56755fb6c42f7e6203339a6d0cb6e6.asciidoc
@@ -1,18 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/match-query.asciidoc:279
[source, python]
----
resp = client.search(
- body={
- "query": {
- "match": {
- "message": {
- "query": "ny city",
- "auto_generate_synonyms_phrase_query": False,
- }
+ query={
+ "match": {
+ "message": {
+ "query": "ny city",
+ "auto_generate_synonyms_phrase_query": False
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7f92ddd4e940a37d6227c43fd279c8f5.asciidoc b/docs/examples/7f92ddd4e940a37d6227c43fd279c8f5.asciidoc
index a88e9d737..f6d979494 100644
--- a/docs/examples/7f92ddd4e940a37d6227c43fd279c8f5.asciidoc
+++ b/docs/examples/7f92ddd4e940a37d6227c43fd279c8f5.asciidoc
@@ -1,14 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:759
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "size": 1,
- "query": {"match": {"client_ip": "211.11.9.0"}},
- "fields": ["*"],
+ size=1,
+ query={
+ "match": {
+ "client_ip": "211.11.9.0"
+ }
},
+ fields=[
+ "*"
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7fb921376cbf66bf9f381bcdd62030ba.asciidoc b/docs/examples/7fb921376cbf66bf9f381bcdd62030ba.asciidoc
new file mode 100644
index 000000000..9dd99bfbb
--- /dev/null
+++ b/docs/examples/7fb921376cbf66bf9f381bcdd62030ba.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/apis/get-script-contexts-api.asciidoc:10
+
+[source, python]
+----
+resp = client.get_script_context()
+print(resp)
+----
diff --git a/docs/examples/7fbebf0fc9b4a402917a4723ad547c6a.asciidoc b/docs/examples/7fbebf0fc9b4a402917a4723ad547c6a.asciidoc
new file mode 100644
index 000000000..eaab0d4ba
--- /dev/null
+++ b/docs/examples/7fbebf0fc9b4a402917a4723ad547c6a.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/snapshot/corrupt-repository.asciidoc:147
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my-repo",
+ repository={
+ "type": "s3",
+ "settings": {
+ "bucket": "repo-bucket",
+ "client": "elastic-internal-71bcd3",
+ "base_path": "myrepo"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7fd2532f4e12e3efbc58af195060b31e.asciidoc b/docs/examples/7fd2532f4e12e3efbc58af195060b31e.asciidoc
new file mode 100644
index 000000000..44d295447
--- /dev/null
+++ b/docs/examples/7fd2532f4e12e3efbc58af195060b31e.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/charfilters/pattern-replace-charfilter.asciidoc:205
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "text": "The fooBarBaz method"
+ },
+)
+print(resp)
+
+resp1 = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "text": "bar"
+ }
+ },
+ highlight={
+ "fields": {
+ "text": {}
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/7fd5883564d183603e60b37d286ac7e2.asciidoc b/docs/examples/7fd5883564d183603e60b37d286ac7e2.asciidoc
new file mode 100644
index 000000000..924cb88d3
--- /dev/null
+++ b/docs/examples/7fd5883564d183603e60b37d286ac7e2.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/delete-expired-data.asciidoc:64
+
+[source, python]
+----
+resp = client.ml.delete_expired_data(
+ timeout="1h",
+)
+print(resp)
+----
diff --git a/docs/examples/7fde3ff91c4a2e7080444af37d5cd287.asciidoc b/docs/examples/7fde3ff91c4a2e7080444af37d5cd287.asciidoc
new file mode 100644
index 000000000..1e29997a4
--- /dev/null
+++ b/docs/examples/7fde3ff91c4a2e7080444af37d5cd287.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-rest.asciidoc:286
+
+[source, python]
+----
+resp = client.esql.query(
+ query="\n FROM library\n | EVAL year = DATE_EXTRACT(\"year\", release_date)\n | WHERE page_count > ?page_count AND author == ?author\n | STATS count = COUNT(*) by year\n | WHERE count > ?count\n | LIMIT 5\n ",
+ params=[
+ {
+ "page_count": 300
+ },
+ {
+ "author": "Frank Herbert"
+ },
+ {
+ "count": 0
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/7fe2179705304af5e87eb382dca6235a.asciidoc b/docs/examples/7fe2179705304af5e87eb382dca6235a.asciidoc
new file mode 100644
index 000000000..1e81338ed
--- /dev/null
+++ b/docs/examples/7fe2179705304af5e87eb382dca6235a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/set-up-lifecycle-policy.asciidoc:318
+
+[source, python]
+----
+resp = client.indices.open(
+ index="logs-my_app-default",
+)
+print(resp)
+----
diff --git a/docs/examples/7fe9f0a583e079f7fc6fd64d12b6e9e5.asciidoc b/docs/examples/7fe9f0a583e079f7fc6fd64d12b6e9e5.asciidoc
new file mode 100644
index 000000000..cd93609fb
--- /dev/null
+++ b/docs/examples/7fe9f0a583e079f7fc6fd64d12b6e9e5.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/sum-aggregation.asciidoc:54
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ runtime_mappings={
+ "price.weighted": {
+ "type": "double",
+ "script": "\n double price = doc['price'].value;\n if (doc['promoted'].value) {\n price *= 0.8;\n }\n emit(price);\n "
+ }
+ },
+ query={
+ "constant_score": {
+ "filter": {
+ "match": {
+ "type": "hat"
+ }
+ }
+ }
+ },
+ aggs={
+ "hat_prices": {
+ "sum": {
+ "field": "price.weighted"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/7fef68840761c6982c14ad7af96caf37.asciidoc b/docs/examples/7fef68840761c6982c14ad7af96caf37.asciidoc
index e060c6234..01f69f4dd 100644
--- a/docs/examples/7fef68840761c6982c14ad7af96caf37.asciidoc
+++ b/docs/examples/7fef68840761c6982c14ad7af96caf37.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/nested.asciidoc:24
[source, python]
@@ -5,13 +6,19 @@
resp = client.index(
index="my-index-000001",
id="1",
- body={
+ document={
"group": "fans",
"user": [
- {"first": "John", "last": "Smith"},
- {"first": "Alice", "last": "White"},
- ],
+ {
+ "first": "John",
+ "last": "Smith"
+ },
+ {
+ "first": "Alice",
+ "last": "White"
+ }
+ ]
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/7ff4124df0541ee2496034004f4146d4.asciidoc b/docs/examples/7ff4124df0541ee2496034004f4146d4.asciidoc
new file mode 100644
index 000000000..211fedda6
--- /dev/null
+++ b/docs/examples/7ff4124df0541ee2496034004f4146d4.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/eager-global-ordinals.asciidoc:74
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my-index-000001",
+ properties={
+ "tags": {
+ "type": "keyword",
+ "eager_global_ordinals": False
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/800861c15bb33ca01a46fb97dde7537a.asciidoc b/docs/examples/800861c15bb33ca01a46fb97dde7537a.asciidoc
new file mode 100644
index 000000000..95fda5362
--- /dev/null
+++ b/docs/examples/800861c15bb33ca01a46fb97dde7537a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-filter.asciidoc:66
+
+[source, python]
+----
+resp = client.ml.get_filters(
+ filter_id="safe_domains",
+)
+print(resp)
+----
diff --git a/docs/examples/803bbc14fbec0e49dfed9fab49c8a7f8.asciidoc b/docs/examples/803bbc14fbec0e49dfed9fab49c8a7f8.asciidoc
index 2a7dbc02e..9a43c4f53 100644
--- a/docs/examples/803bbc14fbec0e49dfed9fab49c8a7f8.asciidoc
+++ b/docs/examples/803bbc14fbec0e49dfed9fab49c8a7f8.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/term-query.asciidoc:99
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"full_text": {"type": "text"}}}},
+ mappings={
+ "properties": {
+ "full_text": {
+ "type": "text"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/804cdf477ec829740e3d045140400c3b.asciidoc b/docs/examples/804cdf477ec829740e3d045140400c3b.asciidoc
new file mode 100644
index 000000000..61607f892
--- /dev/null
+++ b/docs/examples/804cdf477ec829740e3d045140400c3b.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-semantic-text.asciidoc:68
+
+[source, python]
+----
+resp = client.indices.create(
+ index="semantic-embeddings",
+ mappings={
+ "properties": {
+ "semantic_text": {
+ "type": "semantic_text",
+ "inference_id": "my-elser-endpoint"
+ },
+ "content": {
+ "type": "text",
+ "copy_to": "semantic_text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8051766cadded0892290bc2cc06e145c.asciidoc b/docs/examples/8051766cadded0892290bc2cc06e145c.asciidoc
new file mode 100644
index 000000000..289db73ae
--- /dev/null
+++ b/docs/examples/8051766cadded0892290bc2cc06e145c.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/ack-watch.asciidoc:245
+
+[source, python]
+----
+resp = client.watcher.ack_watch(
+ watch_id="my_watch",
+ action_id="action1,action2",
+)
+print(resp)
+----
diff --git a/docs/examples/805f5550b90e75aa5cc82b90d8c6c242.asciidoc b/docs/examples/805f5550b90e75aa5cc82b90d8c6c242.asciidoc
new file mode 100644
index 000000000..09ee59925
--- /dev/null
+++ b/docs/examples/805f5550b90e75aa5cc82b90d8c6c242.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significanttext-aggregation.asciidoc:221
+
+[source, python]
+----
+resp = client.search(
+ index="news",
+ query={
+ "match": {
+ "content": "elasticsearch"
+ }
+ },
+ aggs={
+ "sample": {
+ "sampler": {
+ "shard_size": 100
+ },
+ "aggs": {
+ "keywords": {
+ "significant_text": {
+ "field": "content",
+ "filter_duplicate_text": True
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/807c0c9763f8c1114b3c8278c2a0cb56.asciidoc b/docs/examples/807c0c9763f8c1114b3c8278c2a0cb56.asciidoc
new file mode 100644
index 000000000..35c8b31ad
--- /dev/null
+++ b/docs/examples/807c0c9763f8c1114b3c8278c2a0cb56.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/intervals-query.asciidoc:28
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "intervals": {
+ "my_text": {
+ "all_of": {
+ "ordered": True,
+ "intervals": [
+ {
+ "match": {
+ "query": "my favorite food",
+ "max_gaps": 0,
+ "ordered": True
+ }
+ },
+ {
+ "any_of": {
+ "intervals": [
+ {
+ "match": {
+ "query": "hot water"
+ }
+ },
+ {
+ "match": {
+ "query": "cold porridge"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/808f4db1e2361be77dd6816c1f818139.asciidoc b/docs/examples/808f4db1e2361be77dd6816c1f818139.asciidoc
new file mode 100644
index 000000000..da86a9850
--- /dev/null
+++ b/docs/examples/808f4db1e2361be77dd6816c1f818139.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/shard-stores.asciidoc:13
+
+[source, python]
+----
+resp = client.indices.shard_stores(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/80dbaf28d1976dc00de3fe2018067e81.asciidoc b/docs/examples/80dbaf28d1976dc00de3fe2018067e81.asciidoc
new file mode 100644
index 000000000..6b030c126
--- /dev/null
+++ b/docs/examples/80dbaf28d1976dc00de3fe2018067e81.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-management/migrate-index-allocation-filters.asciidoc:132
+
+[source, python]
+----
+resp = client.indices.delete_template(
+ name=".cloud-hot-warm-allocation-0",
+)
+print(resp)
+----
diff --git a/docs/examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc b/docs/examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc
new file mode 100644
index 000000000..2f39bae89
--- /dev/null
+++ b/docs/examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/bulk-update-api-keys.asciidoc:176
+
+[source, python]
+----
+resp = client.security.bulk_update_api_keys(
+ body={
+ "ids": [
+ "VuaCfGcBCdbkQm-e5aOx",
+ "H3_AhoIBA9hmeQJdg7ij"
+ ],
+ "role_descriptors": {
+ "role-a": {
+ "indices": [
+ {
+ "names": [
+ "*"
+ ],
+ "privileges": [
+ "write"
+ ]
+ }
+ ]
+ }
+ },
+ "metadata": {
+ "environment": {
+ "level": 2,
+ "trusted": True,
+ "tags": [
+ "production"
+ ]
+ }
+ },
+ "expiration": "30d"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/80edd2124a822d9f9bf22ecc49d2c2e9.asciidoc b/docs/examples/80edd2124a822d9f9bf22ecc49d2c2e9.asciidoc
new file mode 100644
index 000000000..b9d0a1b4f
--- /dev/null
+++ b/docs/examples/80edd2124a822d9f9bf22ecc49d2c2e9.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// synonyms/apis/get-synonym-rule.asciidoc:67
+
+[source, python]
+----
+resp = client.synonyms.get_synonym_rule(
+ set_id="my-synonyms-set",
+ rule_id="test-1",
+)
+print(resp)
+----
diff --git a/docs/examples/812a3d7ab461d74efd9136aaf4bcf11c.asciidoc b/docs/examples/812a3d7ab461d74efd9136aaf4bcf11c.asciidoc
new file mode 100644
index 000000000..a1e43997a
--- /dev/null
+++ b/docs/examples/812a3d7ab461d74efd9136aaf4bcf11c.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/range-field-note.asciidoc:49
+
+[source, python]
+----
+resp = client.search(
+ index="range_index",
+ size="0",
+ aggs={
+ "range_histo": {
+ "histogram": {
+ "field": "expected_attendees",
+ "interval": 5
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/812deb6b7668c7444f3b99d843d2adc1.asciidoc b/docs/examples/812deb6b7668c7444f3b99d843d2adc1.asciidoc
new file mode 100644
index 000000000..89b9da814
--- /dev/null
+++ b/docs/examples/812deb6b7668c7444f3b99d843d2adc1.asciidoc
@@ -0,0 +1,54 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/shape-query.asciidoc:132
+
+[source, python]
+----
+resp = client.indices.create(
+ index="shapes",
+ mappings={
+ "properties": {
+ "geometry": {
+ "type": "shape"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="shapes",
+ id="footprint",
+ document={
+ "geometry": {
+ "type": "envelope",
+ "coordinates": [
+ [
+ 1355,
+ 5355
+ ],
+ [
+ 1400,
+ 5200
+ ]
+ ]
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="example",
+ query={
+ "shape": {
+ "geometry": {
+ "indexed_shape": {
+ "index": "shapes",
+ "id": "footprint",
+ "path": "geometry"
+ }
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/8141b60ad245ece2ff5e8d0817400ee5.asciidoc b/docs/examples/8141b60ad245ece2ff5e8d0817400ee5.asciidoc
new file mode 100644
index 000000000..1184d3f7f
--- /dev/null
+++ b/docs/examples/8141b60ad245ece2ff5e8d0817400ee5.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql-search-api.asciidoc:631
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n sequence by process.pid\n [ file where file.name == \"cmd.exe\" and process.pid != 2013 ]\n [ process where stringContains(process.executable, \"regsvr32\") ]\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/8141cdaddbe7d794f09f9ee84e46194c.asciidoc b/docs/examples/8141cdaddbe7d794f09f9ee84e46194c.asciidoc
new file mode 100644
index 000000000..3a3c00fb9
--- /dev/null
+++ b/docs/examples/8141cdaddbe7d794f09f9ee84e46194c.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/count.asciidoc:67
+
+[source, python]
+----
+resp = client.cat.count(
+ index="my-index-000001",
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/81612c2537386e031b7eb604f6756a71.asciidoc b/docs/examples/81612c2537386e031b7eb604f6756a71.asciidoc
new file mode 100644
index 000000000..3f3cf6154
--- /dev/null
+++ b/docs/examples/81612c2537386e031b7eb604f6756a71.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/clone-index.asciidoc:117
+
+[source, python]
+----
+resp = client.indices.clone(
+ index="my_source_index",
+ target="my_target_index",
+ settings={
+ "index.number_of_shards": 5
+ },
+ aliases={
+ "my_search_indices": {}
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8194f1fae6aa72ab91ea559daad932d4.asciidoc b/docs/examples/8194f1fae6aa72ab91ea559daad932d4.asciidoc
new file mode 100644
index 000000000..32f7d69e4
--- /dev/null
+++ b/docs/examples/8194f1fae6aa72ab91ea559daad932d4.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-shard-routing.asciidoc:169
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ max_concurrent_shard_requests="3",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/819e00cc6547d925d80090b94e0650d7.asciidoc b/docs/examples/819e00cc6547d925d80090b94e0650d7.asciidoc
new file mode 100644
index 000000000..5fefd2c08
--- /dev/null
+++ b/docs/examples/819e00cc6547d925d80090b94e0650d7.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-across-clusters.asciidoc:243
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001,cluster_one:my-index-000001,cluster_two:my-index-000001",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ source=[
+ "user.id",
+ "message",
+ "http.response.status_code"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/81c7a392efd505b686eed978fb7d9d17.asciidoc b/docs/examples/81c7a392efd505b686eed978fb7d9d17.asciidoc
new file mode 100644
index 000000000..1ad1f6029
--- /dev/null
+++ b/docs/examples/81c7a392efd505b686eed978fb7d9d17.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:636
+
+[source, python]
+----
+resp = client.indices.create(
+ index="english_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "english_stop": {
+ "type": "stop",
+ "stopwords": "_english_"
+ },
+ "english_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "example"
+ ]
+ },
+ "english_stemmer": {
+ "type": "stemmer",
+ "language": "english"
+ },
+ "english_possessive_stemmer": {
+ "type": "stemmer",
+ "language": "possessive_english"
+ }
+ },
+ "analyzer": {
+ "rebuilt_english": {
+ "tokenizer": "standard",
+ "filter": [
+ "english_possessive_stemmer",
+ "lowercase",
+ "english_stop",
+ "english_keywords",
+ "english_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/81ee2ad368208c4c78098292547b0577.asciidoc b/docs/examples/81ee2ad368208c4c78098292547b0577.asciidoc
new file mode 100644
index 000000000..ad9db4341
--- /dev/null
+++ b/docs/examples/81ee2ad368208c4c78098292547b0577.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/mapping-roles.asciidoc:180
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="admin_user",
+ roles=[
+ "monitoring"
+ ],
+ rules={
+ "field": {
+ "dn": "cn=Admin,ou=example,o=com"
+ }
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/81ef5774355180fc44d2a52b5182d24a.asciidoc b/docs/examples/81ef5774355180fc44d2a52b5182d24a.asciidoc
new file mode 100644
index 000000000..c88be8e5a
--- /dev/null
+++ b/docs/examples/81ef5774355180fc44d2a52b5182d24a.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/string-stats-aggregation.asciidoc:24
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ size="0",
+ aggs={
+ "message_stats": {
+ "string_stats": {
+ "field": "message.keyword"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/81f1b1e1d5c81683b6bf471c469e6046.asciidoc b/docs/examples/81f1b1e1d5c81683b6bf471c469e6046.asciidoc
new file mode 100644
index 000000000..e1e9fb10c
--- /dev/null
+++ b/docs/examples/81f1b1e1d5c81683b6bf471c469e6046.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/filter-search-results.asciidoc:81
+
+[source, python]
+----
+resp = client.search(
+ index="shirts",
+ query={
+ "bool": {
+ "filter": [
+ {
+ "term": {
+ "color": "red"
+ }
+ },
+ {
+ "term": {
+ "brand": "gucci"
+ }
+ }
+ ]
+ }
+ },
+ aggs={
+ "models": {
+ "terms": {
+ "field": "model"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8206a7cc615ad93fec322513b8fdd4fd.asciidoc b/docs/examples/8206a7cc615ad93fec322513b8fdd4fd.asciidoc
new file mode 100644
index 000000000..03f0155f1
--- /dev/null
+++ b/docs/examples/8206a7cc615ad93fec322513b8fdd4fd.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/terms-set-query.asciidoc:107
+
+[source, python]
+----
+resp = client.index(
+ index="job-candidates",
+ id="2",
+ refresh=True,
+ document={
+ "name": "Jason Response",
+ "programming_languages": [
+ "java",
+ "php"
+ ],
+ "required_matches": 2
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/820f689eaaef15fc07abd1073fa880f8.asciidoc b/docs/examples/820f689eaaef15fc07abd1073fa880f8.asciidoc
new file mode 100644
index 000000000..212392e24
--- /dev/null
+++ b/docs/examples/820f689eaaef15fc07abd1073fa880f8.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:11
+
+[source, python]
+----
+resp = client.search(
+ from_=5,
+ size=20,
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/821422f8a03dc98d024a15fc737fe9eb.asciidoc b/docs/examples/821422f8a03dc98d024a15fc737fe9eb.asciidoc
index 7ebb1d83a..c6a34d582 100644
--- a/docs/examples/821422f8a03dc98d024a15fc737fe9eb.asciidoc
+++ b/docs/examples/821422f8a03dc98d024a15fc737fe9eb.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/delete-trained-models-aliases.asciidoc:51
[source, python]
@@ -7,4 +8,4 @@ resp = client.ml.delete_trained_model_alias(
model_alias="flight_delay_model",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/821ac598f5f4a795a13f8dd0c0c4d8d6.asciidoc b/docs/examples/821ac598f5f4a795a13f8dd0c0c4d8d6.asciidoc
new file mode 100644
index 000000000..7c3502b95
--- /dev/null
+++ b/docs/examples/821ac598f5f4a795a13f8dd0c0c4d8d6.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-tsds.asciidoc:243
+
+[source, python]
+----
+resp = client.indices.create_data_stream(
+ name="metrics-weather_sensors-dev",
+)
+print(resp)
+----
diff --git a/docs/examples/824fded1f9db28906ae7e85ae8de9bd0.asciidoc b/docs/examples/824fded1f9db28906ae7e85ae8de9bd0.asciidoc
new file mode 100644
index 000000000..8492ee835
--- /dev/null
+++ b/docs/examples/824fded1f9db28906ae7e85ae8de9bd0.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/post-resume-follow.asciidoc:84
+
+[source, python]
+----
+resp = client.ccr.resume_follow(
+ index="follower_index",
+ max_read_request_operation_count=1024,
+ max_outstanding_read_requests=16,
+ max_read_request_size="1024k",
+ max_write_request_operation_count=32768,
+ max_write_request_size="16k",
+ max_outstanding_write_requests=8,
+ max_write_buffer_count=512,
+ max_write_buffer_size="512k",
+ max_retry_delay="10s",
+ read_poll_timeout="30s",
+)
+print(resp)
+----
diff --git a/docs/examples/827b7e9308ea288f18aea00a5accc38e.asciidoc b/docs/examples/827b7e9308ea288f18aea00a5accc38e.asciidoc
new file mode 100644
index 000000000..cc91ffc4d
--- /dev/null
+++ b/docs/examples/827b7e9308ea288f18aea00a5accc38e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-component-template.asciidoc:40
+
+[source, python]
+----
+resp = client.cluster.get_component_template(
+ name="template_1",
+)
+print(resp)
+----
diff --git a/docs/examples/82844ef45e11c0eece100d3109db3182.asciidoc b/docs/examples/82844ef45e11c0eece100d3109db3182.asciidoc
new file mode 100644
index 000000000..9c30a4e8e
--- /dev/null
+++ b/docs/examples/82844ef45e11c0eece100d3109db3182.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-amazon-bedrock.asciidoc:162
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="completion",
+ inference_id="amazon_bedrock_completion",
+ inference_config={
+ "service": "amazonbedrock",
+ "service_settings": {
+ "access_key": "",
+ "secret_key": "",
+ "region": "us-east-1",
+ "provider": "amazontitan",
+ "model": "amazon.titan-text-premier-v1:0"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/829a40d484c778a8c58340c7bf09e1d8.asciidoc b/docs/examples/829a40d484c778a8c58340c7bf09e1d8.asciidoc
new file mode 100644
index 000000000..8b580ce8a
--- /dev/null
+++ b/docs/examples/829a40d484c778a8c58340c7bf09e1d8.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/filter-search-results.asciidoc:195
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "message": {
+ "operator": "or",
+ "query": "the quick brown"
+ }
+ }
+ },
+ rescore={
+ "window_size": 50,
+ "query": {
+ "rescore_query": {
+ "match_phrase": {
+ "message": {
+ "query": "the quick brown",
+ "slop": 2
+ }
+ }
+ },
+ "query_weight": 0.7,
+ "rescore_query_weight": 1.2
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/82d6de3081de7b0664f44adf2942675a.asciidoc b/docs/examples/82d6de3081de7b0664f44adf2942675a.asciidoc
new file mode 100644
index 000000000..74c43c0f7
--- /dev/null
+++ b/docs/examples/82d6de3081de7b0664f44adf2942675a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// behavioral-analytics/apis/list-analytics-collection.asciidoc:85
+
+[source, python]
+----
+resp = client.search_application.get_behavioral_analytics(
+ name="my_analytics_collection",
+)
+print(resp)
+----
diff --git a/docs/examples/82e94b6cdf65e324575f916b3776b779.asciidoc b/docs/examples/82e94b6cdf65e324575f916b3776b779.asciidoc
index 47f9753d8..c1722b568 100644
--- a/docs/examples/82e94b6cdf65e324575f916b3776b779.asciidoc
+++ b/docs/examples/82e94b6cdf65e324575f916b3776b779.asciidoc
@@ -1,21 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:538
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "strings_as_keywords": {
- "match_mapping_type": "string",
- "runtime": {},
- }
+ mappings={
+ "dynamic_templates": [
+ {
+ "strings_as_keywords": {
+ "match_mapping_type": "string",
+ "runtime": {}
}
- ]
- }
+ }
+ ]
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/83062a543163370328cf2e21a68c1bd3.asciidoc b/docs/examples/83062a543163370328cf2e21a68c1bd3.asciidoc
new file mode 100644
index 000000000..686abae36
--- /dev/null
+++ b/docs/examples/83062a543163370328cf2e21a68c1bd3.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-wait-for-snapshot.asciidoc:40
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "delete": {
+ "actions": {
+ "wait_for_snapshot": {
+ "policy": "slm-policy-name"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/831f65d700577e11112c711236110f61.asciidoc b/docs/examples/831f65d700577e11112c711236110f61.asciidoc
new file mode 100644
index 000000000..21f9c308b
--- /dev/null
+++ b/docs/examples/831f65d700577e11112c711236110f61.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/pattern-analyzer.asciidoc:180
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_email_analyzer": {
+ "type": "pattern",
+ "pattern": "\\W|_",
+ "lowercase": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_email_analyzer",
+ text="John_Smith@foo-bar.com",
+)
+print(resp1)
+----
diff --git a/docs/examples/8330b2ea6317769e52d0647ba434b354.asciidoc b/docs/examples/8330b2ea6317769e52d0647ba434b354.asciidoc
new file mode 100644
index 000000000..6ee95743d
--- /dev/null
+++ b/docs/examples/8330b2ea6317769e52d0647ba434b354.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/multi-get.asciidoc:262
+
+[source, python]
+----
+resp = client.mget(
+ routing="key1",
+ docs=[
+ {
+ "_index": "test",
+ "_id": "1",
+ "routing": "key2"
+ },
+ {
+ "_index": "test",
+ "_id": "2"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/8345d2615f43a934fe1871a5120eca1d.asciidoc b/docs/examples/8345d2615f43a934fe1871a5120eca1d.asciidoc
new file mode 100644
index 000000000..935f0daee
--- /dev/null
+++ b/docs/examples/8345d2615f43a934fe1871a5120eca1d.asciidoc
@@ -0,0 +1,52 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/ecommerce-tutorial.asciidoc:77
+
+[source, python]
+----
+resp = client.transform.preview_transform(
+ source={
+ "index": "kibana_sample_data_ecommerce",
+ "query": {
+ "bool": {
+ "filter": {
+ "term": {
+ "currency": "EUR"
+ }
+ }
+ }
+ }
+ },
+ pivot={
+ "group_by": {
+ "customer_id": {
+ "terms": {
+ "field": "customer_id"
+ }
+ }
+ },
+ "aggregations": {
+ "total_quantity.sum": {
+ "sum": {
+ "field": "total_quantity"
+ }
+ },
+ "taxless_total_price.sum": {
+ "sum": {
+ "field": "taxless_total_price"
+ }
+ },
+ "total_quantity.max": {
+ "max": {
+ "field": "total_quantity"
+ }
+ },
+ "order_id.cardinality": {
+ "cardinality": {
+ "field": "order_id"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/834764b2fba6cbb41eaabd740be75656.asciidoc b/docs/examples/834764b2fba6cbb41eaabd740be75656.asciidoc
new file mode 100644
index 000000000..24bcdcef2
--- /dev/null
+++ b/docs/examples/834764b2fba6cbb41eaabd740be75656.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keyword-repeat-tokenfilter.asciidoc:384
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_custom_analyzer": {
+ "tokenizer": "standard",
+ "filter": [
+ "keyword_repeat",
+ "porter_stem",
+ "remove_duplicates"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8357aa6099089940589ae3e97e7bcffa.asciidoc b/docs/examples/8357aa6099089940589ae3e97e7bcffa.asciidoc
new file mode 100644
index 000000000..0ae02fd4c
--- /dev/null
+++ b/docs/examples/8357aa6099089940589ae3e97e7bcffa.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-ilm.asciidoc:381
+
+[source, python]
+----
+resp = client.indices.get_data_stream()
+print(resp)
+----
diff --git a/docs/examples/83780c8f5f17eb21064c1ba6e0a7aa10.asciidoc b/docs/examples/83780c8f5f17eb21064c1ba6e0a7aa10.asciidoc
new file mode 100644
index 000000000..4faddeb83
--- /dev/null
+++ b/docs/examples/83780c8f5f17eb21064c1ba6e0a7aa10.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/wrapper-query.asciidoc:10
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "wrapper": {
+ "query": "eyJ0ZXJtIiA6IHsgInVzZXIuaWQiIDogImtpbWNoeSIgfX0="
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/838a4eabebba4c06100fb37dc30c7722.asciidoc b/docs/examples/838a4eabebba4c06100fb37dc30c7722.asciidoc
new file mode 100644
index 000000000..07d36ca6b
--- /dev/null
+++ b/docs/examples/838a4eabebba4c06100fb37dc30c7722.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/rollup-search.asciidoc:78
+
+[source, python]
+----
+resp = client.rollup.put_job(
+ id="sensor",
+ index_pattern="sensor-*",
+ rollup_index="sensor_rollup",
+ cron="*/30 * * * * ?",
+ page_size=1000,
+ groups={
+ "date_histogram": {
+ "field": "timestamp",
+ "fixed_interval": "1h",
+ "delay": "7d"
+ },
+ "terms": {
+ "fields": [
+ "node"
+ ]
+ }
+ },
+ metrics=[
+ {
+ "field": "temperature",
+ "metrics": [
+ "min",
+ "max",
+ "sum"
+ ]
+ },
+ {
+ "field": "voltage",
+ "metrics": [
+ "avg"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/839710129a165cf93c6e329abedf9089.asciidoc b/docs/examples/839710129a165cf93c6e329abedf9089.asciidoc
new file mode 100644
index 000000000..393e65035
--- /dev/null
+++ b/docs/examples/839710129a165cf93c6e329abedf9089.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/update-cross-cluster-api-key.asciidoc:83
+
+[source, python]
+----
+resp = client.perform_request(
+ "POST",
+ "/_security/cross_cluster/api_key",
+ headers={"Content-Type": "application/json"},
+ body={
+ "name": "my-cross-cluster-api-key",
+ "access": {
+ "search": [
+ {
+ "names": [
+ "logs*"
+ ]
+ }
+ ]
+ },
+ "metadata": {
+ "application": "search"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/839a4b2930856790e34cc9dfeb983284.asciidoc b/docs/examples/839a4b2930856790e34cc9dfeb983284.asciidoc
new file mode 100644
index 000000000..bbb931afe
--- /dev/null
+++ b/docs/examples/839a4b2930856790e34cc9dfeb983284.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling.asciidoc:90
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "warm": {
+ "actions": {
+ "downsample": {
+ "fixed_interval": "1h"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/83b94f9e7b3a9abca8e165ea56927714.asciidoc b/docs/examples/83b94f9e7b3a9abca8e165ea56927714.asciidoc
new file mode 100644
index 000000000..30cf5041e
--- /dev/null
+++ b/docs/examples/83b94f9e7b3a9abca8e165ea56927714.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/rollover-index.asciidoc:380
+
+[source, python]
+----
+resp = client.indices.create(
+ index="",
+ aliases={
+ "my-write-alias": {}
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/83cd4eb89818b4c32f654d370eafa920.asciidoc b/docs/examples/83cd4eb89818b4c32f654d370eafa920.asciidoc
new file mode 100644
index 000000000..5945e88b9
--- /dev/null
+++ b/docs/examples/83cd4eb89818b4c32f654d370eafa920.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keep-types-tokenfilter.asciidoc:41
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ {
+ "type": "keep_types",
+ "types": [
+ ""
+ ]
+ }
+ ],
+ text="1 quick fox 2 lazy dogs",
+)
+print(resp)
+----
diff --git a/docs/examples/83d712b9ffb2e703212b762eba3c521a.asciidoc b/docs/examples/83d712b9ffb2e703212b762eba3c521a.asciidoc
new file mode 100644
index 000000000..cb6d92db9
--- /dev/null
+++ b/docs/examples/83d712b9ffb2e703212b762eba3c521a.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:46
+
+[source, python]
+----
+resp = client.search(
+ index="my-alias",
+ ignore_unavailable=True,
+)
+print(resp)
+----
diff --git a/docs/examples/83d8c920460a12f87b9d5bf65515c367.asciidoc b/docs/examples/83d8c920460a12f87b9d5bf65515c367.asciidoc
new file mode 100644
index 000000000..c1c82d954
--- /dev/null
+++ b/docs/examples/83d8c920460a12f87b9d5bf65515c367.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/movfn-aggregation.asciidoc:342
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "the_moving_sum": {
+ "moving_fn": {
+ "buckets_path": "the_sum",
+ "window": 10,
+ "script": "MovingFunctions.stdDev(values, MovingFunctions.unweightedAvg(values))"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/83dd715e45a5da097123c6d10f22f8f4.asciidoc b/docs/examples/83dd715e45a5da097123c6d10f22f8f4.asciidoc
new file mode 100644
index 000000000..1c69c1f8f
--- /dev/null
+++ b/docs/examples/83dd715e45a5da097123c6d10f22f8f4.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-containing-query.asciidoc:10
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_containing": {
+ "little": {
+ "span_term": {
+ "field1": "foo"
+ }
+ },
+ "big": {
+ "span_near": {
+ "clauses": [
+ {
+ "span_term": {
+ "field1": "bar"
+ }
+ },
+ {
+ "span_term": {
+ "field1": "baz"
+ }
+ }
+ ],
+ "slop": 5,
+ "in_order": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/83dfd0852101eca3ba8174c9c38b4e73.asciidoc b/docs/examples/83dfd0852101eca3ba8174c9c38b4e73.asciidoc
new file mode 100644
index 000000000..6246c4142
--- /dev/null
+++ b/docs/examples/83dfd0852101eca3ba8174c9c38b4e73.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// monitoring/indices.asciidoc:112
+
+[source, python]
+----
+resp = client.indices.get_template(
+ name=".monitoring-*",
+)
+print(resp)
+----
diff --git a/docs/examples/840b6c5c3d9c56aed854cfab8da04486.asciidoc b/docs/examples/840b6c5c3d9c56aed854cfab8da04486.asciidoc
new file mode 100644
index 000000000..854cc9372
--- /dev/null
+++ b/docs/examples/840b6c5c3d9c56aed854cfab8da04486.asciidoc
@@ -0,0 +1,95 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/pathhierarchy-tokenizer.asciidoc:195
+
+[source, python]
+----
+resp = client.indices.create(
+ index="file-path-test",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "custom_path_tree": {
+ "tokenizer": "custom_hierarchy"
+ },
+ "custom_path_tree_reversed": {
+ "tokenizer": "custom_hierarchy_reversed"
+ }
+ },
+ "tokenizer": {
+ "custom_hierarchy": {
+ "type": "path_hierarchy",
+ "delimiter": "/"
+ },
+ "custom_hierarchy_reversed": {
+ "type": "path_hierarchy",
+ "delimiter": "/",
+ "reverse": "true"
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "file_path": {
+ "type": "text",
+ "fields": {
+ "tree": {
+ "type": "text",
+ "analyzer": "custom_path_tree"
+ },
+ "tree_reversed": {
+ "type": "text",
+ "analyzer": "custom_path_tree_reversed"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="file-path-test",
+ id="1",
+ document={
+ "file_path": "/User/alice/photos/2017/05/16/my_photo1.jpg"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="file-path-test",
+ id="2",
+ document={
+ "file_path": "/User/alice/photos/2017/05/16/my_photo2.jpg"
+ },
+)
+print(resp2)
+
+resp3 = client.index(
+ index="file-path-test",
+ id="3",
+ document={
+ "file_path": "/User/alice/photos/2017/05/16/my_photo3.jpg"
+ },
+)
+print(resp3)
+
+resp4 = client.index(
+ index="file-path-test",
+ id="4",
+ document={
+ "file_path": "/User/alice/photos/2017/05/15/my_photo1.jpg"
+ },
+)
+print(resp4)
+
+resp5 = client.index(
+ index="file-path-test",
+ id="5",
+ document={
+ "file_path": "/User/bob/photos/2017/05/16/my_photo1.jpg"
+ },
+)
+print(resp5)
+----
diff --git a/docs/examples/84108653e9e03b4edacd878ec870df77.asciidoc b/docs/examples/84108653e9e03b4edacd878ec870df77.asciidoc
new file mode 100644
index 000000000..13d2765f9
--- /dev/null
+++ b/docs/examples/84108653e9e03b4edacd878ec870df77.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1043
+
+[source, python]
+----
+resp = client.indices.create(
+ index="hungarian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "hungarian_stop": {
+ "type": "stop",
+ "stopwords": "_hungarian_"
+ },
+ "hungarian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "példa"
+ ]
+ },
+ "hungarian_stemmer": {
+ "type": "stemmer",
+ "language": "hungarian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_hungarian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "hungarian_stop",
+ "hungarian_keywords",
+ "hungarian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/841ad0a70f4271f61f0bac0b467b59c5.asciidoc b/docs/examples/841ad0a70f4271f61f0bac0b467b59c5.asciidoc
new file mode 100644
index 000000000..349610e02
--- /dev/null
+++ b/docs/examples/841ad0a70f4271f61f0bac0b467b59c5.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/multi-termvectors.asciidoc:97
+
+[source, python]
+----
+resp = client.mtermvectors(
+ index="my-index-000001",
+ docs=[
+ {
+ "_id": "2",
+ "fields": [
+ "message"
+ ],
+ "term_statistics": True
+ },
+ {
+ "_id": "1"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/841d8b766902c8e3ae85c228a31383ac.asciidoc b/docs/examples/841d8b766902c8e3ae85c228a31383ac.asciidoc
new file mode 100644
index 000000000..17e5ecf63
--- /dev/null
+++ b/docs/examples/841d8b766902c8e3ae85c228a31383ac.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/apis/get-async-sql-search-status-api.asciidoc:12
+
+[source, python]
+----
+resp = client.sql.get_async_status(
+ id="FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=",
+ format="json",
+)
+print(resp)
+----
diff --git a/docs/examples/84243213614fe64930b1d430704afb29.asciidoc b/docs/examples/84243213614fe64930b1d430704afb29.asciidoc
index fe5017cf2..15574d907 100644
--- a/docs/examples/84243213614fe64930b1d430704afb29.asciidoc
+++ b/docs/examples/84243213614fe64930b1d430704afb29.asciidoc
@@ -1,20 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1016
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "runtime": {
- "voltage_corrected": {
- "type": "double",
- "script": {
- "source": "\n emit(doc['voltage'].value * params['multiplier'])\n ",
- "params": {"multiplier": 2},
- },
+ runtime={
+ "voltage_corrected": {
+ "type": "double",
+ "script": {
+ "source": "\n emit(doc['voltage'].value * params['multiplier'])\n ",
+ "params": {
+ "multiplier": 2
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/84465de841fe5c6099a0382f786f2cb8.asciidoc b/docs/examples/84465de841fe5c6099a0382f786f2cb8.asciidoc
new file mode 100644
index 000000000..e94fea979
--- /dev/null
+++ b/docs/examples/84465de841fe5c6099a0382f786f2cb8.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:74
+
+[source, python]
+----
+resp = client.indices.update_aliases(
+ actions=[
+ {
+ "remove": {
+ "index": "logs-nginx.access-prod",
+ "alias": "logs"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/84490ee2c6c07dbd2101ce2e3751e1aa.asciidoc b/docs/examples/84490ee2c6c07dbd2101ce2e3751e1aa.asciidoc
new file mode 100644
index 000000000..d25d4f72b
--- /dev/null
+++ b/docs/examples/84490ee2c6c07dbd2101ce2e3751e1aa.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-reindex.asciidoc:4
+
+[source, python]
+----
+resp = client.reindex(
+ wait_for_completion=False,
+ source={
+ "index": "test-data",
+ "size": 50
+ },
+ dest={
+ "index": "cohere-embeddings",
+ "pipeline": "cohere_embeddings"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/844928da2ff9a1394af5347a5e2e4f78.asciidoc b/docs/examples/844928da2ff9a1394af5347a5e2e4f78.asciidoc
index 8fca1dd38..9b5028b37 100644
--- a/docs/examples/844928da2ff9a1394af5347a5e2e4f78.asciidoc
+++ b/docs/examples/844928da2ff9a1394af5347a5e2e4f78.asciidoc
@@ -1,16 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/slowlog.asciidoc:133
[source, python]
----
resp = client.indices.put_settings(
index="my-index-000001",
- body={
+ settings={
"index.indexing.slowlog.threshold.index.warn": "10s",
"index.indexing.slowlog.threshold.index.info": "5s",
"index.indexing.slowlog.threshold.index.debug": "2s",
"index.indexing.slowlog.threshold.index.trace": "500ms",
- "index.indexing.slowlog.source": "1000",
+ "index.indexing.slowlog.source": "1000"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8478c39c71bbb559ef6ab919f918f22b.asciidoc b/docs/examples/8478c39c71bbb559ef6ab919f918f22b.asciidoc
new file mode 100644
index 000000000..f3968d442
--- /dev/null
+++ b/docs/examples/8478c39c71bbb559ef6ab919f918f22b.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1223
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ filter={
+ "range": {
+ "@timestamp": {
+ "gte": "now-1d/d",
+ "lt": "now/d"
+ }
+ }
+ },
+ query="\n file where (file.type == \"file\" and file.name == \"cmd.exe\")\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/8494d09c39e109a012094eb9d6ec52ac.asciidoc b/docs/examples/8494d09c39e109a012094eb9d6ec52ac.asciidoc
new file mode 100644
index 000000000..42f71157e
--- /dev/null
+++ b/docs/examples/8494d09c39e109a012094eb9d6ec52ac.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/pipeline.asciidoc:36
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="pipelineA",
+ description="inner pipeline",
+ processors=[
+ {
+ "set": {
+ "field": "inner_pipeline_set",
+ "value": "inner"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/84c61160ca815e29e9973ba1380219dd.asciidoc b/docs/examples/84c61160ca815e29e9973ba1380219dd.asciidoc
new file mode 100644
index 000000000..64f0af253
--- /dev/null
+++ b/docs/examples/84c61160ca815e29e9973ba1380219dd.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// searchable-snapshots/apis/shard-stats.asciidoc:73
+
+[source, python]
+----
+resp = client.searchable_snapshots.stats(
+ index="my-index",
+)
+print(resp)
+----
diff --git a/docs/examples/84c69fb07050f0e89720007a6507a221.asciidoc b/docs/examples/84c69fb07050f0e89720007a6507a221.asciidoc
new file mode 100644
index 000000000..c46ae806d
--- /dev/null
+++ b/docs/examples/84c69fb07050f0e89720007a6507a221.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/high-cpu-usage.asciidoc:95
+
+[source, python]
+----
+resp = client.tasks.cancel(
+ task_id="oTUltX4IQMOUUVeiohTt8A:464",
+)
+print(resp)
+----
diff --git a/docs/examples/84e2cf7417c9e0c9e6f3c23031001440.asciidoc b/docs/examples/84e2cf7417c9e0c9e6f3c23031001440.asciidoc
new file mode 100644
index 000000000..2c19092a2
--- /dev/null
+++ b/docs/examples/84e2cf7417c9e0c9e6f3c23031001440.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/enrich/enrich-stats.asciidoc:131
+
+[source, python]
+----
+resp = client.enrich.stats()
+print(resp)
+----
diff --git a/docs/examples/84edb44c5b74426f448b2baa101092d6.asciidoc b/docs/examples/84edb44c5b74426f448b2baa101092d6.asciidoc
index 70c294679..567b4ac54 100644
--- a/docs/examples/84edb44c5b74426f448b2baa101092d6.asciidoc
+++ b/docs/examples/84edb44c5b74426f448b2baa101092d6.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/range.asciidoc:75
[source, python]
----
resp = client.search(
index="range_index",
- body={"query": {"term": {"expected_attendees": {"value": 12}}}},
+ query={
+ "term": {
+ "expected_attendees": {
+ "value": 12
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/84f2f0cea90340bdd041421afdb58ec3.asciidoc b/docs/examples/84f2f0cea90340bdd041421afdb58ec3.asciidoc
new file mode 100644
index 000000000..87656a293
--- /dev/null
+++ b/docs/examples/84f2f0cea90340bdd041421afdb58ec3.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/highlighting-multi-fields.asciidoc:7
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index1",
+ mappings={
+ "properties": {
+ "comment": {
+ "type": "text",
+ "analyzer": "standard",
+ "fields": {
+ "english": {
+ "type": "text",
+ "analyzer": "english"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/84f3e8524f6ff80e870c03ab71551538.asciidoc b/docs/examples/84f3e8524f6ff80e870c03ab71551538.asciidoc
new file mode 100644
index 000000000..6a7530f12
--- /dev/null
+++ b/docs/examples/84f3e8524f6ff80e870c03ab71551538.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-shard-routing.asciidoc:79
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ preference="my-custom-shard-string",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/850bfd0a00d32475a54ac7f87fb4cc4d.asciidoc b/docs/examples/850bfd0a00d32475a54ac7f87fb4cc4d.asciidoc
index ff04f392e..f664fb22a 100644
--- a/docs/examples/850bfd0a00d32475a54ac7f87fb4cc4d.asciidoc
+++ b/docs/examples/850bfd0a00d32475a54ac7f87fb4cc4d.asciidoc
@@ -1,21 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:563
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "runtime_mappings": {
- "measures.voltage": {
- "type": "double",
- "script": {
- "source": "if (doc['model_number.keyword'].value.equals('HG537PU'))\n {emit(1.7 * params._source['measures']['voltage']);}\n else{emit(params._source['measures']['voltage']);}"
- },
+ runtime_mappings={
+ "measures.voltage": {
+ "type": "double",
+ "script": {
+ "source": "if (doc['model_number.keyword'].value.equals('HG537PU'))\n {emit(1.7 * params._source['measures']['voltage']);}\n else{emit(params._source['measures']['voltage']);}"
}
- },
- "query": {"match": {"model_number": "HG537PU"}},
- "fields": ["measures.voltage"],
+ }
},
+ query={
+ "match": {
+ "model_number": "HG537PU"
+ }
+ },
+ fields=[
+ "measures.voltage"
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/851f9754dbefc099c54c5423ca4565c0.asciidoc b/docs/examples/851f9754dbefc099c54c5423ca4565c0.asciidoc
new file mode 100644
index 000000000..87cd51675
--- /dev/null
+++ b/docs/examples/851f9754dbefc099c54c5423ca4565c0.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/ipprefix-aggregation.asciidoc:107
+
+[source, python]
+----
+resp = client.search(
+ index="network-traffic",
+ size=0,
+ aggs={
+ "ipv6-subnets": {
+ "ip_prefix": {
+ "field": "ipv6",
+ "prefix_length": 64,
+ "is_ipv6": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/852b394d78b8c79ee0055b5501981a4b.asciidoc b/docs/examples/852b394d78b8c79ee0055b5501981a4b.asciidoc
new file mode 100644
index 000000000..8d1506710
--- /dev/null
+++ b/docs/examples/852b394d78b8c79ee0055b5501981a4b.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:607
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "product_name": {
+ "terms": {
+ "field": "product",
+ "missing_bucket": True,
+ "missing_order": "last"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/85479e02af00681210e17e3d0ff51e21.asciidoc b/docs/examples/85479e02af00681210e17e3d0ff51e21.asciidoc
index 8e499f052..6b13cce81 100644
--- a/docs/examples/85479e02af00681210e17e3d0ff51e21.asciidoc
+++ b/docs/examples/85479e02af00681210e17e3d0ff51e21.asciidoc
@@ -1,19 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/date.asciidoc:93
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "date": {
- "type": "date",
- "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis",
- }
+ mappings={
+ "properties": {
+ "date": {
+ "type": "date",
+ "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/85519a614ae18c998986d46bbad82b76.asciidoc b/docs/examples/85519a614ae18c998986d46bbad82b76.asciidoc
new file mode 100644
index 000000000..7859c4667
--- /dev/null
+++ b/docs/examples/85519a614ae18c998986d46bbad82b76.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/set-up-lifecycle-policy.asciidoc:100
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my_template",
+ index_patterns=[
+ "test-*"
+ ],
+ template={
+ "settings": {
+ "number_of_shards": 1,
+ "number_of_replicas": 1,
+ "index.lifecycle.name": "my_policy",
+ "index.lifecycle.rollover_alias": "test-alias"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8566f5ecf4ae14802ba63c8cc7c629f8.asciidoc b/docs/examples/8566f5ecf4ae14802ba63c8cc7c629f8.asciidoc
new file mode 100644
index 000000000..eb4f786fd
--- /dev/null
+++ b/docs/examples/8566f5ecf4ae14802ba63c8cc7c629f8.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-task.asciidoc:184
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="mistral_embeddings",
+ inference_config={
+ "service": "mistral",
+ "service_settings": {
+ "api_key": "",
+ "model": ""
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/856c10ad554c26b70f1121454caff40a.asciidoc b/docs/examples/856c10ad554c26b70f1121454caff40a.asciidoc
new file mode 100644
index 000000000..e6e5a700e
--- /dev/null
+++ b/docs/examples/856c10ad554c26b70f1121454caff40a.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:250
+
+[source, python]
+----
+resp = client.search(
+ index="byte-image-index",
+ knn={
+ "field": "byte-image-vector",
+ "query_vector": "fb09",
+ "k": 10,
+ "num_candidates": 100
+ },
+ fields=[
+ "title"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc b/docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc
new file mode 100644
index 000000000..3b64158d3
--- /dev/null
+++ b/docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// quickstart/getting-started.asciidoc:64
+
+[source, python]
+----
+resp = client.index(
+ index="books",
+ document={
+ "name": "Snow Crash",
+ "author": "Neal Stephenson",
+ "release_date": "1992-06-01",
+ "page_count": 470
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8582e918a6275472d2eba2e95f1dbe77.asciidoc b/docs/examples/8582e918a6275472d2eba2e95f1dbe77.asciidoc
new file mode 100644
index 000000000..41a809c4d
--- /dev/null
+++ b/docs/examples/8582e918a6275472d2eba2e95f1dbe77.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/disk-usage-exceeded.asciidoc:49
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.disk.watermark.low": "90%",
+ "cluster.routing.allocation.disk.watermark.low.max_headroom": "100GB",
+ "cluster.routing.allocation.disk.watermark.high": "95%",
+ "cluster.routing.allocation.disk.watermark.high.max_headroom": "20GB",
+ "cluster.routing.allocation.disk.watermark.flood_stage": "97%",
+ "cluster.routing.allocation.disk.watermark.flood_stage.max_headroom": "5GB",
+ "cluster.routing.allocation.disk.watermark.flood_stage.frozen": "97%",
+ "cluster.routing.allocation.disk.watermark.flood_stage.frozen.max_headroom": "5GB"
+ },
+)
+print(resp)
+
+resp1 = client.indices.put_settings(
+ index="*",
+ expand_wildcards="all",
+ settings={
+ "index.blocks.read_only_allow_delete": None
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/858fde15fb0a0340873b123043f8c3b4.asciidoc b/docs/examples/858fde15fb0a0340873b123043f8c3b4.asciidoc
index 54f69a2bb..7e0f1de21 100644
--- a/docs/examples/858fde15fb0a0340873b123043f8c3b4.asciidoc
+++ b/docs/examples/858fde15fb0a0340873b123043f8c3b4.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/histogram.asciidoc:118
[source, python]
@@ -5,26 +6,52 @@
resp = client.index(
index="my-index-000001",
id="1",
- body={
+ document={
"my_text": "histogram_1",
"my_histogram": {
- "values": [0.1, 0.2, 0.3, 0.4, 0.5],
- "counts": [3, 7, 23, 12, 6],
- },
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 3,
+ 7,
+ 23,
+ 12,
+ 6
+ ]
+ }
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="2",
- body={
+ document={
"my_text": "histogram_2",
"my_histogram": {
- "values": [0.1, 0.25, 0.35, 0.4, 0.45, 0.5],
- "counts": [8, 17, 8, 7, 6, 2],
- },
+ "values": [
+ 0.1,
+ 0.25,
+ 0.35,
+ 0.4,
+ 0.45,
+ 0.5
+ ],
+ "counts": [
+ 8,
+ 17,
+ 8,
+ 7,
+ 6,
+ 2
+ ]
+ }
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/8593715fcc70315a0816b435551258e0.asciidoc b/docs/examples/8593715fcc70315a0816b435551258e0.asciidoc
index a2be0fc4e..d3df5ebad 100644
--- a/docs/examples/8593715fcc70315a0816b435551258e0.asciidoc
+++ b/docs/examples/8593715fcc70315a0816b435551258e0.asciidoc
@@ -1,20 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/semantic-text.asciidoc:155
[source, python]
----
resp = client.indices.create(
index="test-index",
- body={
- "mappings": {
- "properties": {
- "infer_field": {
- "type": "semantic_text",
- "inference_id": "my-elser-endpoint",
- },
- "source_field": {"type": "text", "copy_to": "infer_field"},
+ mappings={
+ "properties": {
+ "infer_field": {
+ "type": "semantic_text",
+ "inference_id": "my-elser-endpoint"
+ },
+ "source_field": {
+ "type": "text",
+ "copy_to": "infer_field"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/85ae90b63ecba9d2bad16144b054c0a1.asciidoc b/docs/examples/85ae90b63ecba9d2bad16144b054c0a1.asciidoc
new file mode 100644
index 000000000..b9b431294
--- /dev/null
+++ b/docs/examples/85ae90b63ecba9d2bad16144b054c0a1.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:535
+
+[source, python]
+----
+resp = client.sql.query(
+ format="txt",
+ runtime_mappings={
+ "release_day_of_week": {
+ "type": "keyword",
+ "script": "\n emit(doc['release_date'].value.dayOfWeekEnum.toString())\n "
+ }
+ },
+ query="\n SELECT * FROM library WHERE page_count > 300 AND author = 'Frank Herbert'\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/85d2e33791f1a74a69dfb04a60e69306.asciidoc b/docs/examples/85d2e33791f1a74a69dfb04a60e69306.asciidoc
new file mode 100644
index 000000000..d73ed27e5
--- /dev/null
+++ b/docs/examples/85d2e33791f1a74a69dfb04a60e69306.asciidoc
@@ -0,0 +1,58 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/actions.asciidoc:57
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="error_logs_alert",
+ metadata={
+ "color": "red"
+ },
+ trigger={
+ "schedule": {
+ "interval": "5m"
+ }
+ },
+ input={
+ "search": {
+ "request": {
+ "indices": "log-events",
+ "body": {
+ "size": 0,
+ "query": {
+ "match": {
+ "status": "error"
+ }
+ }
+ }
+ }
+ }
+ },
+ condition={
+ "compare": {
+ "ctx.payload.hits.total": {
+ "gt": 5
+ }
+ }
+ },
+ actions={
+ "email_administrator": {
+ "throttle_period": "15m",
+ "email": {
+ "to": "sys.admino@host.domain",
+ "subject": "Encountered {{ctx.payload.hits.total}} errors",
+ "body": "Too many error in the system, see attached data",
+ "attachments": {
+ "attached_data": {
+ "data": {
+ "format": "json"
+ }
+ }
+ },
+ "priority": "high"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/85e2719d9fd6d2c2d47d28d39f2e3f7e.asciidoc b/docs/examples/85e2719d9fd6d2c2d47d28d39f2e3f7e.asciidoc
new file mode 100644
index 000000000..385a7529e
--- /dev/null
+++ b/docs/examples/85e2719d9fd6d2c2d47d28d39f2e3f7e.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// migration/apis/feature-migration.asciidoc:47
+
+[source, python]
+----
+resp = client.migration.get_feature_upgrade_status()
+print(resp)
+----
diff --git a/docs/examples/85f0e5e8ab91ceab63c21dbedd9f4037.asciidoc b/docs/examples/85f0e5e8ab91ceab63c21dbedd9f4037.asciidoc
new file mode 100644
index 000000000..4dfa8270a
--- /dev/null
+++ b/docs/examples/85f0e5e8ab91ceab63c21dbedd9f4037.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:737
+
+[source, python]
+----
+resp = client.indices.create(
+ index="finnish_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "finnish_stop": {
+ "type": "stop",
+ "stopwords": "_finnish_"
+ },
+ "finnish_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "esimerkki"
+ ]
+ },
+ "finnish_stemmer": {
+ "type": "stemmer",
+ "language": "finnish"
+ }
+ },
+ "analyzer": {
+ "rebuilt_finnish": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "finnish_stop",
+ "finnish_keywords",
+ "finnish_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/85f2839beeb71edb66988e5c82188be0.asciidoc b/docs/examples/85f2839beeb71edb66988e5c82188be0.asciidoc
new file mode 100644
index 000000000..09bc916c5
--- /dev/null
+++ b/docs/examples/85f2839beeb71edb66988e5c82188be0.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// licensing/update-license.asciidoc:63
+
+[source, python]
+----
+resp = client.license.post(
+ licenses=[
+ {
+ "uid": "893361dc-9749-4997-93cb-802e3d7fa4xx",
+ "type": "basic",
+ "issue_date_in_millis": 1411948800000,
+ "expiry_date_in_millis": 1914278399999,
+ "max_nodes": 1,
+ "issued_to": "issuedTo",
+ "issuer": "issuer",
+ "signature": "xx"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/85f6667f148d16d075493fddf07e2932.asciidoc b/docs/examples/85f6667f148d16d075493fddf07e2932.asciidoc
new file mode 100644
index 000000000..b17580c51
--- /dev/null
+++ b/docs/examples/85f6667f148d16d075493fddf07e2932.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:616
+
+[source, python]
+----
+resp = client.reindex(
+ source={
+ "index": ".ds-my-data-stream-2099.03.07-000001"
+ },
+ dest={
+ "index": "new-data-stream",
+ "op_type": "create"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc b/docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc
new file mode 100644
index 000000000..57c7e9c05
--- /dev/null
+++ b/docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-cohere.asciidoc:188
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="rerank",
+ inference_id="cohere-rerank",
+ inference_config={
+ "service": "cohere",
+ "service_settings": {
+ "api_key": "",
+ "model_id": "rerank-english-v3.0"
+ },
+ "task_settings": {
+ "top_n": 10,
+ "return_documents": True
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/861f5f61409dc87f3671293b87839ff7.asciidoc b/docs/examples/861f5f61409dc87f3671293b87839ff7.asciidoc
new file mode 100644
index 000000000..b111b600b
--- /dev/null
+++ b/docs/examples/861f5f61409dc87f3671293b87839ff7.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/stats.asciidoc:1289
+
+[source, python]
+----
+resp = client.cluster.stats(
+ human=True,
+ pretty=True,
+)
+print(resp)
+----
diff --git a/docs/examples/86280dcb49aa89083be4b2644daf1b7c.asciidoc b/docs/examples/86280dcb49aa89083be4b2644daf1b7c.asciidoc
new file mode 100644
index 000000000..17ed48338
--- /dev/null
+++ b/docs/examples/86280dcb49aa89083be4b2644daf1b7c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-job.asciidoc:234
+
+[source, python]
+----
+resp = client.ml.get_jobs(
+ job_id="high_sum_total_sales",
+)
+print(resp)
+----
diff --git a/docs/examples/862907653d1c18d2e80eff7f421200e2.asciidoc b/docs/examples/862907653d1c18d2e80eff7f421200e2.asciidoc
new file mode 100644
index 000000000..726bac067
--- /dev/null
+++ b/docs/examples/862907653d1c18d2e80eff7f421200e2.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/saml-guide.asciidoc:677
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="saml-example",
+ roles=[
+ "example_role"
+ ],
+ enabled=True,
+ rules={
+ "field": {
+ "realm.name": "saml1"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/863253bf0ab7d227ff72a0a384f4de8c.asciidoc b/docs/examples/863253bf0ab7d227ff72a0a384f4de8c.asciidoc
new file mode 100644
index 000000000..685c48a97
--- /dev/null
+++ b/docs/examples/863253bf0ab7d227ff72a0a384f4de8c.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:673
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "indices.lifecycle.poll_interval": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8634c9993485d622fb12d24f4f242264.asciidoc b/docs/examples/8634c9993485d622fb12d24f4f242264.asciidoc
new file mode 100644
index 000000000..d5a35b8a4
--- /dev/null
+++ b/docs/examples/8634c9993485d622fb12d24f4f242264.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-manual.asciidoc:433
+
+[source, python]
+----
+resp = client.indices.modify_data_stream(
+ actions=[
+ {
+ "remove_backing_index": {
+ "data_stream": "my-data-stream",
+ "index": ".ds-my-data-stream-2023.07.26-000001"
+ }
+ },
+ {
+ "add_backing_index": {
+ "data_stream": "my-data-stream",
+ "index": ".ds-my-data-stream-2023.07.26-000001-downsample"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/867f7d43a78066731ead2e223960fc07.asciidoc b/docs/examples/867f7d43a78066731ead2e223960fc07.asciidoc
new file mode 100644
index 000000000..8b1ba30dd
--- /dev/null
+++ b/docs/examples/867f7d43a78066731ead2e223960fc07.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:408
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "action.destructive_requires_name": False
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8684589e31d96ab229e8c4feb4d704bb.asciidoc b/docs/examples/8684589e31d96ab229e8c4feb4d704bb.asciidoc
new file mode 100644
index 000000000..56b0b8967
--- /dev/null
+++ b/docs/examples/8684589e31d96ab229e8c4feb4d704bb.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/enrich/get-enrich-policy.asciidoc:124
+
+[source, python]
+----
+resp = client.enrich.get_policy(
+ name="my-policy,other-policy",
+)
+print(resp)
+----
diff --git a/docs/examples/86926bcebf213ac182d4373027554858.asciidoc b/docs/examples/86926bcebf213ac182d4373027554858.asciidoc
index dc01a99a5..e7938603a 100644
--- a/docs/examples/86926bcebf213ac182d4373027554858.asciidoc
+++ b/docs/examples/86926bcebf213ac182d4373027554858.asciidoc
@@ -1,14 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/unsigned_long.asciidoc:13
[source, python]
----
resp = client.indices.create(
index="my_index",
- body={
- "mappings": {
- "properties": {"my_counter": {"type": "unsigned_long"}}
+ mappings={
+ "properties": {
+ "my_counter": {
+ "type": "unsigned_long"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8696ba08ca6cc4992110c331732e5f47.asciidoc b/docs/examples/8696ba08ca6cc4992110c331732e5f47.asciidoc
new file mode 100644
index 000000000..c71398d8c
--- /dev/null
+++ b/docs/examples/8696ba08ca6cc4992110c331732e5f47.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/boxplot-aggregation.asciidoc:205
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "grade_boxplot": {
+ "boxplot": {
+ "field": "grade",
+ "missing": 10
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8699d35269a47ba867fa8cc766287413.asciidoc b/docs/examples/8699d35269a47ba867fa8cc766287413.asciidoc
new file mode 100644
index 000000000..6606c3b1f
--- /dev/null
+++ b/docs/examples/8699d35269a47ba867fa8cc766287413.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// licensing/start-basic.asciidoc:42
+
+[source, python]
+----
+resp = client.license.post_start_basic()
+print(resp)
+----
diff --git a/docs/examples/86c5594c4ec551391096c1abcd652b50.asciidoc b/docs/examples/86c5594c4ec551391096c1abcd652b50.asciidoc
index be45acd14..a56b80572 100644
--- a/docs/examples/86c5594c4ec551391096c1abcd652b50.asciidoc
+++ b/docs/examples/86c5594c4ec551391096c1abcd652b50.asciidoc
@@ -1,19 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/unsigned_long.asciidoc:125
[source, python]
----
resp = client.search(
index="my_index",
- body={
- "query": {"match_all": {}},
- "script_fields": {
- "count10": {
- "script": {
- "source": "Long.divideUnsigned(doc['my_counter'].value, 10)"
- }
+ query={
+ "match_all": {}
+ },
+ script_fields={
+ "count10": {
+ "script": {
+ "source": "Long.divideUnsigned(doc['my_counter'].value, 10)"
}
- },
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8703f3b1b3895543abc36e2a7a0013d3.asciidoc b/docs/examples/8703f3b1b3895543abc36e2a7a0013d3.asciidoc
index 2ba414b58..10a49f528 100644
--- a/docs/examples/8703f3b1b3895543abc36e2a7a0013d3.asciidoc
+++ b/docs/examples/8703f3b1b3895543abc36e2a7a0013d3.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/allocation/prioritization.asciidoc:17
[source, python]
@@ -7,20 +8,24 @@ resp = client.indices.create(
)
print(resp)
-resp = client.indices.create(
+resp1 = client.indices.create(
index="index_2",
)
-print(resp)
+print(resp1)
-resp = client.indices.create(
+resp2 = client.indices.create(
index="index_3",
- body={"settings": {"index.priority": 10}},
+ settings={
+ "index.priority": 10
+ },
)
-print(resp)
+print(resp2)
-resp = client.indices.create(
+resp3 = client.indices.create(
index="index_4",
- body={"settings": {"index.priority": 5}},
+ settings={
+ "index.priority": 5
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp3)
+----
diff --git a/docs/examples/871154d08efd7251cf3272e758f06acf.asciidoc b/docs/examples/871154d08efd7251cf3272e758f06acf.asciidoc
new file mode 100644
index 000000000..aebb08d9b
--- /dev/null
+++ b/docs/examples/871154d08efd7251cf3272e758f06acf.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/common-grams-tokenfilter.asciidoc:126
+
+[source, python]
+----
+resp = client.indices.create(
+ index="common_grams_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "index_grams": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "common_grams"
+ ]
+ }
+ },
+ "filter": {
+ "common_grams": {
+ "type": "common_grams",
+ "common_words": [
+ "a",
+ "is",
+ "the"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8731188553e14134b0a533010318f91a.asciidoc b/docs/examples/8731188553e14134b0a533010318f91a.asciidoc
new file mode 100644
index 000000000..b19da3417
--- /dev/null
+++ b/docs/examples/8731188553e14134b0a533010318f91a.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significantterms-aggregation.asciidoc:70
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "terms": {
+ "force": [
+ "British Transport Police"
+ ]
+ }
+ },
+ aggregations={
+ "significant_crime_types": {
+ "significant_terms": {
+ "field": "crime_type"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8739fad1fb2323950b673acf0c9f2ff5.asciidoc b/docs/examples/8739fad1fb2323950b673acf0c9f2ff5.asciidoc
new file mode 100644
index 000000000..2a0845659
--- /dev/null
+++ b/docs/examples/8739fad1fb2323950b673acf0c9f2ff5.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/open-close.asciidoc:120
+
+[source, python]
+----
+resp = client.indices.open(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/873e2333734b1cf5ed066596e5f74b0a.asciidoc b/docs/examples/873e2333734b1cf5ed066596e5f74b0a.asciidoc
new file mode 100644
index 000000000..89d19b08e
--- /dev/null
+++ b/docs/examples/873e2333734b1cf5ed066596e5f74b0a.asciidoc
@@ -0,0 +1,98 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/geocentroid-aggregation.asciidoc:13
+
+[source, python]
+----
+resp = client.indices.create(
+ index="museums",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="museums",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "location": "POINT (4.912350 52.374081)",
+ "city": "Amsterdam",
+ "name": "NEMO Science Museum"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "location": "POINT (4.901618 52.369219)",
+ "city": "Amsterdam",
+ "name": "Museum Het Rembrandthuis"
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "location": "POINT (4.914722 52.371667)",
+ "city": "Amsterdam",
+ "name": "Nederlands Scheepvaartmuseum"
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "location": "POINT (4.405200 51.222900)",
+ "city": "Antwerp",
+ "name": "Letterenhuis"
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "location": "POINT (2.336389 48.861111)",
+ "city": "Paris",
+ "name": "Musée du Louvre"
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "location": "POINT (2.327000 48.860000)",
+ "city": "Paris",
+ "name": "Musée d'Orsay"
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="museums",
+ size="0",
+ aggs={
+ "centroid": {
+ "geo_centroid": {
+ "field": "location"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/873fbbc6ab81409058591385fd602736.asciidoc b/docs/examples/873fbbc6ab81409058591385fd602736.asciidoc
index 564654719..8d80eb516 100644
--- a/docs/examples/873fbbc6ab81409058591385fd602736.asciidoc
+++ b/docs/examples/873fbbc6ab81409058591385fd602736.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/nested-query.asciidoc:171
[source, python]
@@ -5,31 +6,43 @@
resp = client.index(
index="drivers",
id="1",
- body={
+ document={
"driver": {
"last_name": "McQueen",
"vehicle": [
- {"make": "Powell Motors", "model": "Canyonero"},
- {"make": "Miller-Meteor", "model": "Ecto-1"},
- ],
+ {
+ "make": "Powell Motors",
+ "model": "Canyonero"
+ },
+ {
+ "make": "Miller-Meteor",
+ "model": "Ecto-1"
+ }
+ ]
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="drivers",
id="2",
- refresh="true",
- body={
+ refresh=True,
+ document={
"driver": {
"last_name": "Hudson",
"vehicle": [
- {"make": "Mifune", "model": "Mach Five"},
- {"make": "Miller-Meteor", "model": "Ecto-1"},
- ],
+ {
+ "make": "Mifune",
+ "model": "Mach Five"
+ },
+ {
+ "make": "Miller-Meteor",
+ "model": "Ecto-1"
+ }
+ ]
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/87416e6a1ca2da324dbed6deb05303eb.asciidoc b/docs/examples/87416e6a1ca2da324dbed6deb05303eb.asciidoc
index bd409dc1d..98b216fe6 100644
--- a/docs/examples/87416e6a1ca2da324dbed6deb05303eb.asciidoc
+++ b/docs/examples/87416e6a1ca2da324dbed6deb05303eb.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// search/count.asciidoc:105
[source, python]
@@ -5,20 +6,26 @@
resp = client.index(
index="my-index-000001",
id="1",
- refresh="true",
- body={"user.id": "kimchy"},
+ refresh=True,
+ document={
+ "user.id": "kimchy"
+ },
)
print(resp)
-resp = client.count(
+resp1 = client.count(
index="my-index-000001",
q="user:kimchy",
)
-print(resp)
+print(resp1)
-resp = client.count(
+resp2 = client.count(
index="my-index-000001",
- body={"query": {"term": {"user.id": "kimchy"}}},
+ query={
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/8743887d9b89ea1a2d5e780c349972cf.asciidoc b/docs/examples/8743887d9b89ea1a2d5e780c349972cf.asciidoc
new file mode 100644
index 000000000..6c0e09b6e
--- /dev/null
+++ b/docs/examples/8743887d9b89ea1a2d5e780c349972cf.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/collapse-search-results.asciidoc:263
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "message": "GET /search"
+ }
+ },
+ collapse={
+ "field": "geo.country_name",
+ "inner_hits": {
+ "name": "by_location",
+ "collapse": {
+ "field": "user.id"
+ },
+ "size": 3
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/87457bb3467484bec3e9df4e25942ba6.asciidoc b/docs/examples/87457bb3467484bec3e9df4e25942ba6.asciidoc
new file mode 100644
index 000000000..e2e6764d2
--- /dev/null
+++ b/docs/examples/87457bb3467484bec3e9df4e25942ba6.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/multivalued-fields.asciidoc:225
+
+[source, python]
+----
+resp = client.esql.query(
+ query="FROM mv | EVAL b=MV_MIN(b) | EVAL b + 2, a + b | LIMIT 4",
+)
+print(resp)
+----
diff --git a/docs/examples/87469f8b7e9b965408479d276c3ce8aa.asciidoc b/docs/examples/87469f8b7e9b965408479d276c3ce8aa.asciidoc
new file mode 100644
index 000000000..fcd5ca517
--- /dev/null
+++ b/docs/examples/87469f8b7e9b965408479d276c3ce8aa.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// behavioral-analytics/apis/list-analytics-collection.asciidoc:105
+
+[source, python]
+----
+resp = client.search_application.get_behavioral_analytics(
+ name="my*",
+)
+print(resp)
+----
diff --git a/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc b/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc
index e323188a2..1f2c7ceaa 100644
--- a/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc
+++ b/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc
@@ -1,4 +1,5 @@
-// health/health.asciidoc:474
+// This file is autogenerated, DO NOT EDIT
+// health/health.asciidoc:473
[source, python]
----
@@ -6,4 +7,4 @@ resp = client.health_report(
feature="shards_availability",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/877ea90c663b5df9efe95717646a666f.asciidoc b/docs/examples/877ea90c663b5df9efe95717646a666f.asciidoc
new file mode 100644
index 000000000..bb9d213a5
--- /dev/null
+++ b/docs/examples/877ea90c663b5df9efe95717646a666f.asciidoc
@@ -0,0 +1,57 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:159
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "group": {
+ "type": "keyword"
+ },
+ "user": {
+ "type": "nested",
+ "properties": {
+ "first": {
+ "type": "keyword"
+ },
+ "last": {
+ "type": "keyword"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "group": "fans",
+ "user": [
+ {
+ "first": "John",
+ "last": "Smith"
+ },
+ {
+ "first": "Alice",
+ "last": "White"
+ }
+ ]
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ fields=[
+ "*"
+ ],
+ source=False,
+)
+print(resp2)
+----
diff --git a/docs/examples/87846c3ddacab1da4af626ae8099e4be.asciidoc b/docs/examples/87846c3ddacab1da4af626ae8099e4be.asciidoc
new file mode 100644
index 000000000..5f8b44c00
--- /dev/null
+++ b/docs/examples/87846c3ddacab1da4af626ae8099e4be.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/mapping-roles.asciidoc:190
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="basic_user",
+ roles=[
+ "user"
+ ],
+ rules={
+ "field": {
+ "dn": "cn=John Doe,ou=example,o=com"
+ }
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/87b0b496747ad6c1e4ab4b462128fa1c.asciidoc b/docs/examples/87b0b496747ad6c1e4ab4b462128fa1c.asciidoc
new file mode 100644
index 000000000..15aa7398b
--- /dev/null
+++ b/docs/examples/87b0b496747ad6c1e4ab4b462128fa1c.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/nodeattrs.asciidoc:113
+
+[source, python]
+----
+resp = client.cat.nodeattrs(
+ v=True,
+ h="name,pid,attr,value",
+)
+print(resp)
+----
diff --git a/docs/examples/87c3e9963400a3e4b296ef8d1c86fae3.asciidoc b/docs/examples/87c3e9963400a3e4b296ef8d1c86fae3.asciidoc
new file mode 100644
index 000000000..326753968
--- /dev/null
+++ b/docs/examples/87c3e9963400a3e4b296ef8d1c86fae3.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-roles-cache.asciidoc:49
+
+[source, python]
+----
+resp = client.security.clear_cached_roles(
+ name="my_admin_role,my_test_role",
+)
+print(resp)
+----
diff --git a/docs/examples/87c42ef733a50954e4d757fc0a08decc.asciidoc b/docs/examples/87c42ef733a50954e4d757fc0a08decc.asciidoc
new file mode 100644
index 000000000..699f6f86e
--- /dev/null
+++ b/docs/examples/87c42ef733a50954e4d757fc0a08decc.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:255
+
+[source, python]
+----
+resp = client.security.create_api_key(
+ name="my-api-key-1",
+ metadata={
+ "application": "my-application"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/87d970b4944b6d742c484d7184996c8a.asciidoc b/docs/examples/87d970b4944b6d742c484d7184996c8a.asciidoc
new file mode 100644
index 000000000..c0b2139cd
--- /dev/null
+++ b/docs/examples/87d970b4944b6d742c484d7184996c8a.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:708
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my_search_application",
+ params={
+ "query_string": "Where is the best place for mountain climbing?"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/87f854393d715aabf4d45e90a8eb74ce.asciidoc b/docs/examples/87f854393d715aabf4d45e90a8eb74ce.asciidoc
new file mode 100644
index 000000000..34822c66b
--- /dev/null
+++ b/docs/examples/87f854393d715aabf4d45e90a8eb74ce.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/median-absolute-deviation-aggregation.asciidoc:173
+
+[source, python]
+----
+resp = client.search(
+ index="reviews",
+ size=0,
+ aggs={
+ "review_variability": {
+ "median_absolute_deviation": {
+ "field": "rating",
+ "missing": 5
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/88195d87a350e7fff200131f410c3e88.asciidoc b/docs/examples/88195d87a350e7fff200131f410c3e88.asciidoc
new file mode 100644
index 000000000..f3e930aac
--- /dev/null
+++ b/docs/examples/88195d87a350e7fff200131f410c3e88.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/range-aggregation.asciidoc:70
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ aggs={
+ "price_ranges": {
+ "range": {
+ "field": "price",
+ "keyed": True,
+ "ranges": [
+ {
+ "to": 100
+ },
+ {
+ "from": 100,
+ "to": 200
+ },
+ {
+ "from": 200
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/88341b4eba71ec722f3e38fa1696fe87.asciidoc b/docs/examples/88341b4eba71ec722f3e38fa1696fe87.asciidoc
new file mode 100644
index 000000000..718c6e541
--- /dev/null
+++ b/docs/examples/88341b4eba71ec722f3e38fa1696fe87.asciidoc
@@ -0,0 +1,56 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/examples.asciidoc:40
+
+[source, python]
+----
+resp = client.transform.preview_transform(
+ source={
+ "index": "kibana_sample_data_ecommerce"
+ },
+ dest={
+ "index": "sample_ecommerce_orders_by_customer"
+ },
+ pivot={
+ "group_by": {
+ "user": {
+ "terms": {
+ "field": "user"
+ }
+ },
+ "customer_id": {
+ "terms": {
+ "field": "customer_id"
+ }
+ }
+ },
+ "aggregations": {
+ "order_count": {
+ "value_count": {
+ "field": "order_id"
+ }
+ },
+ "total_order_amt": {
+ "sum": {
+ "field": "taxful_total_price"
+ }
+ },
+ "avg_amt_per_order": {
+ "avg": {
+ "field": "taxful_total_price"
+ }
+ },
+ "avg_unique_products_per_order": {
+ "avg": {
+ "field": "total_unique_products"
+ }
+ },
+ "total_unique_products": {
+ "cardinality": {
+ "field": "products.product_id"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/88554b79dba8fd79991855a692b69ff9.asciidoc b/docs/examples/88554b79dba8fd79991855a692b69ff9.asciidoc
new file mode 100644
index 000000000..c96cce159
--- /dev/null
+++ b/docs/examples/88554b79dba8fd79991855a692b69ff9.asciidoc
@@ -0,0 +1,55 @@
+// This file is autogenerated, DO NOT EDIT
+// graph/explore.asciidoc:309
+
+[source, python]
+----
+resp = client.graph.explore(
+ index="clicklogs",
+ query={
+ "match": {
+ "query.raw": "midi"
+ }
+ },
+ controls={
+ "use_significance": False,
+ "sample_size": 2000,
+ "timeout": 2000,
+ "sample_diversity": {
+ "field": "category.raw",
+ "max_docs_per_value": 500
+ }
+ },
+ vertices=[
+ {
+ "field": "product",
+ "size": 5,
+ "min_doc_count": 10,
+ "shard_min_doc_count": 3
+ }
+ ],
+ connections={
+ "query": {
+ "bool": {
+ "filter": [
+ {
+ "range": {
+ "query_time": {
+ "gte": "2015-10-01 00:00:00"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "vertices": [
+ {
+ "field": "query.raw",
+ "size": 5,
+ "min_doc_count": 10,
+ "shard_min_doc_count": 3
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/88a08d0b15ef41324f5c23db533d47d1.asciidoc b/docs/examples/88a08d0b15ef41324f5c23db533d47d1.asciidoc
new file mode 100644
index 000000000..5c54ad620
--- /dev/null
+++ b/docs/examples/88a08d0b15ef41324f5c23db533d47d1.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/standard-tokenizer.asciidoc:16
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/88a283dfccc481f1afba79d9b3c61f51.asciidoc b/docs/examples/88a283dfccc481f1afba79d9b3c61f51.asciidoc
new file mode 100644
index 000000000..1366a67b3
--- /dev/null
+++ b/docs/examples/88a283dfccc481f1afba79d9b3c61f51.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-user.asciidoc:117
+
+[source, python]
+----
+resp = client.perform_request(
+ "GET",
+ "/_security/_query/user",
+)
+print(resp)
+----
diff --git a/docs/examples/88b19973b970adf9b73fca82017d4951.asciidoc b/docs/examples/88b19973b970adf9b73fca82017d4951.asciidoc
new file mode 100644
index 000000000..bb844e3be
--- /dev/null
+++ b/docs/examples/88b19973b970adf9b73fca82017d4951.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-multiple-indices.asciidoc:30
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-*",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/88cecae3f0363fc186d955dd8616b5d4.asciidoc b/docs/examples/88cecae3f0363fc186d955dd8616b5d4.asciidoc
new file mode 100644
index 000000000..8910550de
--- /dev/null
+++ b/docs/examples/88cecae3f0363fc186d955dd8616b5d4.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/get-async-eql-status-api.asciidoc:83
+
+[source, python]
+----
+resp = client.eql.get_status(
+ id="FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
+ keep_alive="5d",
+)
+print(resp)
+----
diff --git a/docs/examples/88cf60d3310a56d8ae12704abc05b565.asciidoc b/docs/examples/88cf60d3310a56d8ae12704abc05b565.asciidoc
new file mode 100644
index 000000000..ce84bd692
--- /dev/null
+++ b/docs/examples/88cf60d3310a56d8ae12704abc05b565.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// licensing/get-trial-status.asciidoc:40
+
+[source, python]
+----
+resp = client.license.get_trial_status()
+print(resp)
+----
diff --git a/docs/examples/88ec7fa6768a7e13cd2158667a69e97f.asciidoc b/docs/examples/88ec7fa6768a7e13cd2158667a69e97f.asciidoc
new file mode 100644
index 000000000..ee6038143
--- /dev/null
+++ b/docs/examples/88ec7fa6768a7e13cd2158667a69e97f.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:151
+
+[source, python]
+----
+resp = client.search(
+ runtime_mappings={
+ "day_of_week": {
+ "type": "keyword",
+ "script": "\n emit(doc['timestamp'].value.dayOfWeekEnum\n .getDisplayName(TextStyle.FULL, Locale.ROOT))\n "
+ }
+ },
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "dow": {
+ "terms": {
+ "field": "day_of_week"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8963fb1e3d0900ba3b68be212e8972ee.asciidoc b/docs/examples/8963fb1e3d0900ba3b68be212e8972ee.asciidoc
new file mode 100644
index 000000000..367be5598
--- /dev/null
+++ b/docs/examples/8963fb1e3d0900ba3b68be212e8972ee.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/position-increment-gap.asciidoc:53
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "names": {
+ "type": "text",
+ "position_increment_gap": 0
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "names": [
+ "John Abraham",
+ "Lincoln Smith"
+ ]
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ query={
+ "match_phrase": {
+ "names": "Abraham Lincoln"
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/897668edcbb0785fa5229aeb2dfc963e.asciidoc b/docs/examples/897668edcbb0785fa5229aeb2dfc963e.asciidoc
new file mode 100644
index 000000000..78642ab06
--- /dev/null
+++ b/docs/examples/897668edcbb0785fa5229aeb2dfc963e.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:51
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "query": {
+ "match": {
+ "message": "bonsai tree"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/89a6b24618cafd60de1702a5b9f28a8d.asciidoc b/docs/examples/89a6b24618cafd60de1702a5b9f28a8d.asciidoc
new file mode 100644
index 000000000..2e8f13b6f
--- /dev/null
+++ b/docs/examples/89a6b24618cafd60de1702a5b9f28a8d.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/phrase-suggest.asciidoc:221
+
+[source, python]
+----
+resp = client.search(
+ index="test",
+ suggest={
+ "text": "noble prize",
+ "simple_phrase": {
+ "phrase": {
+ "field": "title.trigram",
+ "size": 1,
+ "direct_generator": [
+ {
+ "field": "title.trigram",
+ "suggest_mode": "always",
+ "min_word_length": 1
+ }
+ ],
+ "collate": {
+ "query": {
+ "source": {
+ "match": {
+ "{{field_name}}": "{{suggestion}}"
+ }
+ }
+ },
+ "params": {
+ "field_name": "title"
+ },
+ "prune": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/89aed93f641a5e243bdc3ee5cdc2acc6.asciidoc b/docs/examples/89aed93f641a5e243bdc3ee5cdc2acc6.asciidoc
new file mode 100644
index 000000000..48fd0a07b
--- /dev/null
+++ b/docs/examples/89aed93f641a5e243bdc3ee5cdc2acc6.asciidoc
@@ -0,0 +1,58 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:484
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my_search_application",
+ search_application={
+ "indices": [
+ "index1",
+ "index2"
+ ],
+ "template": {
+ "script": {
+ "lang": "mustache",
+ "source": "\n {\n \"query\": {\n \"bool\": {\n \"should\": [\n {{#text}}\n {\n \"multi_match\": {\n \"query\": \"{{query_string}}\",\n \"fields\": [{{#text_fields}}\"{{name}}^{{boost}}\",{{/text_fields}}],\n \"boost\": \"{{text_query_boost}}\"\n }\n },\n {{/text}}\n {{#elser}}\n {{#elser_fields}}\n {\n \"sparse_vector\": {\n \"field\": \"ml.inference.{{.}}_expanded.predicted_value\",\n \"inference_id\": \"\",\n \"query\": \"{{query_string}}\"\n }\n },\n {{/elser_fields}}\n { \"bool\": { \"must\": [] } },\n {{/elser}}\n {{^text}}\n {{^elser}}\n {\n \"query_string\": {\n \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\",\n \"default_operator\": \"{{default_operator}}\",\n \"boost\": \"{{text_query_boost}}\"\n }\n },\n {{/elser}}\n {{/text}}\n { \"bool\": { \"must\": [] } }\n ],\n \"minimum_should_match\": 1\n }\n },\n \"min_score\": \"{{min_score}}\",\n \"explain\": \"{{explain}}\",\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n ",
+ "params": {
+ "text": False,
+ "elser": False,
+ "elser_fields": [
+ {
+ "name": "title",
+ "boost": 1
+ },
+ {
+ "name": "description",
+ "boost": 1
+ }
+ ],
+ "text_fields": [
+ {
+ "name": "title",
+ "boost": 10
+ },
+ {
+ "name": "description",
+ "boost": 5
+ },
+ {
+ "name": "state",
+ "boost": 1
+ }
+ ],
+ "query_string": "*",
+ "text_query_boost": 4,
+ "default_field": "*",
+ "default_operator": "OR",
+ "explain": False,
+ "from": 0,
+ "size": 10,
+ "min_score": 0
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/89b72dd7f747f6297c2b089e8bc807be.asciidoc b/docs/examples/89b72dd7f747f6297c2b089e8bc807be.asciidoc
new file mode 100644
index 000000000..4b43638cc
--- /dev/null
+++ b/docs/examples/89b72dd7f747f6297c2b089e8bc807be.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/put-repo-api.asciidoc:10
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_repository",
+ repository={
+ "type": "fs",
+ "settings": {
+ "location": "my_backup_location"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/89c57917bc7bd2e6387b5eb54ece37b1.asciidoc b/docs/examples/89c57917bc7bd2e6387b5eb54ece37b1.asciidoc
new file mode 100644
index 000000000..8ff534a98
--- /dev/null
+++ b/docs/examples/89c57917bc7bd2e6387b5eb54ece37b1.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:174
+
+[source, python]
+----
+resp = client.count(
+ index="my-index-000001",
+ query={
+ "exists": {
+ "field": "my-field"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/89d2a3748dc14c6d5d4c6f94b9b03938.asciidoc b/docs/examples/89d2a3748dc14c6d5d4c6f94b9b03938.asciidoc
new file mode 100644
index 000000000..53f24fc7b
--- /dev/null
+++ b/docs/examples/89d2a3748dc14c6d5d4c6f94b9b03938.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/split-index.asciidoc:44
+
+[source, python]
+----
+resp = client.indices.add_block(
+ index="my_source_index",
+ block="write",
+)
+print(resp)
+----
diff --git a/docs/examples/89dee10a24ea2727af5b00039a4271bd.asciidoc b/docs/examples/89dee10a24ea2727af5b00039a4271bd.asciidoc
new file mode 100644
index 000000000..5b8ab73c9
--- /dev/null
+++ b/docs/examples/89dee10a24ea2727af5b00039a4271bd.asciidoc
@@ -0,0 +1,163 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/geoline-aggregation.asciidoc:159
+
+[source, python]
+----
+resp = client.indices.create(
+ index="tour",
+ mappings={
+ "properties": {
+ "city": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "category": {
+ "type": "keyword"
+ },
+ "route": {
+ "type": "long"
+ },
+ "name": {
+ "type": "keyword"
+ },
+ "location": {
+ "type": "geo_point"
+ },
+ "@timestamp": {
+ "type": "date"
+ }
+ }
+ },
+ settings={
+ "index": {
+ "mode": "time_series",
+ "routing_path": [
+ "city"
+ ],
+ "time_series": {
+ "start_time": "2023-01-01T00:00:00Z",
+ "end_time": "2024-01-01T00:00:00Z"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="tour",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-01-02T09:00:00Z",
+ "route": 0,
+ "location": "POINT(4.889187 52.373184)",
+ "city": "Amsterdam",
+ "category": "Attraction",
+ "name": "Royal Palace Amsterdam"
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-01-02T10:00:00Z",
+ "route": 1,
+ "location": "POINT(4.885057 52.370159)",
+ "city": "Amsterdam",
+ "category": "Attraction",
+ "name": "The Amsterdam Dungeon"
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-01-02T13:00:00Z",
+ "route": 2,
+ "location": "POINT(4.901618 52.369219)",
+ "city": "Amsterdam",
+ "category": "Museum",
+ "name": "Museum Het Rembrandthuis"
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-01-02T16:00:00Z",
+ "route": 3,
+ "location": "POINT(4.912350 52.374081)",
+ "city": "Amsterdam",
+ "category": "Museum",
+ "name": "NEMO Science Museum"
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-01-03T12:00:00Z",
+ "route": 4,
+ "location": "POINT(4.914722 52.371667)",
+ "city": "Amsterdam",
+ "category": "Museum",
+ "name": "Nederlands Scheepvaartmuseum"
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-01-04T09:00:00Z",
+ "route": 5,
+ "location": "POINT(4.401384 51.220292)",
+ "city": "Antwerp",
+ "category": "Attraction",
+ "name": "Cathedral of Our Lady"
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-01-04T12:00:00Z",
+ "route": 6,
+ "location": "POINT(4.405819 51.221758)",
+ "city": "Antwerp",
+ "category": "Museum",
+ "name": "Snijders&Rockoxhuis"
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-01-04T15:00:00Z",
+ "route": 7,
+ "location": "POINT(4.405200 51.222900)",
+ "city": "Antwerp",
+ "category": "Museum",
+ "name": "Letterenhuis"
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-01-05T10:00:00Z",
+ "route": 8,
+ "location": "POINT(2.336389 48.861111)",
+ "city": "Paris",
+ "category": "Museum",
+ "name": "Musée du Louvre"
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-01-05T14:00:00Z",
+ "route": 9,
+ "location": "POINT(2.327000 48.860000)",
+ "city": "Paris",
+ "category": "Museum",
+ "name": "Musée dOrsay"
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/89f8eac24f3ec6a7668d580aaf0eeefa.asciidoc b/docs/examples/89f8eac24f3ec6a7668d580aaf0eeefa.asciidoc
new file mode 100644
index 000000000..d608db517
--- /dev/null
+++ b/docs/examples/89f8eac24f3ec6a7668d580aaf0eeefa.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:286
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "snowball"
+ ],
+ text="detailed output",
+ explain=True,
+ attributes=[
+ "keyword"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/8a12cd824404d74f098d854716a26899.asciidoc b/docs/examples/8a12cd824404d74f098d854716a26899.asciidoc
new file mode 100644
index 000000000..b8edf1b62
--- /dev/null
+++ b/docs/examples/8a12cd824404d74f098d854716a26899.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/delete-datafeed.asciidoc:43
+
+[source, python]
+----
+resp = client.ml.delete_datafeed(
+ datafeed_id="datafeed-total-requests",
+)
+print(resp)
+----
diff --git a/docs/examples/8a1b6eae4893c5dd27b3d81fd8d70f5b.asciidoc b/docs/examples/8a1b6eae4893c5dd27b3d81fd8d70f5b.asciidoc
new file mode 100644
index 000000000..342efcdb8
--- /dev/null
+++ b/docs/examples/8a1b6eae4893c5dd27b3d81fd8d70f5b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-inference.asciidoc:84
+
+[source, python]
+----
+resp = client.tasks.get(
+ task_id="",
+)
+print(resp)
+----
diff --git a/docs/examples/8a1f6cffa653800282c0ae160ee375bc.asciidoc b/docs/examples/8a1f6cffa653800282c0ae160ee375bc.asciidoc
index a4406bdf8..e9aae2f90 100644
--- a/docs/examples/8a1f6cffa653800282c0ae160ee375bc.asciidoc
+++ b/docs/examples/8a1f6cffa653800282c0ae160ee375bc.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:155
[source, python]
@@ -5,13 +6,13 @@
resp = client.update(
index="test",
id="1",
- body={
- "script": {
- "source": "if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }",
- "lang": "painless",
- "params": {"tag": "blue"},
+ script={
+ "source": "if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }",
+ "lang": "painless",
+ "params": {
+ "tag": "blue"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8a4941cae0b32d68b22bec2d12c82860.asciidoc b/docs/examples/8a4941cae0b32d68b22bec2d12c82860.asciidoc
new file mode 100644
index 000000000..62ea35cfd
--- /dev/null
+++ b/docs/examples/8a4941cae0b32d68b22bec2d12c82860.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:356
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n sequence by process.pid with maxspan=1h\n [ process where process.name == \"regsvr32.exe\" ]\n [ file where stringContains(file.name, \"scrobj.dll\") ]\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/8a617dbfe5887f8ecc8815de132b6eb0.asciidoc b/docs/examples/8a617dbfe5887f8ecc8815de132b6eb0.asciidoc
new file mode 100644
index 000000000..0af3515ea
--- /dev/null
+++ b/docs/examples/8a617dbfe5887f8ecc8815de132b6eb0.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/remote-clusters-privileges-cert.asciidoc:268
+
+[source, python]
+----
+resp = client.security.put_user(
+ username="cross-cluster-kibana",
+ password="l0ng-r4nd0m-p@ssw0rd",
+ roles=[
+ "logstash-reader",
+ "kibana-access"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/8aa17bd25a3f2d634e5253b4b72fec4c.asciidoc b/docs/examples/8aa17bd25a3f2d634e5253b4b72fec4c.asciidoc
new file mode 100644
index 000000000..d6e4a61fb
--- /dev/null
+++ b/docs/examples/8aa17bd25a3f2d634e5253b4b72fec4c.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/explain-dfanalytics.asciidoc:120
+
+[source, python]
+----
+resp = client.ml.explain_data_frame_analytics(
+ source={
+ "index": "houses_sold_last_10_yrs"
+ },
+ analysis={
+ "regression": {
+ "dependent_variable": "price"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8aa74aee3dcf4b34028e4c5e1c1ed27b.asciidoc b/docs/examples/8aa74aee3dcf4b34028e4c5e1c1ed27b.asciidoc
index 0715de378..69c072f36 100644
--- a/docs/examples/8aa74aee3dcf4b34028e4c5e1c1ed27b.asciidoc
+++ b/docs/examples/8aa74aee3dcf4b34028e4c5e1c1ed27b.asciidoc
@@ -1,31 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/flattened.asciidoc:35
[source, python]
----
resp = client.indices.create(
index="bug_reports",
- body={
- "mappings": {
- "properties": {
- "title": {"type": "text"},
- "labels": {"type": "flattened"},
+ mappings={
+ "properties": {
+ "title": {
+ "type": "text"
+ },
+ "labels": {
+ "type": "flattened"
}
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="bug_reports",
id="1",
- body={
+ document={
"title": "Results are not sorted correctly.",
"labels": {
"priority": "urgent",
- "release": ["v1.2.5", "v1.3.0"],
- "timestamp": {"created": 1541458026, "closed": 1541457010},
- },
+ "release": [
+ "v1.2.5",
+ "v1.3.0"
+ ],
+ "timestamp": {
+ "created": 1541458026,
+ "closed": 1541457010
+ }
+ }
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/8ab11a25e017124a70484781ca11fb52.asciidoc b/docs/examples/8ab11a25e017124a70484781ca11fb52.asciidoc
new file mode 100644
index 000000000..9a40e5c63
--- /dev/null
+++ b/docs/examples/8ab11a25e017124a70484781ca11fb52.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/detect-threats-with-eql.asciidoc:94
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ filter_path="-hits.events",
+ query="\n any where process.name == \"regsvr32.exe\" \n ",
+ size=200,
+)
+print(resp)
+----
diff --git a/docs/examples/8b07372a21a10a16b52e70fc0c87ad4e.asciidoc b/docs/examples/8b07372a21a10a16b52e70fc0c87ad4e.asciidoc
index e2b27ba5d..2cde32cde 100644
--- a/docs/examples/8b07372a21a10a16b52e70fc0c87ad4e.asciidoc
+++ b/docs/examples/8b07372a21a10a16b52e70fc0c87ad4e.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/object.asciidoc:11
[source, python]
@@ -5,10 +6,16 @@
resp = client.index(
index="my-index-000001",
id="1",
- body={
+ document={
"region": "US",
- "manager": {"age": 30, "name": {"first": "John", "last": "Smith"}},
+ "manager": {
+ "age": 30,
+ "name": {
+ "first": "John",
+ "last": "Smith"
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8b144b3eb20872595fd7cbc6c245c7c8.asciidoc b/docs/examples/8b144b3eb20872595fd7cbc6c245c7c8.asciidoc
new file mode 100644
index 000000000..fcb54f662
--- /dev/null
+++ b/docs/examples/8b144b3eb20872595fd7cbc6c245c7c8.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-role.asciidoc:127
+
+[source, python]
+----
+resp = client.security.query_role(
+ sort=[
+ "name"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/8b301122cbf42be6eafeda714a36559e.asciidoc b/docs/examples/8b301122cbf42be6eafeda714a36559e.asciidoc
new file mode 100644
index 000000000..5d3c43e24
--- /dev/null
+++ b/docs/examples/8b301122cbf42be6eafeda714a36559e.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/logstash/put-pipeline.asciidoc:74
+
+[source, python]
+----
+resp = client.logstash.put_pipeline(
+ id="my_pipeline",
+ pipeline={
+ "description": "Sample pipeline for illustration purposes",
+ "last_modified": "2021-01-02T02:50:51.250Z",
+ "pipeline_metadata": {
+ "type": "logstash_pipeline",
+ "version": "1"
+ },
+ "username": "elastic",
+ "pipeline": "input {}\n filter { grok {} }\n output {}",
+ "pipeline_settings": {
+ "pipeline.workers": 1,
+ "pipeline.batch.size": 125,
+ "pipeline.batch.delay": 50,
+ "queue.type": "memory",
+ "queue.max_bytes": "1gb",
+ "queue.checkpoint.writes": 1024
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8b38eeb41eb388ee6d92f26b5c0cc48d.asciidoc b/docs/examples/8b38eeb41eb388ee6d92f26b5c0cc48d.asciidoc
new file mode 100644
index 000000000..7eef58c9e
--- /dev/null
+++ b/docs/examples/8b38eeb41eb388ee6d92f26b5c0cc48d.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:868
+
+[source, python]
+----
+resp = client.put_script(
+ id="my-prod-tag-script",
+ script={
+ "lang": "painless",
+ "source": "\n Collection tags = ctx.tags;\n if(tags != null){\n for (String tag : tags) {\n if (tag.toLowerCase().contains('prod')) {\n return false;\n }\n }\n }\n return true;\n "
+ },
+)
+print(resp)
+
+resp1 = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "drop": {
+ "description": "Drop documents that don't contain 'prod' tag",
+ "if": {
+ "id": "my-prod-tag-script"
+ }
+ }
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/8b3a94495127efd9d56b2cd7f3eecdca.asciidoc b/docs/examples/8b3a94495127efd9d56b2cd7f3eecdca.asciidoc
new file mode 100644
index 000000000..2d6c0a251
--- /dev/null
+++ b/docs/examples/8b3a94495127efd9d56b2cd7f3eecdca.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-role-mappings.asciidoc:64
+
+[source, python]
+----
+resp = client.security.get_role_mapping(
+ name="mapping1",
+)
+print(resp)
+----
diff --git a/docs/examples/8b5bc6e217b0d33e4c88d84f5c1a0712.asciidoc b/docs/examples/8b5bc6e217b0d33e4c88d84f5c1a0712.asciidoc
new file mode 100644
index 000000000..73df13615
--- /dev/null
+++ b/docs/examples/8b5bc6e217b0d33e4c88d84f5c1a0712.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/missing-aggregation.asciidoc:12
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "products_without_a_price": {
+ "missing": {
+ "field": "price"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8b652e3205a5e9e0187f56ce3c36ae4e.asciidoc b/docs/examples/8b652e3205a5e9e0187f56ce3c36ae4e.asciidoc
new file mode 100644
index 000000000..2759a5218
--- /dev/null
+++ b/docs/examples/8b652e3205a5e9e0187f56ce3c36ae4e.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/categorize-text-aggregation.asciidoc:158
+
+[source, python]
+----
+resp = client.search(
+ index="log-messages",
+ filter_path="aggregations",
+ aggs={
+ "categories": {
+ "categorize_text": {
+ "field": "message"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8b7956a2b88fd798a895d3466d671b58.asciidoc b/docs/examples/8b7956a2b88fd798a895d3466d671b58.asciidoc
new file mode 100644
index 000000000..af6ef89e5
--- /dev/null
+++ b/docs/examples/8b7956a2b88fd798a895d3466d671b58.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/network/tracers.asciidoc:29
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "http.tracer.include": "*",
+ "http.tracer.exclude": ""
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8bf1e7a6d529547906ba8b1d6501fa0c.asciidoc b/docs/examples/8bf1e7a6d529547906ba8b1d6501fa0c.asciidoc
new file mode 100644
index 000000000..74dc43129
--- /dev/null
+++ b/docs/examples/8bf1e7a6d529547906ba8b1d6501fa0c.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/set-connector-sync-job-error-api.asciidoc:56
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_connector/_sync_job/my-connector-sync-job/_error",
+ headers={"Content-Type": "application/json"},
+ body={
+ "error": "some-error"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8bf51fd50195b46bacbf872f460ebec2.asciidoc b/docs/examples/8bf51fd50195b46bacbf872f460ebec2.asciidoc
index 61d212e25..550e81a85 100644
--- a/docs/examples/8bf51fd50195b46bacbf872f460ebec2.asciidoc
+++ b/docs/examples/8bf51fd50195b46bacbf872f460ebec2.asciidoc
@@ -1,31 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/version.asciidoc:86
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"versions": {"type": "version"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "versions": {
+ "type": "version"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={
+ document={
"versions": [
"8.0.0-beta1",
"8.5.0",
"0.90.12",
"2.6.1",
"1.3.4",
- "1.3.4",
+ "1.3.4"
]
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/8c2060b0272556457f4871c5d7a589fd.asciidoc b/docs/examples/8c2060b0272556457f4871c5d7a589fd.asciidoc
new file mode 100644
index 000000000..e8442af91
--- /dev/null
+++ b/docs/examples/8c2060b0272556457f4871c5d7a589fd.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/remote-clusters-privileges-cert.asciidoc:244
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="logstash-reader",
+ indices=[
+ {
+ "names": [
+ "logstash-*"
+ ],
+ "privileges": [
+ "read",
+ "view_index_metadata"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/8c5d48252cd6d1ee26a2bb817f89c78e.asciidoc b/docs/examples/8c5d48252cd6d1ee26a2bb817f89c78e.asciidoc
new file mode 100644
index 000000000..63cd82aaa
--- /dev/null
+++ b/docs/examples/8c5d48252cd6d1ee26a2bb817f89c78e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/delete-filter.asciidoc:40
+
+[source, python]
+----
+resp = client.ml.delete_filter(
+ filter_id="safe_domains",
+)
+print(resp)
+----
diff --git a/docs/examples/8c619666488927dac6ecb7dcebca44c2.asciidoc b/docs/examples/8c619666488927dac6ecb7dcebca44c2.asciidoc
new file mode 100644
index 000000000..1ae51b242
--- /dev/null
+++ b/docs/examples/8c619666488927dac6ecb7dcebca44c2.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-mapping.asciidoc:4
+
+[source, python]
+----
+resp = client.indices.create(
+ index="cohere-embeddings",
+ mappings={
+ "properties": {
+ "content_embedding": {
+ "type": "dense_vector",
+ "dims": 1024,
+ "element_type": "byte"
+ },
+ "content": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8c693e057f6e85fbf2b56ca442719362.asciidoc b/docs/examples/8c693e057f6e85fbf2b56ca442719362.asciidoc
index 759ca1452..72894b854 100644
--- a/docs/examples/8c693e057f6e85fbf2b56ca442719362.asciidoc
+++ b/docs/examples/8c693e057f6e85fbf2b56ca442719362.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/aggregate-metric-double.asciidoc:161
[source, python]
@@ -5,15 +6,33 @@
resp = client.search(
index="stats-index",
size="0",
- body={
- "aggs": {
- "metric_min": {"min": {"field": "agg_metric"}},
- "metric_max": {"max": {"field": "agg_metric"}},
- "metric_value_count": {"value_count": {"field": "agg_metric"}},
- "metric_sum": {"sum": {"field": "agg_metric"}},
- "metric_avg": {"avg": {"field": "agg_metric"}},
+ aggs={
+ "metric_min": {
+ "min": {
+ "field": "agg_metric"
+ }
+ },
+ "metric_max": {
+ "max": {
+ "field": "agg_metric"
+ }
+ },
+ "metric_value_count": {
+ "value_count": {
+ "field": "agg_metric"
+ }
+ },
+ "metric_sum": {
+ "sum": {
+ "field": "agg_metric"
+ }
+ },
+ "metric_avg": {
+ "avg": {
+ "field": "agg_metric"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8c6f3bb8abae9ff1d21e776f16ad1c86.asciidoc b/docs/examples/8c6f3bb8abae9ff1d21e776f16ad1c86.asciidoc
new file mode 100644
index 000000000..592b9e8bf
--- /dev/null
+++ b/docs/examples/8c6f3bb8abae9ff1d21e776f16ad1c86.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/put-dfanalytics.asciidoc:574
+
+[source, python]
+----
+resp = client.ml.put_data_frame_analytics(
+ id="model-flight-delays-pre",
+ source={
+ "index": [
+ "kibana_sample_data_flights"
+ ],
+ "query": {
+ "range": {
+ "DistanceKilometers": {
+ "gt": 0
+ }
+ }
+ },
+ "_source": {
+ "includes": [],
+ "excludes": [
+ "FlightDelay",
+ "FlightDelayType"
+ ]
+ }
+ },
+ dest={
+ "index": "df-flight-delays",
+ "results_field": "ml-results"
+ },
+ analysis={
+ "regression": {
+ "dependent_variable": "FlightDelayMin",
+ "training_percent": 90
+ }
+ },
+ analyzed_fields={
+ "includes": [],
+ "excludes": [
+ "FlightNum"
+ ]
+ },
+ model_memory_limit="100mb",
+)
+print(resp)
+----
diff --git a/docs/examples/8c8b5224befab7804461c7e7b6086d9a.asciidoc b/docs/examples/8c8b5224befab7804461c7e7b6086d9a.asciidoc
index 4891e6542..7ef781a6e 100644
--- a/docs/examples/8c8b5224befab7804461c7e7b6086d9a.asciidoc
+++ b/docs/examples/8c8b5224befab7804461c7e7b6086d9a.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/fields/id-field.asciidoc:14
[source, python]
@@ -5,21 +6,32 @@
resp = client.index(
index="my-index-000001",
id="1",
- body={"text": "Document with ID 1"},
+ document={
+ "text": "Document with ID 1"
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="2",
- refresh="true",
- body={"text": "Document with ID 2"},
+ refresh=True,
+ document={
+ "text": "Document with ID 2"
+ },
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
- body={"query": {"terms": {"_id": ["1", "2"]}}},
+ query={
+ "terms": {
+ "_id": [
+ "1",
+ "2"
+ ]
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/8c9081dc738d1290fd76071b283fcaec.asciidoc b/docs/examples/8c9081dc738d1290fd76071b283fcaec.asciidoc
index e12f38b45..bb9df6b30 100644
--- a/docs/examples/8c9081dc738d1290fd76071b283fcaec.asciidoc
+++ b/docs/examples/8c9081dc738d1290fd76071b283fcaec.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:92
[source, python]
@@ -8,4 +9,4 @@ resp = client.get(
routing="user1",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8c92c5e87facbae8dc4f58376ec21815.asciidoc b/docs/examples/8c92c5e87facbae8dc4f58376ec21815.asciidoc
index 488d20841..1d0d3cbd6 100644
--- a/docs/examples/8c92c5e87facbae8dc4f58376ec21815.asciidoc
+++ b/docs/examples/8c92c5e87facbae8dc4f58376ec21815.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1040
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={"fields": ["voltage_corrected", "node"], "size": 2},
+ fields=[
+ "voltage_corrected",
+ "node"
+ ],
+ size=2,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8cbf9b46ce3ccc966c4902d2e0c56317.asciidoc b/docs/examples/8cbf9b46ce3ccc966c4902d2e0c56317.asciidoc
new file mode 100644
index 000000000..e4b4a3ebd
--- /dev/null
+++ b/docs/examples/8cbf9b46ce3ccc966c4902d2e0c56317.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keyword-repeat-tokenfilter.asciidoc:156
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "keyword_repeat",
+ "stemmer"
+ ],
+ text="fox running and jumping",
+ explain=True,
+ attributes="keyword",
+)
+print(resp)
+----
diff --git a/docs/examples/8cd00a3aba7c3c158277bc032aac2830.asciidoc b/docs/examples/8cd00a3aba7c3c158277bc032aac2830.asciidoc
index 452631e77..7140c60f2 100644
--- a/docs/examples/8cd00a3aba7c3c158277bc032aac2830.asciidoc
+++ b/docs/examples/8cd00a3aba7c3c158277bc032aac2830.asciidoc
@@ -1,45 +1,79 @@
+// This file is autogenerated, DO NOT EDIT
// docs/bulk.asciidoc:610
[source, python]
----
resp = client.bulk(
- body=[
+ operations=[
{
"update": {
"_id": "1",
"_index": "index1",
- "retry_on_conflict": 3,
+ "retry_on_conflict": 3
+ }
+ },
+ {
+ "doc": {
+ "field": "value"
}
},
- {"doc": {"field": "value"}},
{
"update": {
"_id": "0",
"_index": "index1",
- "retry_on_conflict": 3,
+ "retry_on_conflict": 3
}
},
{
"script": {
"source": "ctx._source.counter += params.param1",
"lang": "painless",
- "params": {"param1": 1},
+ "params": {
+ "param1": 1
+ }
},
- "upsert": {"counter": 1},
+ "upsert": {
+ "counter": 1
+ }
},
{
"update": {
"_id": "2",
"_index": "index1",
- "retry_on_conflict": 3,
+ "retry_on_conflict": 3
+ }
+ },
+ {
+ "doc": {
+ "field": "value"
+ },
+ "doc_as_upsert": True
+ },
+ {
+ "update": {
+ "_id": "3",
+ "_index": "index1",
+ "_source": True
+ }
+ },
+ {
+ "doc": {
+ "field": "value"
}
},
- {"doc": {"field": "value"}, "doc_as_upsert": True},
- {"update": {"_id": "3", "_index": "index1", "_source": True}},
- {"doc": {"field": "value"}},
- {"update": {"_id": "4", "_index": "index1"}},
- {"doc": {"field": "value"}, "_source": True},
+ {
+ "update": {
+ "_id": "4",
+ "_index": "index1"
+ }
+ },
+ {
+ "doc": {
+ "field": "value"
+ },
+ "_source": True
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8cef2b98f3fe3a85874f1b48ebe6ec63.asciidoc b/docs/examples/8cef2b98f3fe3a85874f1b48ebe6ec63.asciidoc
new file mode 100644
index 000000000..a9159c658
--- /dev/null
+++ b/docs/examples/8cef2b98f3fe3a85874f1b48ebe6ec63.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/elision-tokenfilter.asciidoc:165
+
+[source, python]
+----
+resp = client.indices.create(
+ index="elision_case_insensitive_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "default": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "elision_case_insensitive"
+ ]
+ }
+ },
+ "filter": {
+ "elision_case_insensitive": {
+ "type": "elision",
+ "articles": [
+ "l",
+ "m",
+ "t",
+ "qu",
+ "n",
+ "s",
+ "j"
+ ],
+ "articles_case": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8d064eda2199de52e5be9ee68a5b7c68.asciidoc b/docs/examples/8d064eda2199de52e5be9ee68a5b7c68.asciidoc
new file mode 100644
index 000000000..7c677a42b
--- /dev/null
+++ b/docs/examples/8d064eda2199de52e5be9ee68a5b7c68.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/semantic-search/generate-embeddings.asciidoc:17
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-text-embeddings-pipeline",
+ description="Text embedding pipeline",
+ processors=[
+ {
+ "inference": {
+ "model_id": ".elser_model_2",
+ "input_output": [
+ {
+ "input_field": "my_text_field",
+ "output_field": "my_tokens"
+ }
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/8d421c5bec38eecce4679b219cacc9db.asciidoc b/docs/examples/8d421c5bec38eecce4679b219cacc9db.asciidoc
new file mode 100644
index 000000000..b8f9f80aa
--- /dev/null
+++ b/docs/examples/8d421c5bec38eecce4679b219cacc9db.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-rank-aggregation.asciidoc:128
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ runtime_mappings={
+ "load_time.seconds": {
+ "type": "long",
+ "script": {
+ "source": "emit(doc['load_time'].value / params.timeUnit)",
+ "params": {
+ "timeUnit": 1000
+ }
+ }
+ }
+ },
+ aggs={
+ "load_time_ranks": {
+ "percentile_ranks": {
+ "values": [
+ 500,
+ 600
+ ],
+ "field": "load_time.seconds"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8d4ca17349e7e82c329cdd854cc670a1.asciidoc b/docs/examples/8d4ca17349e7e82c329cdd854cc670a1.asciidoc
new file mode 100644
index 000000000..26519cdfc
--- /dev/null
+++ b/docs/examples/8d4ca17349e7e82c329cdd854cc670a1.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/remote-clusters-privileges-cert.asciidoc:184
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="remote-search",
+)
+print(resp)
+----
diff --git a/docs/examples/8d4dda5d988d568f4f4210a6387e026f.asciidoc b/docs/examples/8d4dda5d988d568f4f4210a6387e026f.asciidoc
new file mode 100644
index 000000000..dcfbb881e
--- /dev/null
+++ b/docs/examples/8d4dda5d988d568f4f4210a6387e026f.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/saml-logout-api.asciidoc:66
+
+[source, python]
+----
+resp = client.security.saml_logout(
+ token="46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3",
+ refresh_token="mJdXLtmvTUSpoLwMvdBt_w",
+)
+print(resp)
+----
diff --git a/docs/examples/8d6631b622f9bfb8fa70154f6fb8b153.asciidoc b/docs/examples/8d6631b622f9bfb8fa70154f6fb8b153.asciidoc
new file mode 100644
index 000000000..66de1a0bc
--- /dev/null
+++ b/docs/examples/8d6631b622f9bfb8fa70154f6fb8b153.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/uni-directional-disaster-recovery.asciidoc:188
+
+[source, python]
+----
+resp = client.search(
+ index="kibana_sample_data_ecommerce",
+ q="kimchy",
+)
+print(resp)
+----
diff --git a/docs/examples/8d7193902a353872740a3324c60c5001.asciidoc b/docs/examples/8d7193902a353872740a3324c60c5001.asciidoc
index ff3d2176d..34f00e111 100644
--- a/docs/examples/8d7193902a353872740a3324c60c5001.asciidoc
+++ b/docs/examples/8d7193902a353872740a3324c60c5001.asciidoc
@@ -1,15 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/index-sorting.asciidoc:113
[source, python]
----
resp = client.indices.create(
index="events",
- body={
- "settings": {
- "index": {"sort.field": "timestamp", "sort.order": "desc"}
- },
- "mappings": {"properties": {"timestamp": {"type": "date"}}},
+ settings={
+ "index": {
+ "sort.field": "timestamp",
+ "sort.order": "desc"
+ }
+ },
+ mappings={
+ "properties": {
+ "timestamp": {
+ "type": "date"
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8d9b04f2a97f4229dec9e620126de049.asciidoc b/docs/examples/8d9b04f2a97f4229dec9e620126de049.asciidoc
new file mode 100644
index 000000000..f19109ac3
--- /dev/null
+++ b/docs/examples/8d9b04f2a97f4229dec9e620126de049.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/repository-s3.asciidoc:598
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "logger.com.amazonaws.request": "DEBUG"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8db799543eb084ec71547980863d60b9.asciidoc b/docs/examples/8db799543eb084ec71547980863d60b9.asciidoc
new file mode 100644
index 000000000..1b1a591f3
--- /dev/null
+++ b/docs/examples/8db799543eb084ec71547980863d60b9.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/sum-bucket-aggregation.asciidoc:42
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "sum_monthly_sales": {
+ "sum_bucket": {
+ "buckets_path": "sales_per_month>sales"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8de6fed6ba2b94ce6a12ce076be2b4d7.asciidoc b/docs/examples/8de6fed6ba2b94ce6a12ce076be2b4d7.asciidoc
new file mode 100644
index 000000000..98d0c6ac7
--- /dev/null
+++ b/docs/examples/8de6fed6ba2b94ce6a12ce076be2b4d7.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/segments.asciidoc:127
+
+[source, python]
+----
+resp = client.cat.segments(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/8e06d8b2b737c43806018eae2ca061c1.asciidoc b/docs/examples/8e06d8b2b737c43806018eae2ca061c1.asciidoc
new file mode 100644
index 000000000..6e05d3574
--- /dev/null
+++ b/docs/examples/8e06d8b2b737c43806018eae2ca061c1.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/string-stats-aggregation.asciidoc:178
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ size="0",
+ aggs={
+ "message_stats": {
+ "string_stats": {
+ "field": "message.keyword",
+ "missing": "[empty message]"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8e0f43829df9af20547ea6896f4c0124.asciidoc b/docs/examples/8e0f43829df9af20547ea6896f4c0124.asciidoc
new file mode 100644
index 000000000..7b0f9bde3
--- /dev/null
+++ b/docs/examples/8e0f43829df9af20547ea6896f4c0124.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-rollover.asciidoc:327
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="rollover_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_size": "50gb"
+ }
+ }
+ },
+ "delete": {
+ "min_age": "1d",
+ "actions": {
+ "delete": {}
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8e208098a0156c4c92afe0a06960b230.asciidoc b/docs/examples/8e208098a0156c4c92afe0a06960b230.asciidoc
new file mode 100644
index 000000000..defa6892f
--- /dev/null
+++ b/docs/examples/8e208098a0156c4c92afe0a06960b230.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/saml-authenticate-api.asciidoc:83
+
+[source, python]
+----
+resp = client.security.saml_authenticate(
+ content="PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....",
+ ids=[
+ "4fee3b046395c4e751011e97f8900b5273d56685"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc b/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc
index 2f5fd43ec..489074fed 100644
--- a/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc
+++ b/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc
@@ -1,9 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// setup/logging-config.asciidoc:272
[source, python]
----
resp = client.cluster.put_settings(
- body={"persistent": {"logger.org.elasticsearch.deprecation": "OFF"}},
+ persistent={
+ "logger.org.elasticsearch.deprecation": "OFF"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8e2bbef535fef688d397e60e09aefa7f.asciidoc b/docs/examples/8e2bbef535fef688d397e60e09aefa7f.asciidoc
new file mode 100644
index 000000000..b6b5fa22c
--- /dev/null
+++ b/docs/examples/8e2bbef535fef688d397e60e09aefa7f.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/hotspotting.asciidoc:200
+
+[source, python]
+----
+resp = client.indices.stats(
+ metric="indexing,search",
+ level="shards",
+ human=True,
+ expand_wildcards="all",
+)
+print(resp)
+----
diff --git a/docs/examples/8e42a17edace2bc6e42c6a1532779937.asciidoc b/docs/examples/8e42a17edace2bc6e42c6a1532779937.asciidoc
new file mode 100644
index 000000000..7c55fe22d
--- /dev/null
+++ b/docs/examples/8e42a17edace2bc6e42c6a1532779937.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/max-aggregation.asciidoc:17
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "max_price": {
+ "max": {
+ "field": "price"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8e43bb5b7946143e69d397bb81d87df0.asciidoc b/docs/examples/8e43bb5b7946143e69d397bb81d87df0.asciidoc
new file mode 100644
index 000000000..db3591bdb
--- /dev/null
+++ b/docs/examples/8e43bb5b7946143e69d397bb81d87df0.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/get-follow-stats.asciidoc:219
+
+[source, python]
+----
+resp = client.ccr.follow_stats(
+ index="follower_index",
+)
+print(resp)
+----
diff --git a/docs/examples/8e68cdfad45e7e6dff254d931eea29d4.asciidoc b/docs/examples/8e68cdfad45e7e6dff254d931eea29d4.asciidoc
index 90b493442..1e8a79fd9 100644
--- a/docs/examples/8e68cdfad45e7e6dff254d931eea29d4.asciidoc
+++ b/docs/examples/8e68cdfad45e7e6dff254d931eea29d4.asciidoc
@@ -1,67 +1,90 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:687
[source, python]
----
resp = client.bulk(
index="my-index-000001",
- refresh="true",
- body=[
- {"index": {}},
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
{
"@timestamp": "2020-06-21T15:00:01-05:00",
- "message": '211.11.9.0 - - [2020-06-21T15:00:01-05:00] "GET /english/index.html HTTP/1.0" 304 0',
+ "message": "211.11.9.0 - - [2020-06-21T15:00:01-05:00] \"GET /english/index.html HTTP/1.0\" 304 0"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": "2020-06-21T15:00:01-05:00",
- "message": '211.11.9.0 - - [2020-06-21T15:00:01-05:00] "GET /english/index.html HTTP/1.0" 304 0',
+ "message": "211.11.9.0 - - [2020-06-21T15:00:01-05:00] \"GET /english/index.html HTTP/1.0\" 304 0"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": "2020-04-30T14:30:17-05:00",
- "message": '40.135.0.0 - - [2020-04-30T14:30:17-05:00] "GET /images/hm_bg.jpg HTTP/1.0" 200 24736',
+ "message": "40.135.0.0 - - [2020-04-30T14:30:17-05:00] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": "2020-04-30T14:30:53-05:00",
- "message": '232.0.0.0 - - [2020-04-30T14:30:53-05:00] "GET /images/hm_bg.jpg HTTP/1.0" 200 24736',
+ "message": "232.0.0.0 - - [2020-04-30T14:30:53-05:00] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": "2020-04-30T14:31:12-05:00",
- "message": '26.1.0.0 - - [2020-04-30T14:31:12-05:00] "GET /images/hm_bg.jpg HTTP/1.0" 200 24736',
+ "message": "26.1.0.0 - - [2020-04-30T14:31:12-05:00] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": "2020-04-30T14:31:19-05:00",
- "message": '247.37.0.0 - - [2020-04-30T14:31:19-05:00] "GET /french/splash_inet.html HTTP/1.0" 200 3781',
+ "message": "247.37.0.0 - - [2020-04-30T14:31:19-05:00] \"GET /french/splash_inet.html HTTP/1.0\" 200 3781"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": "2020-04-30T14:31:27-05:00",
- "message": '252.0.0.0 - - [2020-04-30T14:31:27-05:00] "GET /images/hm_bg.jpg HTTP/1.0" 200 24736',
+ "message": "252.0.0.0 - - [2020-04-30T14:31:27-05:00] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": "2020-04-30T14:31:29-05:00",
- "message": '247.37.0.0 - - [2020-04-30T14:31:29-05:00] "GET /images/hm_brdl.gif HTTP/1.0" 304 0',
+ "message": "247.37.0.0 - - [2020-04-30T14:31:29-05:00] \"GET /images/hm_brdl.gif HTTP/1.0\" 304 0"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": "2020-04-30T14:31:29-05:00",
- "message": '247.37.0.0 - - [2020-04-30T14:31:29-05:00] "GET /images/hm_arw.gif HTTP/1.0" 304 0',
+ "message": "247.37.0.0 - - [2020-04-30T14:31:29-05:00] \"GET /images/hm_arw.gif HTTP/1.0\" 304 0"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"@timestamp": "2020-04-30T14:31:32-05:00",
- "message": '247.37.0.0 - - [2020-04-30T14:31:32-05:00] "GET /images/nav_bg_top.gif HTTP/1.0" 200 929',
+ "message": "247.37.0.0 - - [2020-04-30T14:31:32-05:00] \"GET /images/nav_bg_top.gif HTTP/1.0\" 200 929"
},
- {"index": {}},
{
- "@timestamp": "2020-04-30T14:31:43-05:00",
- "message": '247.37.0.0 - - [2020-04-30T14:31:43-05:00] "GET /french/images/nav_venue_off.gif HTTP/1.0" 304 0',
+ "index": {}
},
+ {
+ "@timestamp": "2020-04-30T14:31:43-05:00",
+ "message": "247.37.0.0 - - [2020-04-30T14:31:43-05:00] \"GET /french/images/nav_venue_off.gif HTTP/1.0\" 304 0"
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8e89fee0be6a436c4e3d7c152659c47e.asciidoc b/docs/examples/8e89fee0be6a436c4e3d7c152659c47e.asciidoc
new file mode 100644
index 000000000..5d065d20d
--- /dev/null
+++ b/docs/examples/8e89fee0be6a436c4e3d7c152659c47e.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-scheduling-api.asciidoc:89
+
+[source, python]
+----
+resp = client.connector.update_scheduling(
+ connector_id="my-connector",
+ scheduling={
+ "access_control": {
+ "enabled": True,
+ "interval": "0 10 0 * * ?"
+ },
+ "full": {
+ "enabled": True,
+ "interval": "0 20 0 * * ?"
+ },
+ "incremental": {
+ "enabled": False,
+ "interval": "0 30 0 * * ?"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8e92b10ebcfedc76562ab52d0e46b916.asciidoc b/docs/examples/8e92b10ebcfedc76562ab52d0e46b916.asciidoc
new file mode 100644
index 000000000..63ed62bd7
--- /dev/null
+++ b/docs/examples/8e92b10ebcfedc76562ab52d0e46b916.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:234
+
+[source, python]
+----
+resp = client.delete_script(
+ id="my-search-template",
+)
+print(resp)
+----
diff --git a/docs/examples/8e9e7dc5fad2b2b8e74ab4dc225d9c53.asciidoc b/docs/examples/8e9e7dc5fad2b2b8e74ab4dc225d9c53.asciidoc
new file mode 100644
index 000000000..d6d14075f
--- /dev/null
+++ b/docs/examples/8e9e7dc5fad2b2b8e74ab4dc225d9c53.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/common/apis/set-upgrade-mode.asciidoc:96
+
+[source, python]
+----
+resp = client.ml.set_upgrade_mode(
+ enabled=False,
+ timeout="10m",
+)
+print(resp)
+----
diff --git a/docs/examples/8e9f7261af6264c92d0eb4d586a176f9.asciidoc b/docs/examples/8e9f7261af6264c92d0eb4d586a176f9.asciidoc
new file mode 100644
index 000000000..b702340b4
--- /dev/null
+++ b/docs/examples/8e9f7261af6264c92d0eb4d586a176f9.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/lowercase-tokenfilter.asciidoc:82
+
+[source, python]
+----
+resp = client.indices.create(
+ index="lowercase_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_lowercase": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "lowercase"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8eac28d2e9b6482b413d61817456a14f.asciidoc b/docs/examples/8eac28d2e9b6482b413d61817456a14f.asciidoc
index 822855346..1c009266d 100644
--- a/docs/examples/8eac28d2e9b6482b413d61817456a14f.asciidoc
+++ b/docs/examples/8eac28d2e9b6482b413d61817456a14f.asciidoc
@@ -1,21 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:272
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "genres": {
- "terms": {
- "field": "genre",
- "order": {"max_play_count": "desc"},
- },
- "aggs": {
- "max_play_count": {"max": {"field": "play_count"}}
- },
+ aggs={
+ "genres": {
+ "terms": {
+ "field": "genre",
+ "order": {
+ "max_play_count": "desc"
+ }
+ },
+ "aggs": {
+ "max_play_count": {
+ "max": {
+ "field": "play_count"
+ }
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8ecefdcf8f153cf91588e9fdde8f3e6b.asciidoc b/docs/examples/8ecefdcf8f153cf91588e9fdde8f3e6b.asciidoc
index 0d47ed679..1597f63d7 100644
--- a/docs/examples/8ecefdcf8f153cf91588e9fdde8f3e6b.asciidoc
+++ b/docs/examples/8ecefdcf8f153cf91588e9fdde8f3e6b.asciidoc
@@ -1,17 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:299
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {
- "fields": ["content", "name^5"],
- "query": "this AND that OR thus",
- "tie_breaker": 0,
- }
+ query={
+ "query_string": {
+ "fields": [
+ "content",
+ "name^5"
+ ],
+ "query": "this AND that OR thus",
+ "tie_breaker": 0
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8ed31628081db2b6e9106d61d1e142be.asciidoc b/docs/examples/8ed31628081db2b6e9106d61d1e142be.asciidoc
new file mode 100644
index 000000000..31c18d331
--- /dev/null
+++ b/docs/examples/8ed31628081db2b6e9106d61d1e142be.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/simple-query-string-query.asciidoc:291
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "simple_query_string": {
+ "query": "ny city",
+ "auto_generate_synonyms_phrase_query": False
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8edcd80d9b545a222dcc2f25ca4c6d5f.asciidoc b/docs/examples/8edcd80d9b545a222dcc2f25ca4c6d5f.asciidoc
new file mode 100644
index 000000000..0faac0aab
--- /dev/null
+++ b/docs/examples/8edcd80d9b545a222dcc2f25ca4c6d5f.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:455
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my-search-app",
+ params={
+ "query_string": "What is the most popular brand of coffee sold in the United States?",
+ "elser_fields": [
+ "title",
+ "meta_description"
+ ],
+ "text_fields": [
+ "title",
+ "meta_description"
+ ],
+ "rrf": {
+ "rank_window_size": 50,
+ "rank_constant": 25
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8ee9521f57661a050efb614f02b4a090.asciidoc b/docs/examples/8ee9521f57661a050efb614f02b4a090.asciidoc
index 2b11968d7..3705d1af4 100644
--- a/docs/examples/8ee9521f57661a050efb614f02b4a090.asciidoc
+++ b/docs/examples/8ee9521f57661a050efb614f02b4a090.asciidoc
@@ -1,9 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:58
[source, python]
----
resp = client.search(
- body={"aggs": {"genres": {"terms": {"field": "genre"}}}},
+ aggs={
+ "genres": {
+ "terms": {
+ "field": "genre"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8f0a3d7b5fbdf5351750a23c493cc078.asciidoc b/docs/examples/8f0a3d7b5fbdf5351750a23c493cc078.asciidoc
new file mode 100644
index 000000000..769097bfb
--- /dev/null
+++ b/docs/examples/8f0a3d7b5fbdf5351750a23c493cc078.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-using-query-rules.asciidoc:200
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "rule": {
+ "organic": {
+ "query_string": {
+ "query": "puggles"
+ }
+ },
+ "match_criteria": {
+ "query_string": "puggles",
+ "user_country": "us"
+ },
+ "ruleset_ids": [
+ "my-ruleset"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8f0c5c81cdb902c136db821947ee70a1.asciidoc b/docs/examples/8f0c5c81cdb902c136db821947ee70a1.asciidoc
new file mode 100644
index 000000000..c161fe6ea
--- /dev/null
+++ b/docs/examples/8f0c5c81cdb902c136db821947ee70a1.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/min-aggregation.asciidoc:53
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ runtime_mappings={
+ "price.adjusted": {
+ "type": "double",
+ "script": "\n double price = doc['price'].value;\n if (doc['promoted'].value) {\n price *= 0.8;\n }\n emit(price);\n "
+ }
+ },
+ aggs={
+ "min_price": {
+ "min": {
+ "field": "price.adjusted"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8f4a7f68f2ca3698abdf20026a2d8c5f.asciidoc b/docs/examples/8f4a7f68f2ca3698abdf20026a2d8c5f.asciidoc
new file mode 100644
index 000000000..3567b8751
--- /dev/null
+++ b/docs/examples/8f4a7f68f2ca3698abdf20026a2d8c5f.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/tasks.asciidoc:153
+
+[source, python]
+----
+resp = client.tasks.list(
+ actions="*search",
+ detailed=True,
+)
+print(resp)
+----
diff --git a/docs/examples/8f6f7ea5abf56152b4a5639ddf40848f.asciidoc b/docs/examples/8f6f7ea5abf56152b4a5639ddf40848f.asciidoc
new file mode 100644
index 000000000..68d39126d
--- /dev/null
+++ b/docs/examples/8f6f7ea5abf56152b4a5639ddf40848f.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/jwt-realm.asciidoc:471
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="native1_users",
+ refresh=True,
+ roles=[
+ "user"
+ ],
+ rules={
+ "all": [
+ {
+ "field": {
+ "realm.name": "native1"
+ }
+ },
+ {
+ "field": {
+ "username": "principalname1"
+ }
+ }
+ ]
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/8f7936f219500305e5b2518dbbf949ea.asciidoc b/docs/examples/8f7936f219500305e5b2518dbbf949ea.asciidoc
new file mode 100644
index 000000000..e6dd34982
--- /dev/null
+++ b/docs/examples/8f7936f219500305e5b2518dbbf949ea.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-across-clusters.asciidoc:742
+
+[source, python]
+----
+resp = client.async_search.status(
+ id="FmpwbThueVB4UkRDeUxqb1l4akIza3cbWEJyeVBPQldTV3FGZGdIeUVabXBldzoyMDIw",
+)
+print(resp)
+----
diff --git a/docs/examples/8f9a3fcd17a111f63caa3bef6e5f00f2.asciidoc b/docs/examples/8f9a3fcd17a111f63caa3bef6e5f00f2.asciidoc
index 891db6f02..808d78dca 100644
--- a/docs/examples/8f9a3fcd17a111f63caa3bef6e5f00f2.asciidoc
+++ b/docs/examples/8f9a3fcd17a111f63caa3bef6e5f00f2.asciidoc
@@ -1,13 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:782
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "tags": {"terms": {"field": "tags", "execution_hint": "map"}}
+ aggs={
+ "tags": {
+ "terms": {
+ "field": "tags",
+ "execution_hint": "map"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8f9f88cf9a27c1138226efb94ac09e73.asciidoc b/docs/examples/8f9f88cf9a27c1138226efb94ac09e73.asciidoc
index a8bc49460..1714b5384 100644
--- a/docs/examples/8f9f88cf9a27c1138226efb94ac09e73.asciidoc
+++ b/docs/examples/8f9f88cf9a27c1138226efb94ac09e73.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/ip.asciidoc:112
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={"query": {"term": {"ip_addr": "192.168.0.0/16"}}},
+ query={
+ "term": {
+ "ip_addr": "192.168.0.0/16"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/8fe128323a944765f525c76d85af7a2f.asciidoc b/docs/examples/8fe128323a944765f525c76d85af7a2f.asciidoc
new file mode 100644
index 000000000..0e29091f2
--- /dev/null
+++ b/docs/examples/8fe128323a944765f525c76d85af7a2f.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/random-sampler-aggregation.asciidoc:25
+
+[source, python]
+----
+resp = client.search(
+ index="kibana_sample_data_ecommerce",
+ size="0",
+ track_total_hits=False,
+ aggregations={
+ "sampling": {
+ "random_sampler": {
+ "probability": 0.1
+ },
+ "aggs": {
+ "price_percentiles": {
+ "percentiles": {
+ "field": "taxful_total_price"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/8fec06a98d0151c1d717a01491d0b8f0.asciidoc b/docs/examples/8fec06a98d0151c1d717a01491d0b8f0.asciidoc
new file mode 100644
index 000000000..46d05770e
--- /dev/null
+++ b/docs/examples/8fec06a98d0151c1d717a01491d0b8f0.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-migrate-data-stream-from-ilm-to-dsl.asciidoc:79
+
+[source, python]
+----
+resp = client.index(
+ index="dsl-data-stream",
+ document={
+ "@timestamp": "2023-10-18T16:21:15.000Z",
+ "message": "192.0.2.42 - - [06/May/2099:16:21:15 +0000] \"GET /images/bg.jpg HTTP/1.0\" 200 24736"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/90083d93e46fad2524755b8d4d1306fc.asciidoc b/docs/examples/90083d93e46fad2524755b8d4d1306fc.asciidoc
new file mode 100644
index 000000000..f2fd9f349
--- /dev/null
+++ b/docs/examples/90083d93e46fad2524755b8d4d1306fc.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/set-connector-sync-job-stats-api.asciidoc:74
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_connector/_sync_job/my-connector-sync-job/_stats",
+ headers={"Content-Type": "application/json"},
+ body={
+ "deleted_document_count": 10,
+ "indexed_document_count": 20,
+ "indexed_document_volume": 1000,
+ "total_document_count": 2000,
+ "last_seen": "2023-01-02T10:00:00Z"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/901d66919e584515717bf78ab5ca2cbb.asciidoc b/docs/examples/901d66919e584515717bf78ab5ca2cbb.asciidoc
new file mode 100644
index 000000000..920b3808c
--- /dev/null
+++ b/docs/examples/901d66919e584515717bf78ab5ca2cbb.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/daterange-aggregation.asciidoc:276
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "range": {
+ "date_range": {
+ "field": "date",
+ "time_zone": "CET",
+ "ranges": [
+ {
+ "to": "2016/02/01"
+ },
+ {
+ "from": "2016/02/01",
+ "to": "now/d"
+ },
+ {
+ "from": "now/d"
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/902cfd5aeec2f65b3adf55f5e38b21f0.asciidoc b/docs/examples/902cfd5aeec2f65b3adf55f5e38b21f0.asciidoc
new file mode 100644
index 000000000..ad9ec3fbd
--- /dev/null
+++ b/docs/examples/902cfd5aeec2f65b3adf55f5e38b21f0.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/uni-directional-disaster-recovery.asciidoc:117
+
+[source, python]
+----
+resp = client.index(
+ index="kibana_sample_data_ecommerce2",
+ document={
+ "user": "kimchy"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9054187cbab5c9e1c4ca2a4dba6a5db0.asciidoc b/docs/examples/9054187cbab5c9e1c4ca2a4dba6a5db0.asciidoc
new file mode 100644
index 000000000..d6939a443
--- /dev/null
+++ b/docs/examples/9054187cbab5c9e1c4ca2a4dba6a5db0.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/info.asciidoc:51
+
+[source, python]
+----
+resp = client.xpack.info()
+print(resp)
+----
diff --git a/docs/examples/90631797c7fbda43902abf2cc0ea8304.asciidoc b/docs/examples/90631797c7fbda43902abf2cc0ea8304.asciidoc
index 376614889..a4049b5aa 100644
--- a/docs/examples/90631797c7fbda43902abf2cc0ea8304.asciidoc
+++ b/docs/examples/90631797c7fbda43902abf2cc0ea8304.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// modules/indices/request_cache.asciidoc:146
[source, python]
@@ -5,7 +6,7 @@
resp = client.nodes.stats(
metric="indices",
index_metric="request_cache",
- human="true",
+ human=True,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/908326e14ad76c2ff04a9b6d8365751f.asciidoc b/docs/examples/908326e14ad76c2ff04a9b6d8365751f.asciidoc
new file mode 100644
index 000000000..7350517ec
--- /dev/null
+++ b/docs/examples/908326e14ad76c2ff04a9b6d8365751f.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:872
+
+[source, python]
+----
+resp = client.search(
+ index="passage_vectors",
+ fields=[
+ "creation_time",
+ "full_text"
+ ],
+ source=False,
+ knn={
+ "query_vector": [
+ 0.45,
+ 45
+ ],
+ "field": "paragraph.vector",
+ "k": 2,
+ "num_candidates": 2,
+ "inner_hits": {
+ "_source": False,
+ "fields": [
+ "paragraph.text"
+ ],
+ "size": 1
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/909a032a9c1f7095b798444705b09ad6.asciidoc b/docs/examples/909a032a9c1f7095b798444705b09ad6.asciidoc
index 05448d934..50a3b9ef0 100644
--- a/docs/examples/909a032a9c1f7095b798444705b09ad6.asciidoc
+++ b/docs/examples/909a032a9c1f7095b798444705b09ad6.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:444
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "GEOMETRYCOLLECTION (POINT (100.0 0.0), LINESTRING (101.0 0.0, 102.0 1.0))"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/90c087560ea6c0b7405f710971c86ef0.asciidoc b/docs/examples/90c087560ea6c0b7405f710971c86ef0.asciidoc
new file mode 100644
index 000000000..f582f5f81
--- /dev/null
+++ b/docs/examples/90c087560ea6c0b7405f710971c86ef0.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/auto-follow/put-auto-follow-pattern.asciidoc:113
+
+[source, python]
+----
+resp = client.ccr.put_auto_follow_pattern(
+ name="my_auto_follow_pattern",
+ remote_cluster="remote_cluster",
+ leader_index_patterns=[
+ "leader_index*"
+ ],
+ follow_index_pattern="{{leader_index}}-follower",
+ settings={
+ "index.number_of_replicas": 0
+ },
+ max_read_request_operation_count=1024,
+ max_outstanding_read_requests=16,
+ max_read_request_size="1024k",
+ max_write_request_operation_count=32768,
+ max_write_request_size="16k",
+ max_outstanding_write_requests=8,
+ max_write_buffer_count=512,
+ max_write_buffer_size="512k",
+ max_retry_delay="10s",
+ read_poll_timeout="30s",
+)
+print(resp)
+----
diff --git a/docs/examples/90e06d5ec5e454832d8fbd2e73ec2248.asciidoc b/docs/examples/90e06d5ec5e454832d8fbd2e73ec2248.asciidoc
new file mode 100644
index 000000000..f7a08a261
--- /dev/null
+++ b/docs/examples/90e06d5ec5e454832d8fbd2e73ec2248.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/apis/delete-autoscaling-policy.asciidoc:79
+
+[source, python]
+----
+resp = client.autoscaling.delete_autoscaling_policy(
+ name="*",
+)
+print(resp)
+----
diff --git a/docs/examples/90f1f5304922fb6d097846dd1444c075.asciidoc b/docs/examples/90f1f5304922fb6d097846dd1444c075.asciidoc
new file mode 100644
index 000000000..b1b1b74c1
--- /dev/null
+++ b/docs/examples/90f1f5304922fb6d097846dd1444c075.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/example-watches/example-watch-clusterstatus.asciidoc:137
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="cluster_health_watch",
+ trigger={
+ "schedule": {
+ "interval": "10s"
+ }
+ },
+ input={
+ "http": {
+ "request": {
+ "host": "localhost",
+ "port": 9200,
+ "path": "/_cluster/health"
+ }
+ }
+ },
+ condition={
+ "compare": {
+ "ctx.payload.status": {
+ "eq": "red"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9116ee8a5b00cc877291ed5559563f24.asciidoc b/docs/examples/9116ee8a5b00cc877291ed5559563f24.asciidoc
new file mode 100644
index 000000000..0259220c5
--- /dev/null
+++ b/docs/examples/9116ee8a5b00cc877291ed5559563f24.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/ack-watch.asciidoc:62
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="my_watch",
+ trigger={
+ "schedule": {
+ "yearly": {
+ "in": "february",
+ "on": 29,
+ "at": "noon"
+ }
+ }
+ },
+ input={
+ "simple": {
+ "payload": {
+ "send": "yes"
+ }
+ }
+ },
+ condition={
+ "always": {}
+ },
+ actions={
+ "test_index": {
+ "throttle_period": "15m",
+ "index": {
+ "index": "test"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/911c56114e50ce7440eb83efc91d28b8.asciidoc b/docs/examples/911c56114e50ce7440eb83efc91d28b8.asciidoc
new file mode 100644
index 000000000..1233630dc
--- /dev/null
+++ b/docs/examples/911c56114e50ce7440eb83efc91d28b8.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:223
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my-data-stream",
+ properties={
+ "host": {
+ "properties": {
+ "ip": {
+ "type": "ip",
+ "ignore_malformed": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9120b6a49ec39a1571339fddf8e1a26f.asciidoc b/docs/examples/9120b6a49ec39a1571339fddf8e1a26f.asciidoc
new file mode 100644
index 000000000..a6d62dab7
--- /dev/null
+++ b/docs/examples/9120b6a49ec39a1571339fddf8e1a26f.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:466
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "set": {
+ "field": "my-long-field",
+ "value": 10
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/91270cef57ac455547ffd47839420887.asciidoc b/docs/examples/91270cef57ac455547ffd47839420887.asciidoc
new file mode 100644
index 000000000..8f5f5e685
--- /dev/null
+++ b/docs/examples/91270cef57ac455547ffd47839420887.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/rate-aggregation.asciidoc:175
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ filter_path="aggregations",
+ size="0",
+ aggs={
+ "buckets": {
+ "composite": {
+ "sources": [
+ {
+ "month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ }
+ }
+ },
+ {
+ "type": {
+ "terms": {
+ "field": "type"
+ }
+ }
+ }
+ ]
+ },
+ "aggs": {
+ "avg_price": {
+ "rate": {
+ "field": "price",
+ "unit": "day"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9129dec88d35571b3166c6677297f03b.asciidoc b/docs/examples/9129dec88d35571b3166c6677297f03b.asciidoc
new file mode 100644
index 000000000..bf613cbd6
--- /dev/null
+++ b/docs/examples/9129dec88d35571b3166c6677297f03b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/get-transform.asciidoc:109
+
+[source, python]
+----
+resp = client.transform.get_transform(
+ transform_id="ecommerce_transform1",
+)
+print(resp)
+----
diff --git a/docs/examples/9138550002cb26ab64918cce427963b8.asciidoc b/docs/examples/9138550002cb26ab64918cce427963b8.asciidoc
new file mode 100644
index 000000000..ce568686c
--- /dev/null
+++ b/docs/examples/9138550002cb26ab64918cce427963b8.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template.asciidoc:268
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="template_1",
+ index_patterns=[
+ "foo",
+ "bar"
+ ],
+ priority=0,
+ template={
+ "settings": {
+ "number_of_shards": 1
+ }
+ },
+ version=123,
+)
+print(resp)
+----
diff --git a/docs/examples/913c163c197802078a8af72150178061.asciidoc b/docs/examples/913c163c197802078a8af72150178061.asciidoc
new file mode 100644
index 000000000..8846cd8e8
--- /dev/null
+++ b/docs/examples/913c163c197802078a8af72150178061.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/derivative-aggregation.asciidoc:136
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "sales_deriv": {
+ "derivative": {
+ "buckets_path": "sales"
+ }
+ },
+ "sales_2nd_deriv": {
+ "derivative": {
+ "buckets_path": "sales_deriv"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9143be4f137574271953a7a8107e175b.asciidoc b/docs/examples/9143be4f137574271953a7a8107e175b.asciidoc
new file mode 100644
index 000000000..56b693906
--- /dev/null
+++ b/docs/examples/9143be4f137574271953a7a8107e175b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-user-profile.asciidoc:63
+
+[source, python]
+----
+resp = client.security.get_user_profile(
+ uid="u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0",
+)
+print(resp)
+----
diff --git a/docs/examples/91750571c195718f0ff246e058e4bc63.asciidoc b/docs/examples/91750571c195718f0ff246e058e4bc63.asciidoc
new file mode 100644
index 000000000..4b45f680e
--- /dev/null
+++ b/docs/examples/91750571c195718f0ff246e058e4bc63.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:73
+
+[source, python]
+----
+resp = client.search(
+ index="twitter",
+ query={
+ "match": {
+ "title": "elasticsearch"
+ }
+ },
+ sort=[
+ {
+ "date": "asc"
+ },
+ {
+ "tie_breaker_id": "asc"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/91c01fcad9bf341d039a15dfc593dcd7.asciidoc b/docs/examples/91c01fcad9bf341d039a15dfc593dcd7.asciidoc
new file mode 100644
index 000000000..cbbebebab
--- /dev/null
+++ b/docs/examples/91c01fcad9bf341d039a15dfc593dcd7.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// search/field-caps.asciidoc:305
+
+[source, python]
+----
+resp = client.field_caps(
+ index="my-index-*",
+ fields="rating",
+ index_filter={
+ "range": {
+ "@timestamp": {
+ "gte": "2018"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/91c925fc71abe0ddfe52457e9130363b.asciidoc b/docs/examples/91c925fc71abe0ddfe52457e9130363b.asciidoc
new file mode 100644
index 000000000..6673f2caa
--- /dev/null
+++ b/docs/examples/91c925fc71abe0ddfe52457e9130363b.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/grant-api-keys.asciidoc:172
+
+[source, python]
+----
+resp = client.security.grant_api_key(
+ grant_type="password",
+ username="test_admin",
+ password="x-pack-test-password",
+ run_as="test_user",
+ api_key={
+ "name": "another-api-key"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/91cbeeda86b4e4e393fc79d4e3a4a781.asciidoc b/docs/examples/91cbeeda86b4e4e393fc79d4e3a4a781.asciidoc
new file mode 100644
index 000000000..80a5b15e9
--- /dev/null
+++ b/docs/examples/91cbeeda86b4e4e393fc79d4e3a4a781.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/sampler-aggregation.asciidoc:91
+
+[source, python]
+----
+resp = client.search(
+ index="stackoverflow",
+ size="0",
+ query={
+ "query_string": {
+ "query": "tags:kibana OR tags:javascript"
+ }
+ },
+ aggs={
+ "low_quality_keywords": {
+ "significant_terms": {
+ "field": "tags",
+ "size": 3,
+ "exclude": [
+ "kibana",
+ "javascript"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/91ed08faaed54cb5ace9a295af937439.asciidoc b/docs/examples/91ed08faaed54cb5ace9a295af937439.asciidoc
new file mode 100644
index 000000000..013ee1b75
--- /dev/null
+++ b/docs/examples/91ed08faaed54cb5ace9a295af937439.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations.asciidoc:337
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ size="0",
+ runtime_mappings={
+ "message.length": {
+ "type": "long",
+ "script": "emit(doc['message.keyword'].value.length())"
+ }
+ },
+ aggs={
+ "message_length": {
+ "histogram": {
+ "interval": 10,
+ "field": "message.length"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9200ed8d5f798a158def4c526e41269e.asciidoc b/docs/examples/9200ed8d5f798a158def4c526e41269e.asciidoc
new file mode 100644
index 000000000..935b9089d
--- /dev/null
+++ b/docs/examples/9200ed8d5f798a158def4c526e41269e.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// search/field-caps.asciidoc:186
+
+[source, python]
+----
+resp = client.field_caps(
+ index="my-index-000001",
+ fields="rating",
+)
+print(resp)
+----
diff --git a/docs/examples/92035a2a62d01a511662af65606d5fc6.asciidoc b/docs/examples/92035a2a62d01a511662af65606d5fc6.asciidoc
new file mode 100644
index 000000000..c9af06fce
--- /dev/null
+++ b/docs/examples/92035a2a62d01a511662af65606d5fc6.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/bucket-sort-aggregation.asciidoc:142
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "bucket_truncate": {
+ "bucket_sort": {
+ "from": 1,
+ "size": 1
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9216e8e544e6d193eda1f59e9160a225.asciidoc b/docs/examples/9216e8e544e6d193eda1f59e9160a225.asciidoc
new file mode 100644
index 000000000..70b0bd57c
--- /dev/null
+++ b/docs/examples/9216e8e544e6d193eda1f59e9160a225.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-near-query.asciidoc:12
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_near": {
+ "clauses": [
+ {
+ "span_term": {
+ "field": "value1"
+ }
+ },
+ {
+ "span_term": {
+ "field": "value2"
+ }
+ },
+ {
+ "span_term": {
+ "field": "value3"
+ }
+ }
+ ],
+ "slop": 12,
+ "in_order": False
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/922529276f87cb9d116be2468d108466.asciidoc b/docs/examples/922529276f87cb9d116be2468d108466.asciidoc
new file mode 100644
index 000000000..4928f8d2b
--- /dev/null
+++ b/docs/examples/922529276f87cb9d116be2468d108466.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/specify-analyzer.asciidoc:74
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "default": {
+ "type": "simple"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9225841fdcddaf83ebdb90c2b0399e20.asciidoc b/docs/examples/9225841fdcddaf83ebdb90c2b0399e20.asciidoc
index 13ca7d4e0..e2f8526f9 100644
--- a/docs/examples/9225841fdcddaf83ebdb90c2b0399e20.asciidoc
+++ b/docs/examples/9225841fdcddaf83ebdb90c2b0399e20.asciidoc
@@ -1,7 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/get-trained-models-stats.asciidoc:405
[source, python]
----
resp = client.ml.get_trained_models_stats()
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/92284d24bbb80ce6943f2ddcbf74b833.asciidoc b/docs/examples/92284d24bbb80ce6943f2ddcbf74b833.asciidoc
index d4b83876a..8fa8f7054 100644
--- a/docs/examples/92284d24bbb80ce6943f2ddcbf74b833.asciidoc
+++ b/docs/examples/92284d24bbb80ce6943f2ddcbf74b833.asciidoc
@@ -1,28 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/flattened.asciidoc:136
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {"flattened_field": {"type": "flattened"}}
+ mappings={
+ "properties": {
+ "flattened_field": {
+ "type": "flattened"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- refresh="true",
- body={"flattened_field": {"subfield": "value"}},
+ refresh=True,
+ document={
+ "flattened_field": {
+ "subfield": "value"
+ }
+ },
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
- body={"fields": ["flattened_field.subfield"], "_source": False},
+ fields=[
+ "flattened_field.subfield"
+ ],
+ source=False,
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/923aee95078219ee6eb321a252e1121b.asciidoc b/docs/examples/923aee95078219ee6eb321a252e1121b.asciidoc
new file mode 100644
index 000000000..704065a6c
--- /dev/null
+++ b/docs/examples/923aee95078219ee6eb321a252e1121b.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/ngram-tokenfilter.asciidoc:161
+
+[source, python]
+----
+resp = client.indices.create(
+ index="ngram_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_ngram": {
+ "tokenizer": "standard",
+ "filter": [
+ "ngram"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc b/docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc
index 8305fc94b..8eed56f99 100644
--- a/docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc
+++ b/docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:763
[source, python]
@@ -5,8 +6,11 @@
resp = client.index(
index="my-index-000001",
id="1",
- refresh="true",
- body={"text": "words words", "flag": "foo"},
+ refresh=True,
+ document={
+ "text": "words words",
+ "flag": "foo"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/9270964d35d172ea5b193c5fc7a473dd.asciidoc b/docs/examples/9270964d35d172ea5b193c5fc7a473dd.asciidoc
new file mode 100644
index 000000000..b95bb8eaa
--- /dev/null
+++ b/docs/examples/9270964d35d172ea5b193c5fc7a473dd.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/templates.asciidoc:61
+
+[source, python]
+----
+resp = client.cat.templates(
+ name="my-template-*",
+ v=True,
+ s="name",
+)
+print(resp)
+----
diff --git a/docs/examples/927b20a221f975b75d1227b67d0eb7e2.asciidoc b/docs/examples/927b20a221f975b75d1227b67d0eb7e2.asciidoc
new file mode 100644
index 000000000..5c64ffb1a
--- /dev/null
+++ b/docs/examples/927b20a221f975b75d1227b67d0eb7e2.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-rest.asciidoc:265
+
+[source, python]
+----
+resp = client.esql.query(
+ query="\n FROM library\n | EVAL year = DATE_EXTRACT(\"year\", release_date)\n | WHERE page_count > ? AND author == ?\n | STATS count = COUNT(*) by year\n | WHERE count > ?\n | LIMIT 5\n ",
+ params=[
+ 300,
+ "Frank Herbert",
+ 0
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/9298aaf8232a819e79b3bf8471245e98.asciidoc b/docs/examples/9298aaf8232a819e79b3bf8471245e98.asciidoc
new file mode 100644
index 000000000..5dc7235b5
--- /dev/null
+++ b/docs/examples/9298aaf8232a819e79b3bf8471245e98.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-job-stats.asciidoc:375
+
+[source, python]
+----
+resp = client.ml.get_job_stats(
+ job_id="low_request_rate",
+)
+print(resp)
+----
diff --git a/docs/examples/92d0c12d53a900308150d572c3f2f82f.asciidoc b/docs/examples/92d0c12d53a900308150d572c3f2f82f.asciidoc
index d06bc4dbb..a8b952bfc 100644
--- a/docs/examples/92d0c12d53a900308150d572c3f2f82f.asciidoc
+++ b/docs/examples/92d0c12d53a900308150d572c3f2f82f.asciidoc
@@ -1,21 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:477
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "strings_as_keywords": {
- "match_mapping_type": "string",
- "mapping": {"type": "keyword"},
+ mappings={
+ "dynamic_templates": [
+ {
+ "strings_as_keywords": {
+ "match_mapping_type": "string",
+ "mapping": {
+ "type": "keyword"
}
}
- ]
- }
+ }
+ ]
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/92d343eb755971c44a939d0660bf5ac2.asciidoc b/docs/examples/92d343eb755971c44a939d0660bf5ac2.asciidoc
new file mode 100644
index 000000000..9e85f5d47
--- /dev/null
+++ b/docs/examples/92d343eb755971c44a939d0660bf5ac2.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/refresh.asciidoc:87
+
+[source, python]
+----
+resp = client.index(
+ index="test",
+ id="1",
+ refresh=True,
+ document={
+ "test": "test"
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="test",
+ id="2",
+ refresh=True,
+ document={
+ "test": "test"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/92f073762634a4b2274f71002494192e.asciidoc b/docs/examples/92f073762634a4b2274f71002494192e.asciidoc
index 125263f38..72002f51c 100644
--- a/docs/examples/92f073762634a4b2274f71002494192e.asciidoc
+++ b/docs/examples/92f073762634a4b2274f71002494192e.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// setup/add-nodes.asciidoc:152
[source, python]
@@ -6,4 +7,4 @@ resp = client.cluster.state(
filter_path="metadata.cluster_coordination.voting_config_exclusions",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/92fa6608673cec5a2ed568a07e80d36b.asciidoc b/docs/examples/92fa6608673cec5a2ed568a07e80d36b.asciidoc
index ed121d8cc..a109e86cc 100644
--- a/docs/examples/92fa6608673cec5a2ed568a07e80d36b.asciidoc
+++ b/docs/examples/92fa6608673cec5a2ed568a07e80d36b.asciidoc
@@ -1,14 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1551
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "query": {
- "range": {"timestamp": {"gte": "2020-04-30T14:31:27-05:00"}}
+ query={
+ "range": {
+ "timestamp": {
+ "gte": "2020-04-30T14:31:27-05:00"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/92fe53019958ba466d1272da0834cf53.asciidoc b/docs/examples/92fe53019958ba466d1272da0834cf53.asciidoc
new file mode 100644
index 000000000..d7be84156
--- /dev/null
+++ b/docs/examples/92fe53019958ba466d1272da0834cf53.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/stats.asciidoc:11
+
+[source, python]
+----
+resp = client.indices.stats(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/930a3c5667e3bf47b4e8cc28e7bf8d5f.asciidoc b/docs/examples/930a3c5667e3bf47b4e8cc28e7bf8d5f.asciidoc
new file mode 100644
index 000000000..95950a60d
--- /dev/null
+++ b/docs/examples/930a3c5667e3bf47b4e8cc28e7bf8d5f.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/run-as-privilege.asciidoc:114
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="my_admin_role",
+ refresh=True,
+ cluster=[
+ "manage"
+ ],
+ indices=[
+ {
+ "names": [
+ "index1",
+ "index2"
+ ],
+ "privileges": [
+ "manage"
+ ]
+ }
+ ],
+ applications=[
+ {
+ "application": "myapp",
+ "privileges": [
+ "admin",
+ "read"
+ ],
+ "resources": [
+ "*"
+ ]
+ }
+ ],
+ run_as=[
+ "analyst_user"
+ ],
+ metadata={
+ "version": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/930ba37af73dd5ff0342ecfe6c60a4e9.asciidoc b/docs/examples/930ba37af73dd5ff0342ecfe6c60a4e9.asciidoc
new file mode 100644
index 000000000..6839790db
--- /dev/null
+++ b/docs/examples/930ba37af73dd5ff0342ecfe6c60a4e9.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/extendedstats-aggregation.asciidoc:14
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size=0,
+ aggs={
+ "grades_stats": {
+ "extended_stats": {
+ "field": "grade"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/931da02a06953a768f4ad3fecfd7b2df.asciidoc b/docs/examples/931da02a06953a768f4ad3fecfd7b2df.asciidoc
new file mode 100644
index 000000000..70992c6c8
--- /dev/null
+++ b/docs/examples/931da02a06953a768f4ad3fecfd7b2df.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/total-shards-per-node.asciidoc:147
+
+[source, python]
+----
+resp = client.indices.get_settings(
+ index="my-index-000001",
+ name="index.routing.allocation.total_shards_per_node",
+ flat_settings=True,
+)
+print(resp)
+----
diff --git a/docs/examples/9334ccd09548b585cd637d7c66c5ae65.asciidoc b/docs/examples/9334ccd09548b585cd637d7c66c5ae65.asciidoc
new file mode 100644
index 000000000..da22168af
--- /dev/null
+++ b/docs/examples/9334ccd09548b585cd637d7c66c5ae65.asciidoc
@@ -0,0 +1,49 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/filter-search-results.asciidoc:244
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "message": {
+ "operator": "or",
+ "query": "the quick brown"
+ }
+ }
+ },
+ rescore=[
+ {
+ "window_size": 100,
+ "query": {
+ "rescore_query": {
+ "match_phrase": {
+ "message": {
+ "query": "the quick brown",
+ "slop": 2
+ }
+ }
+ },
+ "query_weight": 0.7,
+ "rescore_query_weight": 1.2
+ }
+ },
+ {
+ "window_size": 10,
+ "query": {
+ "score_mode": "multiply",
+ "rescore_query": {
+ "function_score": {
+ "script_score": {
+ "script": {
+ "source": "Math.log10(doc.count.value + 2)"
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/93429d2bfbc0a9b7a4854b27e34658cf.asciidoc b/docs/examples/93429d2bfbc0a9b7a4854b27e34658cf.asciidoc
new file mode 100644
index 000000000..8190c0552
--- /dev/null
+++ b/docs/examples/93429d2bfbc0a9b7a4854b27e34658cf.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:23
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "message": {
+ "type": "text"
+ },
+ "query": {
+ "type": "percolator"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/93444b445446c1a6033347d6267253d6.asciidoc b/docs/examples/93444b445446c1a6033347d6267253d6.asciidoc
new file mode 100644
index 000000000..bfa0065fe
--- /dev/null
+++ b/docs/examples/93444b445446c1a6033347d6267253d6.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/match-phrase-prefix-query.asciidoc:22
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match_phrase_prefix": {
+ "message": {
+ "query": "quick brown f"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/934aa38c3adcc4cf74ea40cd8736876c.asciidoc b/docs/examples/934aa38c3adcc4cf74ea40cd8736876c.asciidoc
index 708e31a96..6516c85e6 100644
--- a/docs/examples/934aa38c3adcc4cf74ea40cd8736876c.asciidoc
+++ b/docs/examples/934aa38c3adcc4cf74ea40cd8736876c.asciidoc
@@ -1,13 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// indices/create-index.asciidoc:172
[source, python]
----
resp = client.indices.create(
index="test",
- body={
- "settings": {"number_of_shards": 1},
- "mappings": {"properties": {"field1": {"type": "text"}}},
+ settings={
+ "number_of_shards": 1
+ },
+ mappings={
+ "properties": {
+ "field1": {
+ "type": "text"
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/934ced0998552cc95a28e48554147e8b.asciidoc b/docs/examples/934ced0998552cc95a28e48554147e8b.asciidoc
new file mode 100644
index 000000000..42e4329e2
--- /dev/null
+++ b/docs/examples/934ced0998552cc95a28e48554147e8b.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:582
+
+[source, python]
+----
+resp = client.cluster.allocation_explain(
+ index="my-index",
+ shard=0,
+ primary=False,
+ current_node="my-node",
+)
+print(resp)
+----
diff --git a/docs/examples/935566d5426d44ade486a49ec5289741.asciidoc b/docs/examples/935566d5426d44ade486a49ec5289741.asciidoc
new file mode 100644
index 000000000..9b2c52446
--- /dev/null
+++ b/docs/examples/935566d5426d44ade486a49ec5289741.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-semantic-text.asciidoc:128
+
+[source, python]
+----
+resp = client.reindex(
+ wait_for_completion=False,
+ source={
+ "index": "test-data",
+ "size": 10
+ },
+ dest={
+ "index": "semantic-embeddings"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/935ee7c1b86ba9592604834bb673c7a3.asciidoc b/docs/examples/935ee7c1b86ba9592604834bb673c7a3.asciidoc
new file mode 100644
index 000000000..7b5b1de4e
--- /dev/null
+++ b/docs/examples/935ee7c1b86ba9592604834bb673c7a3.asciidoc
@@ -0,0 +1,93 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geotilegrid-aggregation.asciidoc:38
+
+[source, python]
+----
+resp = client.indices.create(
+ index="museums",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="museums",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "location": "POINT (4.912350 52.374081)",
+ "name": "NEMO Science Museum"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "location": "POINT (4.901618 52.369219)",
+ "name": "Museum Het Rembrandthuis"
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "location": "POINT (4.914722 52.371667)",
+ "name": "Nederlands Scheepvaartmuseum"
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "location": "POINT (4.405200 51.222900)",
+ "name": "Letterenhuis"
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "location": "POINT (2.336389 48.861111)",
+ "name": "Musée du Louvre"
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "location": "POINT (2.327000 48.860000)",
+ "name": "Musée d'Orsay"
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="museums",
+ size="0",
+ aggregations={
+ "large-grid": {
+ "geotile_grid": {
+ "field": "location",
+ "precision": 8
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/936d809c848f8b77d5b55f57f0aab89a.asciidoc b/docs/examples/936d809c848f8b77d5b55f57f0aab89a.asciidoc
index a8b4c5692..bb2d5e31d 100644
--- a/docs/examples/936d809c848f8b77d5b55f57f0aab89a.asciidoc
+++ b/docs/examples/936d809c848f8b77d5b55f57f0aab89a.asciidoc
@@ -1,17 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/field-mapping.asciidoc:81
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"date_detection": False}},
+ mappings={
+ "date_detection": False
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"create_date": "2015/09/02"},
+ document={
+ "create_date": "2015/09/02"
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/937089157fc82cf08b68a954d0e6d52c.asciidoc b/docs/examples/937089157fc82cf08b68a954d0e6d52c.asciidoc
new file mode 100644
index 000000000..d4e2b2590
--- /dev/null
+++ b/docs/examples/937089157fc82cf08b68a954d0e6d52c.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:240
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n sequence with maxspan=1h\n [ process where process.name == \"regsvr32.exe\" ]\n [ file where stringContains(file.name, \"scrobj.dll\") ]\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/9370e4935ab6678571d3227973b8c830.asciidoc b/docs/examples/9370e4935ab6678571d3227973b8c830.asciidoc
new file mode 100644
index 000000000..6489045ce
--- /dev/null
+++ b/docs/examples/9370e4935ab6678571d3227973b8c830.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:37
+
+[source, python]
+----
+resp = client.indices.get(
+ index="_all",
+ filter_path="*.aliases",
+)
+print(resp)
+----
diff --git a/docs/examples/937ffc65cbb20505a8aba25b37a796a5.asciidoc b/docs/examples/937ffc65cbb20505a8aba25b37a796a5.asciidoc
index 1f87d15a7..090b51c4f 100644
--- a/docs/examples/937ffc65cbb20505a8aba25b37a796a5.asciidoc
+++ b/docs/examples/937ffc65cbb20505a8aba25b37a796a5.asciidoc
@@ -1,26 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/boolean.asciidoc:22
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {"properties": {"is_published": {"type": "boolean"}}}
+ mappings={
+ "properties": {
+ "is_published": {
+ "type": "boolean"
+ }
+ }
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- refresh="true",
- body={"is_published": "true"},
+ refresh=True,
+ document={
+ "is_published": "true"
+ },
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
- body={"query": {"term": {"is_published": True}}},
+ query={
+ "term": {
+ "is_published": True
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/9382f022086c692ba05efb0acae65946.asciidoc b/docs/examples/9382f022086c692ba05efb0acae65946.asciidoc
new file mode 100644
index 000000000..e93dffce6
--- /dev/null
+++ b/docs/examples/9382f022086c692ba05efb0acae65946.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/synthetic-source.asciidoc:59
+
+[source, python]
+----
+resp = client.index(
+ index="idx",
+ id="1",
+ document={
+ "foo": [
+ {
+ "bar": 1
+ },
+ {
+ "bar": 2
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9399cbbd133ec2b7aad2820fa617ae3a.asciidoc b/docs/examples/9399cbbd133ec2b7aad2820fa617ae3a.asciidoc
new file mode 100644
index 000000000..1052a1869
--- /dev/null
+++ b/docs/examples/9399cbbd133ec2b7aad2820fa617ae3a.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/children-aggregation.asciidoc:16
+
+[source, python]
+----
+resp = client.indices.create(
+ index="child_example",
+ mappings={
+ "properties": {
+ "join": {
+ "type": "join",
+ "relations": {
+ "question": "answer"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/93bd651aff81daa2b86f9f2089e6d088.asciidoc b/docs/examples/93bd651aff81daa2b86f9f2089e6d088.asciidoc
index 972e6c1f9..ee64c9859 100644
--- a/docs/examples/93bd651aff81daa2b86f9f2089e6d088.asciidoc
+++ b/docs/examples/93bd651aff81daa2b86f9f2089e6d088.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/parent-join.asciidoc:49
[source, python]
@@ -5,24 +6,28 @@
resp = client.index(
index="my-index-000001",
id="1",
- refresh="true",
- body={
+ refresh=True,
+ document={
"my_id": "1",
"text": "This is a question",
- "my_join_field": {"name": "question"},
+ "my_join_field": {
+ "name": "question"
+ }
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="2",
- refresh="true",
- body={
+ refresh=True,
+ document={
"my_id": "2",
"text": "This is another question",
- "my_join_field": {"name": "question"},
+ "my_join_field": {
+ "name": "question"
+ }
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/93cd0fdd5ca22838db06aa1cabdbe8bd.asciidoc b/docs/examples/93cd0fdd5ca22838db06aa1cabdbe8bd.asciidoc
new file mode 100644
index 000000000..613da2de0
--- /dev/null
+++ b/docs/examples/93cd0fdd5ca22838db06aa1cabdbe8bd.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-search.asciidoc:139
+
+[source, python]
+----
+resp = client.search(
+ index="hugging-face-embeddings",
+ knn={
+ "field": "content_embedding",
+ "query_vector_builder": {
+ "text_embedding": {
+ "model_id": "hugging_face_embeddings",
+ "model_text": "What's margin of error?"
+ }
+ },
+ "k": 10,
+ "num_candidates": 100
+ },
+ source=[
+ "id",
+ "content"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/93d7ba4130722cae04f9690e52a8f54f.asciidoc b/docs/examples/93d7ba4130722cae04f9690e52a8f54f.asciidoc
index 394e79b58..036f1cff1 100644
--- a/docs/examples/93d7ba4130722cae04f9690e52a8f54f.asciidoc
+++ b/docs/examples/93d7ba4130722cae04f9690e52a8f54f.asciidoc
@@ -1,15 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:460
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "envelope",
- "coordinates": [[100, 1], [101, 0]],
+ "coordinates": [
+ [
+ 100,
+ 1
+ ],
+ [
+ 101,
+ 0
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/93fb59d3204f37af952198b331fb6bb7.asciidoc b/docs/examples/93fb59d3204f37af952198b331fb6bb7.asciidoc
new file mode 100644
index 000000000..93b46d640
--- /dev/null
+++ b/docs/examples/93fb59d3204f37af952198b331fb6bb7.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/tasks.asciidoc:217
+
+[source, python]
+----
+resp = client.tasks.get(
+ task_id="oTUltX4IQMOUUVeiohTt8A:12345",
+ wait_for_completion=True,
+ timeout="10s",
+)
+print(resp)
+----
diff --git a/docs/examples/9403764e6eccad7b321b65e9a10c5727.asciidoc b/docs/examples/9403764e6eccad7b321b65e9a10c5727.asciidoc
index eb8b302b3..a5e2631e9 100644
--- a/docs/examples/9403764e6eccad7b321b65e9a10c5727.asciidoc
+++ b/docs/examples/9403764e6eccad7b321b65e9a10c5727.asciidoc
@@ -1,19 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:543
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "tags": {
- "terms": {
- "field": "tags",
- "include": ".*sport.*",
- "exclude": "water_.*",
- }
+ aggs={
+ "tags": {
+ "terms": {
+ "field": "tags",
+ "include": ".*sport.*",
+ "exclude": "water_.*"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/940e8c2c7ff92d71f489bdb7183c1ce6.asciidoc b/docs/examples/940e8c2c7ff92d71f489bdb7183c1ce6.asciidoc
new file mode 100644
index 000000000..61efcb462
--- /dev/null
+++ b/docs/examples/940e8c2c7ff92d71f489bdb7183c1ce6.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/segments.asciidoc:110
+
+[source, python]
+----
+resp = client.indices.segments(
+ index="test",
+)
+print(resp)
+----
diff --git a/docs/examples/9410af79177dd1df9b7b16229a581e18.asciidoc b/docs/examples/9410af79177dd1df9b7b16229a581e18.asciidoc
new file mode 100644
index 000000000..e41d2fa89
--- /dev/null
+++ b/docs/examples/9410af79177dd1df9b7b16229a581e18.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/change-password.asciidoc:70
+
+[source, python]
+----
+resp = client.security.change_password(
+ username="jacknich",
+ password="new-test-password",
+)
+print(resp)
+----
diff --git a/docs/examples/941c8d05486200e835d97642e4ee05d5.asciidoc b/docs/examples/941c8d05486200e835d97642e4ee05d5.asciidoc
new file mode 100644
index 000000000..a43bd9f9b
--- /dev/null
+++ b/docs/examples/941c8d05486200e835d97642e4ee05d5.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/termvectors.asciidoc:177
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "text": {
+ "type": "text",
+ "term_vector": "with_positions_offsets_payloads",
+ "store": True,
+ "analyzer": "fulltext_analyzer"
+ },
+ "fullname": {
+ "type": "text",
+ "term_vector": "with_positions_offsets_payloads",
+ "analyzer": "fulltext_analyzer"
+ }
+ }
+ },
+ settings={
+ "index": {
+ "number_of_shards": 1,
+ "number_of_replicas": 0
+ },
+ "analysis": {
+ "analyzer": {
+ "fulltext_analyzer": {
+ "type": "custom",
+ "tokenizer": "whitespace",
+ "filter": [
+ "lowercase",
+ "type_as_payload"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/94246f45025ed394cd6415ed8d7a0588.asciidoc b/docs/examples/94246f45025ed394cd6415ed8d7a0588.asciidoc
new file mode 100644
index 000000000..e0925bba8
--- /dev/null
+++ b/docs/examples/94246f45025ed394cd6415ed8d7a0588.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/delete-job.asciidoc:79
+
+[source, python]
+----
+resp = client.rollup.delete_job(
+ id="sensor",
+)
+print(resp)
+----
diff --git a/docs/examples/944806221eb89f5af2298ccdf2902277.asciidoc b/docs/examples/944806221eb89f5af2298ccdf2902277.asciidoc
new file mode 100644
index 000000000..4fa39ab7e
--- /dev/null
+++ b/docs/examples/944806221eb89f5af2298ccdf2902277.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/rollup-caps.asciidoc:163
+
+[source, python]
+----
+resp = client.rollup.get_rollup_caps(
+ id="_all",
+)
+print(resp)
+----
diff --git a/docs/examples/944a2dc22dae2a8503299926326a9c18.asciidoc b/docs/examples/944a2dc22dae2a8503299926326a9c18.asciidoc
index 59f9a7d17..42e6aaa68 100644
--- a/docs/examples/944a2dc22dae2a8503299926326a9c18.asciidoc
+++ b/docs/examples/944a2dc22dae2a8503299926326a9c18.asciidoc
@@ -1,23 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/ip.asciidoc:11
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"ip_addr": {"type": "ip"}}}},
+ mappings={
+ "properties": {
+ "ip_addr": {
+ "type": "ip"
+ }
+ }
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"ip_addr": "192.168.1.1"},
+ document={
+ "ip_addr": "192.168.1.1"
+ },
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
- body={"query": {"term": {"ip_addr": "192.168.0.0/16"}}},
+ query={
+ "term": {
+ "ip_addr": "192.168.0.0/16"
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/946522c26d02bebf5c527ba28e55c724.asciidoc b/docs/examples/946522c26d02bebf5c527ba28e55c724.asciidoc
index 173ce7164..1ed6de0de 100644
--- a/docs/examples/946522c26d02bebf5c527ba28e55c724.asciidoc
+++ b/docs/examples/946522c26d02bebf5c527ba28e55c724.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:352
[source, python]
@@ -7,4 +8,4 @@ resp = client.update_by_query(
routing="1",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/9467e52087a13b63b02d78c35ff6f798.asciidoc b/docs/examples/9467e52087a13b63b02d78c35ff6f798.asciidoc
index 2f3d26a70..7cd0dd950 100644
--- a/docs/examples/9467e52087a13b63b02d78c35ff6f798.asciidoc
+++ b/docs/examples/9467e52087a13b63b02d78c35ff6f798.asciidoc
@@ -1,9 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/match-phrase-query.asciidoc:11
[source, python]
----
resp = client.search(
- body={"query": {"match_phrase": {"message": "this is a test"}}},
+ query={
+ "match_phrase": {
+ "message": "this is a test"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/94cd66bf93f99881c1bda547283a0357.asciidoc b/docs/examples/94cd66bf93f99881c1bda547283a0357.asciidoc
new file mode 100644
index 000000000..183d9fa66
--- /dev/null
+++ b/docs/examples/94cd66bf93f99881c1bda547283a0357.asciidoc
@@ -0,0 +1,49 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:306
+
+[source, python]
+----
+resp = client.bulk(
+ index="quantized-image-index",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "1"
+ }
+ },
+ {
+ "image-vector": [
+ 0.1,
+ -2
+ ],
+ "title": "moose family"
+ },
+ {
+ "index": {
+ "_id": "2"
+ }
+ },
+ {
+ "image-vector": [
+ 0.75,
+ -1
+ ],
+ "title": "alpine lake"
+ },
+ {
+ "index": {
+ "_id": "3"
+ }
+ },
+ {
+ "image-vector": [
+ 1.2,
+ 0.1
+ ],
+ "title": "full moon"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/9501e6c8e95c21838653ea15b9b7ed5f.asciidoc b/docs/examples/9501e6c8e95c21838653ea15b9b7ed5f.asciidoc
new file mode 100644
index 000000000..1971c9b0d
--- /dev/null
+++ b/docs/examples/9501e6c8e95c21838653ea15b9b7ed5f.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:791
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "term": {
+ "query.extraction_result": "failed"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/950f1230536422567f99a205ff4165ec.asciidoc b/docs/examples/950f1230536422567f99a205ff4165ec.asciidoc
new file mode 100644
index 000000000..9c6457477
--- /dev/null
+++ b/docs/examples/950f1230536422567f99a205ff4165ec.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/rollover-index.asciidoc:399
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="my-write-alias",
+ conditions={
+ "max_age": "7d",
+ "max_docs": 1000,
+ "max_primary_shard_size": "50gb",
+ "max_primary_shard_docs": "2000"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/95414139c7b1203e3c2d99a354415801.asciidoc b/docs/examples/95414139c7b1203e3c2d99a354415801.asciidoc
new file mode 100644
index 000000000..711c56dca
--- /dev/null
+++ b/docs/examples/95414139c7b1203e3c2d99a354415801.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/recovery.asciidoc:84
+
+[source, python]
+----
+resp = client.cat.recovery(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/9559de0c2190f99fcc344887fc7b232a.asciidoc b/docs/examples/9559de0c2190f99fcc344887fc7b232a.asciidoc
new file mode 100644
index 000000000..048bba19f
--- /dev/null
+++ b/docs/examples/9559de0c2190f99fcc344887fc7b232a.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:480
+
+[source, python]
+----
+resp = client.indices.create(
+ index="bicycles",
+ mappings={
+ "properties": {
+ "cycle_type": {
+ "type": "constant_keyword",
+ "value": "bicycle"
+ },
+ "name": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.create(
+ index="other_cycles",
+ mappings={
+ "properties": {
+ "cycle_type": {
+ "type": "keyword"
+ },
+ "name": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/956cb470258024af964cd2dabbaf7c7c.asciidoc b/docs/examples/956cb470258024af964cd2dabbaf7c7c.asciidoc
new file mode 100644
index 000000000..db9cc8cd9
--- /dev/null
+++ b/docs/examples/956cb470258024af964cd2dabbaf7c7c.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// data-management/migrate-index-allocation-filters.asciidoc:220
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my-index",
+ settings={
+ "index.routing.allocation.require.data": None,
+ "index.routing.allocation.include._tier_preference": "data_warm,data_hot"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/957d2e6ddbb9a9b16549c5e67b93b41b.asciidoc b/docs/examples/957d2e6ddbb9a9b16549c5e67b93b41b.asciidoc
index 14527760a..4b88d0aa8 100644
--- a/docs/examples/957d2e6ddbb9a9b16549c5e67b93b41b.asciidoc
+++ b/docs/examples/957d2e6ddbb9a9b16549c5e67b93b41b.asciidoc
@@ -1,16 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:267
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {
- "fields": ["content", "name"],
- "query": "this AND that",
- }
+ query={
+ "query_string": {
+ "fields": [
+ "content",
+ "name"
+ ],
+ "query": "this AND that"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/9584b042223982e0bfde8d12d42c9705.asciidoc b/docs/examples/9584b042223982e0bfde8d12d42c9705.asciidoc
new file mode 100644
index 000000000..028f23b35
--- /dev/null
+++ b/docs/examples/9584b042223982e0bfde8d12d42c9705.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/configuring-kerberos-realm.asciidoc:179
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="kerbrolemapping",
+ roles=[
+ "monitoring_user"
+ ],
+ enabled=True,
+ rules={
+ "field": {
+ "username": "user@REALM"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/95b3f53f2065737bbeba6199e8a12df3.asciidoc b/docs/examples/95b3f53f2065737bbeba6199e8a12df3.asciidoc
index ae6c833a4..55aa444f2 100644
--- a/docs/examples/95b3f53f2065737bbeba6199e8a12df3.asciidoc
+++ b/docs/examples/95b3f53f2065737bbeba6199e8a12df3.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/terms-query.asciidoc:152
[source, python]
@@ -5,7 +6,12 @@
resp = client.index(
index="my-index-000001",
id="1",
- body={"color": ["blue", "green"]},
+ document={
+ "color": [
+ "blue",
+ "green"
+ ]
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/95c03bdef4faf6bef039c986f4cb3aba.asciidoc b/docs/examples/95c03bdef4faf6bef039c986f4cb3aba.asciidoc
new file mode 100644
index 000000000..4a5066887
--- /dev/null
+++ b/docs/examples/95c03bdef4faf6bef039c986f4cb3aba.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/example-watches/example-watch-clusterstatus.asciidoc:259
+
+[source, python]
+----
+resp = client.search(
+ index=".watcher-history*",
+ pretty=True,
+ query={
+ "match": {
+ "result.condition.met": True
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/95c1b376652533c352bbf793c74d1b08.asciidoc b/docs/examples/95c1b376652533c352bbf793c74d1b08.asciidoc
new file mode 100644
index 000000000..386ee81d0
--- /dev/null
+++ b/docs/examples/95c1b376652533c352bbf793c74d1b08.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-role.asciidoc:227
+
+[source, python]
+----
+resp = client.security.query_role(
+ query={
+ "match": {
+ "description": {
+ "query": "user access"
+ }
+ }
+ },
+ size=1,
+)
+print(resp)
+----
diff --git a/docs/examples/9606c271921cb800d5ea395b16d6ceaf.asciidoc b/docs/examples/9606c271921cb800d5ea395b16d6ceaf.asciidoc
new file mode 100644
index 000000000..c08841c42
--- /dev/null
+++ b/docs/examples/9606c271921cb800d5ea395b16d6ceaf.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:843
+
+[source, python]
+----
+resp = client.indices.create(
+ index="galician_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "galician_stop": {
+ "type": "stop",
+ "stopwords": "_galician_"
+ },
+ "galician_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "exemplo"
+ ]
+ },
+ "galician_stemmer": {
+ "type": "stemmer",
+ "language": "galician"
+ }
+ },
+ "analyzer": {
+ "rebuilt_galician": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "galician_stop",
+ "galician_keywords",
+ "galician_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9608820dbeac261ba53fb89bb9400560.asciidoc b/docs/examples/9608820dbeac261ba53fb89bb9400560.asciidoc
new file mode 100644
index 000000000..2f6de15c4
--- /dev/null
+++ b/docs/examples/9608820dbeac261ba53fb89bb9400560.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:233
+
+[source, python]
+----
+resp = client.security.get_api_key(
+ owner=True,
+)
+print(resp)
+----
diff --git a/docs/examples/962e6187bbd71c5749376efed04b65ba.asciidoc b/docs/examples/962e6187bbd71c5749376efed04b65ba.asciidoc
new file mode 100644
index 000000000..60b98cf19
--- /dev/null
+++ b/docs/examples/962e6187bbd71c5749376efed04b65ba.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/field-level-security.asciidoc:142
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="test_role6",
+ indices=[
+ {
+ "names": [
+ "*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "field_security": {
+ "except": [
+ "customer.handle"
+ ],
+ "grant": [
+ "customer.*"
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/966ff3a4c5b61ed1a36d44c17ce06157.asciidoc b/docs/examples/966ff3a4c5b61ed1a36d44c17ce06157.asciidoc
new file mode 100644
index 000000000..d58f5d111
--- /dev/null
+++ b/docs/examples/966ff3a4c5b61ed1a36d44c17ce06157.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/normalizers.asciidoc:27
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index",
+ settings={
+ "analysis": {
+ "char_filter": {
+ "quote": {
+ "type": "mapping",
+ "mappings": [
+ "« => \"",
+ "» => \""
+ ]
+ }
+ },
+ "normalizer": {
+ "my_normalizer": {
+ "type": "custom",
+ "char_filter": [
+ "quote"
+ ],
+ "filter": [
+ "lowercase",
+ "asciifolding"
+ ]
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "foo": {
+ "type": "keyword",
+ "normalizer": "my_normalizer"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9684e5fa8c22a07a372feb6fc1f5f7c0.asciidoc b/docs/examples/9684e5fa8c22a07a372feb6fc1f5f7c0.asciidoc
new file mode 100644
index 000000000..50f6c76d4
--- /dev/null
+++ b/docs/examples/9684e5fa8c22a07a372feb6fc1f5f7c0.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/has-privileges.asciidoc:69
+
+[source, python]
+----
+resp = client.security.has_privileges(
+ cluster=[
+ "monitor",
+ "manage"
+ ],
+ index=[
+ {
+ "names": [
+ "suppliers",
+ "products"
+ ],
+ "privileges": [
+ "read"
+ ]
+ },
+ {
+ "names": [
+ "inventory"
+ ],
+ "privileges": [
+ "read",
+ "write"
+ ]
+ }
+ ],
+ application=[
+ {
+ "application": "inventory_manager",
+ "privileges": [
+ "read",
+ "data:write/inventory"
+ ],
+ "resources": [
+ "product/1852563"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/96b9289c3c4c6b135ab3386562c4ee8d.asciidoc b/docs/examples/96b9289c3c4c6b135ab3386562c4ee8d.asciidoc
new file mode 100644
index 000000000..dff19e07a
--- /dev/null
+++ b/docs/examples/96b9289c3c4c6b135ab3386562c4ee8d.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/troubleshooting-shards-capacity.asciidoc:174
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.max_shards_per_node": 1200
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/96e137e42d12c180e2c702db30714a9e.asciidoc b/docs/examples/96e137e42d12c180e2c702db30714a9e.asciidoc
index 683ab3f8b..216520e1d 100644
--- a/docs/examples/96e137e42d12c180e2c702db30714a9e.asciidoc
+++ b/docs/examples/96e137e42d12c180e2c702db30714a9e.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/text.asciidoc:39
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"full_name": {"type": "text"}}}},
+ mappings={
+ "properties": {
+ "full_name": {
+ "type": "text"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/96ea0e80323d6d2d99964625c004a44d.asciidoc b/docs/examples/96ea0e80323d6d2d99964625c004a44d.asciidoc
new file mode 100644
index 000000000..5d103b1e2
--- /dev/null
+++ b/docs/examples/96ea0e80323d6d2d99964625c004a44d.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-migrate-data-stream-from-ilm-to-dsl.asciidoc:390
+
+[source, python]
+----
+resp = client.indices.put_data_lifecycle(
+ name="dsl-data-stream",
+ data_retention="7d",
+ enabled=False,
+)
+print(resp)
+----
diff --git a/docs/examples/971c7a36ee79f2b3aa82c64ea338de70.asciidoc b/docs/examples/971c7a36ee79f2b3aa82c64ea338de70.asciidoc
new file mode 100644
index 000000000..916f90693
--- /dev/null
+++ b/docs/examples/971c7a36ee79f2b3aa82c64ea338de70.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:345
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index",
+ mappings={
+ "properties": {
+ "foo": {
+ "type": "keyword",
+ "eager_global_ordinals": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/973a3ff47fc4ce036ecd9bd363fef9f7.asciidoc b/docs/examples/973a3ff47fc4ce036ecd9bd363fef9f7.asciidoc
index 2031deff1..635584804 100644
--- a/docs/examples/973a3ff47fc4ce036ecd9bd363fef9f7.asciidoc
+++ b/docs/examples/973a3ff47fc4ce036ecd9bd363fef9f7.asciidoc
@@ -1,16 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:843
[source, python]
----
resp = client.reindex(
- body={
- "source": {"index": "metricbeat-*"},
- "dest": {"index": "metricbeat"},
- "script": {
- "lang": "painless",
- "source": "ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'",
- },
+ source={
+ "index": "metricbeat-*"
+ },
+ dest={
+ "index": "metricbeat"
+ },
+ script={
+ "lang": "painless",
+ "source": "ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/975b4b92464d52068516aa2f0f955cc1.asciidoc b/docs/examples/975b4b92464d52068516aa2f0f955cc1.asciidoc
new file mode 100644
index 000000000..322e7aacd
--- /dev/null
+++ b/docs/examples/975b4b92464d52068516aa2f0f955cc1.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/segments.asciidoc:119
+
+[source, python]
+----
+resp = client.indices.segments(
+ index="test1,test2",
+)
+print(resp)
+----
diff --git a/docs/examples/976e5f9baf81bd6ca0e9f80916a0a4f9.asciidoc b/docs/examples/976e5f9baf81bd6ca0e9f80916a0a4f9.asciidoc
new file mode 100644
index 000000000..c915d1100
--- /dev/null
+++ b/docs/examples/976e5f9baf81bd6ca0e9f80916a0a4f9.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/field-level-security.asciidoc:18
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="test_role1",
+ indices=[
+ {
+ "names": [
+ "events-*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "field_security": {
+ "grant": [
+ "category",
+ "@timestamp",
+ "message"
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/97916243f245478b735471a9e37f33d1.asciidoc b/docs/examples/97916243f245478b735471a9e37f33d1.asciidoc
new file mode 100644
index 000000000..bfc5e44b8
--- /dev/null
+++ b/docs/examples/97916243f245478b735471a9e37f33d1.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/iprange-aggregation.asciidoc:12
+
+[source, python]
+----
+resp = client.search(
+ index="ip_addresses",
+ size=10,
+ aggs={
+ "ip_ranges": {
+ "ip_range": {
+ "field": "ip",
+ "ranges": [
+ {
+ "to": "10.0.0.5"
+ },
+ {
+ "from": "10.0.0.5"
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/97a3216af3d4b4d805d467d9c715cb3e.asciidoc b/docs/examples/97a3216af3d4b4d805d467d9c715cb3e.asciidoc
new file mode 100644
index 000000000..efa54ac9f
--- /dev/null
+++ b/docs/examples/97a3216af3d4b4d805d467d9c715cb3e.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/get-desired-balance.asciidoc:21
+
+[source, python]
+----
+resp = client.perform_request(
+ "GET",
+ "/_internal/desired_balance",
+)
+print(resp)
+----
diff --git a/docs/examples/97ae2b62aa372a955278be6f660356ba.asciidoc b/docs/examples/97ae2b62aa372a955278be6f660356ba.asciidoc
new file mode 100644
index 000000000..79c984b5b
--- /dev/null
+++ b/docs/examples/97ae2b62aa372a955278be6f660356ba.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/combined-fields-query.asciidoc:57
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "combined_fields": {
+ "query": "distributed consensus",
+ "fields": [
+ "title^2",
+ "body"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/97babc8d19ef0866774576716eb6d19e.asciidoc b/docs/examples/97babc8d19ef0866774576716eb6d19e.asciidoc
index ca02b620d..f950aedd0 100644
--- a/docs/examples/97babc8d19ef0866774576716eb6d19e.asciidoc
+++ b/docs/examples/97babc8d19ef0866774576716eb6d19e.asciidoc
@@ -1,18 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:775
[source, python]
----
resp = client.update_by_query(
index="test",
- refresh="true",
+ refresh=True,
conflicts="proceed",
)
print(resp)
-resp = client.search(
+resp1 = client.search(
index="test",
filter_path="hits.total",
- body={"query": {"match": {"flag": "foo"}}},
+ query={
+ "match": {
+ "flag": "foo"
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/97da68c09c9f1a97a21780fd404e213a.asciidoc b/docs/examples/97da68c09c9f1a97a21780fd404e213a.asciidoc
new file mode 100644
index 000000000..94bcc86e2
--- /dev/null
+++ b/docs/examples/97da68c09c9f1a97a21780fd404e213a.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/ipprefix-aggregation.asciidoc:279
+
+[source, python]
+----
+resp = client.search(
+ index="network-traffic",
+ size=0,
+ aggs={
+ "ipv4-subnets": {
+ "ip_prefix": {
+ "field": "ipv4",
+ "prefix_length": 24,
+ "append_prefix_length": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/97ea5ab17213cb1faaf6f3ea13607098.asciidoc b/docs/examples/97ea5ab17213cb1faaf6f3ea13607098.asciidoc
new file mode 100644
index 000000000..7d382579c
--- /dev/null
+++ b/docs/examples/97ea5ab17213cb1faaf6f3ea13607098.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/start.asciidoc:43
+
+[source, python]
+----
+resp = client.watcher.start()
+print(resp)
+----
diff --git a/docs/examples/97f260817b60f3deb7f7034d7dee7e12.asciidoc b/docs/examples/97f260817b60f3deb7f7034d7dee7e12.asciidoc
index 5ba883ba4..09cf33165 100644
--- a/docs/examples/97f260817b60f3deb7f7034d7dee7e12.asciidoc
+++ b/docs/examples/97f260817b60f3deb7f7034d7dee7e12.asciidoc
@@ -1,35 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/aggregate-metric-double.asciidoc:267
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {
- "agg_metric": {
- "type": "aggregate_metric_double",
- "metrics": ["min", "max", "sum", "value_count"],
- "default_metric": "max",
- }
- },
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "agg_metric": {
+ "type": "aggregate_metric_double",
+ "metrics": [
+ "min",
+ "max",
+ "sum",
+ "value_count"
+ ],
+ "default_metric": "max"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={
+ document={
"agg_metric": {
"min": -302.5,
"max": 702.3,
"sum": 200,
- "value_count": 25,
+ "value_count": 25
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/97f5df84efec655f479fad78bc392d4d.asciidoc b/docs/examples/97f5df84efec655f479fad78bc392d4d.asciidoc
new file mode 100644
index 000000000..0caa87fcd
--- /dev/null
+++ b/docs/examples/97f5df84efec655f479fad78bc392d4d.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// search/profile.asciidoc:830
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ profile=True,
+ query={
+ "term": {
+ "user.id": {
+ "value": "elkbee"
+ }
+ }
+ },
+ aggs={
+ "my_scoped_agg": {
+ "terms": {
+ "field": "http.response.status_code"
+ }
+ },
+ "my_global_agg": {
+ "global": {},
+ "aggs": {
+ "my_level_agg": {
+ "terms": {
+ "field": "http.response.status_code"
+ }
+ }
+ }
+ }
+ },
+ post_filter={
+ "match": {
+ "message": "search"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/981b331db1404b39c1a612a135e4e76d.asciidoc b/docs/examples/981b331db1404b39c1a612a135e4e76d.asciidoc
new file mode 100644
index 000000000..6f3574e63
--- /dev/null
+++ b/docs/examples/981b331db1404b39c1a612a135e4e76d.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/put-geoip-database.asciidoc:15
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_ingest/geoip/database/my-database-id",
+ headers={"Content-Type": "application/json"},
+ body={
+ "name": "GeoIP2-Domain",
+ "maxmind": {
+ "account_id": "1025402"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/983a867c90e63e070518f2f709f659ee.asciidoc b/docs/examples/983a867c90e63e070518f2f709f659ee.asciidoc
new file mode 100644
index 000000000..23a1b1dd5
--- /dev/null
+++ b/docs/examples/983a867c90e63e070518f2f709f659ee.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/types/wildcard.asciidoc:141
+
+[source, python]
+----
+resp = client.indices.create(
+ index="idx",
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "card": {
+ "type": "wildcard"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="idx",
+ id="1",
+ document={
+ "card": [
+ "king",
+ "ace",
+ "ace",
+ "jack"
+ ]
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/983fbb78e57e8fe98db38cf2d217e943.asciidoc b/docs/examples/983fbb78e57e8fe98db38cf2d217e943.asciidoc
new file mode 100644
index 000000000..374f36af5
--- /dev/null
+++ b/docs/examples/983fbb78e57e8fe98db38cf2d217e943.asciidoc
@@ -0,0 +1,58 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-inner-hits.asciidoc:212
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test",
+ mappings={
+ "properties": {
+ "comments": {
+ "type": "nested"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="test",
+ id="1",
+ refresh=True,
+ document={
+ "title": "Test title",
+ "comments": [
+ {
+ "author": "kimchy",
+ "text": "comment text"
+ },
+ {
+ "author": "nik9000",
+ "text": "words words words"
+ }
+ ]
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="test",
+ query={
+ "nested": {
+ "path": "comments",
+ "query": {
+ "match": {
+ "comments.text": "words"
+ }
+ },
+ "inner_hits": {
+ "_source": False,
+ "docvalue_fields": [
+ "comments.text.keyword"
+ ]
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/9851f5225150bc032fb3b195cd447f4f.asciidoc b/docs/examples/9851f5225150bc032fb3b195cd447f4f.asciidoc
new file mode 100644
index 000000000..7d3273570
--- /dev/null
+++ b/docs/examples/9851f5225150bc032fb3b195cd447f4f.asciidoc
@@ -0,0 +1,49 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:213
+
+[source, python]
+----
+resp = client.bulk(
+ index="byte-image-index",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "1"
+ }
+ },
+ {
+ "byte-image-vector": [
+ 5,
+ -20
+ ],
+ "title": "moose family"
+ },
+ {
+ "index": {
+ "_id": "2"
+ }
+ },
+ {
+ "byte-image-vector": [
+ 8,
+ -15
+ ],
+ "title": "alpine lake"
+ },
+ {
+ "index": {
+ "_id": "3"
+ }
+ },
+ {
+ "byte-image-vector": [
+ 11,
+ 23
+ ],
+ "title": "full moon"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/98574a419b6be603a0af8f7f22a92d23.asciidoc b/docs/examples/98574a419b6be603a0af8f7f22a92d23.asciidoc
new file mode 100644
index 000000000..075024d36
--- /dev/null
+++ b/docs/examples/98574a419b6be603a0af8f7f22a92d23.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/grok.asciidoc:258
+
+[source, python]
+----
+resp = client.ingest.processor_grok()
+print(resp)
+----
diff --git a/docs/examples/98621bea4765b1b838cc9daa914bf5c5.asciidoc b/docs/examples/98621bea4765b1b838cc9daa914bf5c5.asciidoc
new file mode 100644
index 000000000..cd31a4715
--- /dev/null
+++ b/docs/examples/98621bea4765b1b838cc9daa914bf5c5.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:340
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n sequence with maxspan=1h\n [ process where process.name == \"regsvr32.exe\" ] by process.pid\n [ file where stringContains(file.name, \"scrobj.dll\") ] by process.pid\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/98855f4bda8726d5d123aeebf7869e47.asciidoc b/docs/examples/98855f4bda8726d5d123aeebf7869e47.asciidoc
new file mode 100644
index 000000000..87e68355f
--- /dev/null
+++ b/docs/examples/98855f4bda8726d5d123aeebf7869e47.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/nodeattrs.asciidoc:82
+
+[source, python]
+----
+resp = client.cat.nodeattrs(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/9887f65af249bbf09190b1153ea2597b.asciidoc b/docs/examples/9887f65af249bbf09190b1153ea2597b.asciidoc
new file mode 100644
index 000000000..7024aa6dc
--- /dev/null
+++ b/docs/examples/9887f65af249bbf09190b1153ea2597b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:615
+
+[source, python]
+----
+resp = client.sql.get_async_status(
+ id="FnR0TDhyWUVmUmVtWXRWZER4MXZiNFEad2F5UDk2ZVdTVHV1S0xDUy00SklUdzozMTU=",
+)
+print(resp)
+----
diff --git a/docs/examples/98b403c356a9b14544e9b9f646845e9f.asciidoc b/docs/examples/98b403c356a9b14544e9b9f646845e9f.asciidoc
new file mode 100644
index 000000000..4751fd24c
--- /dev/null
+++ b/docs/examples/98b403c356a9b14544e9b9f646845e9f.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:848
+
+[source, python]
+----
+resp = client.put_script(
+ id="my-search-template",
+ script={
+ "lang": "mustache",
+ "source": {
+ "query": {
+ "multi_match": {
+ "query": "{{query_string}}",
+ "fields": "[{{#text_fields}}{{user_name}}{{^last}},{{/last}}{{/text_fields}}]"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/98c1080d8630d3a18d564312300d020f.asciidoc b/docs/examples/98c1080d8630d3a18d564312300d020f.asciidoc
new file mode 100644
index 000000000..33341ebbc
--- /dev/null
+++ b/docs/examples/98c1080d8630d3a18d564312300d020f.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/network-direction.asciidoc:66
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "processors": [
+ {
+ "network_direction": {
+ "internal_networks": [
+ "private"
+ ]
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_source": {
+ "source": {
+ "ip": "128.232.110.120"
+ },
+ "destination": {
+ "ip": "192.168.1.1"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/98f43710cedd28a464e8abf4b09bcc9a.asciidoc b/docs/examples/98f43710cedd28a464e8abf4b09bcc9a.asciidoc
new file mode 100644
index 000000000..0b1de885d
--- /dev/null
+++ b/docs/examples/98f43710cedd28a464e8abf4b09bcc9a.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations.asciidoc:95
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "range": {
+ "@timestamp": {
+ "gte": "now-1d/d",
+ "lt": "now/d"
+ }
+ }
+ },
+ aggs={
+ "my-agg-name": {
+ "terms": {
+ "field": "my-field"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/98f7525ec0bc8945eafa008a5a9c50c0.asciidoc b/docs/examples/98f7525ec0bc8945eafa008a5a9c50c0.asciidoc
new file mode 100644
index 000000000..96d9ec3b6
--- /dev/null
+++ b/docs/examples/98f7525ec0bc8945eafa008a5a9c50c0.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1253
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ wait_for_completion_timeout="2s",
+ query="\n process where process.name == \"cmd.exe\"\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/990c0d794ed6f05d1620b5d49f7aff6e.asciidoc b/docs/examples/990c0d794ed6f05d1620b5d49f7aff6e.asciidoc
new file mode 100644
index 000000000..ffed5b57c
--- /dev/null
+++ b/docs/examples/990c0d794ed6f05d1620b5d49f7aff6e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-manage-new-data-stream.asciidoc:82
+
+[source, python]
+----
+resp = client.indices.get_data_lifecycle(
+ name="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/99160b7c3c3fc1fac98aeb426dbcb3cb.asciidoc b/docs/examples/99160b7c3c3fc1fac98aeb426dbcb3cb.asciidoc
new file mode 100644
index 000000000..f50ea9075
--- /dev/null
+++ b/docs/examples/99160b7c3c3fc1fac98aeb426dbcb3cb.asciidoc
@@ -0,0 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/fields.asciidoc:171
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "first_name": {
+ "type": "text"
+ },
+ "last_name": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "first_name": "Barry",
+ "last_name": "White"
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ script_fields={
+ "full_name": {
+ "script": {
+ "lang": "painless",
+ "source": "params._source.first_name + ' ' + params._source.last_name"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/991b9ba53f0eccec8ec5a42f8d9b655c.asciidoc b/docs/examples/991b9ba53f0eccec8ec5a42f8d9b655c.asciidoc
new file mode 100644
index 000000000..4129bbe4c
--- /dev/null
+++ b/docs/examples/991b9ba53f0eccec8ec5a42f8d9b655c.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:616
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ highlight={
+ "fields": {
+ "body": {},
+ "blog.title": {
+ "number_of_fragments": 0
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/99474a7e7979816c874aeac4403be5d0.asciidoc b/docs/examples/99474a7e7979816c874aeac4403be5d0.asciidoc
new file mode 100644
index 000000000..3e208948c
--- /dev/null
+++ b/docs/examples/99474a7e7979816c874aeac4403be5d0.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/rate-aggregation.asciidoc:104
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "by_date": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "avg_price": {
+ "rate": {
+ "field": "price",
+ "unit": "day"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/996521cef7803ef363a49ac6321ea1de.asciidoc b/docs/examples/996521cef7803ef363a49ac6321ea1de.asciidoc
new file mode 100644
index 000000000..50dba0304
--- /dev/null
+++ b/docs/examples/996521cef7803ef363a49ac6321ea1de.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:256
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n sequence with maxspan=1d\n [ process where process.name == \"cmd.exe\" ]\n ![ process where stringContains(process.command_line, \"ocx\") ]\n [ file where stringContains(file.name, \"scrobj.dll\") ]\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/996f320a0f537c24b9cd0d71b5f7c1f8.asciidoc b/docs/examples/996f320a0f537c24b9cd0d71b5f7c1f8.asciidoc
index 5673e5a70..81b0d75d3 100644
--- a/docs/examples/996f320a0f537c24b9cd0d71b5f7c1f8.asciidoc
+++ b/docs/examples/996f320a0f537c24b9cd0d71b5f7c1f8.asciidoc
@@ -1,21 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/function-score-query.asciidoc:175
[source, python]
----
resp = client.search(
- body={
- "query": {
- "function_score": {
- "query": {"match": {"message": "elasticsearch"}},
- "script_score": {
- "script": {
- "params": {"a": 5, "b": 1.2},
- "source": "params.a / Math.pow(params.b, doc['my-int'].value)",
- }
- },
+ query={
+ "function_score": {
+ "query": {
+ "match": {
+ "message": "elasticsearch"
+ }
+ },
+ "script_score": {
+ "script": {
+ "params": {
+ "a": 5,
+ "b": 1.2
+ },
+ "source": "params.a / Math.pow(params.b, doc['my-int'].value)"
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/99803d7b111b862c0c82e9908e549b16.asciidoc b/docs/examples/99803d7b111b862c0c82e9908e549b16.asciidoc
new file mode 100644
index 000000000..ceee23cce
--- /dev/null
+++ b/docs/examples/99803d7b111b862c0c82e9908e549b16.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-mistral.asciidoc:87
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="mistral-embeddings-test",
+ inference_config={
+ "service": "mistral",
+ "service_settings": {
+ "api_key": "",
+ "model": "mistral-embed"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/998651b98e152add530084a631a4ab5a.asciidoc b/docs/examples/998651b98e152add530084a631a4ab5a.asciidoc
new file mode 100644
index 000000000..c1d9e08ed
--- /dev/null
+++ b/docs/examples/998651b98e152add530084a631a4ab5a.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:528
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "indices.lifecycle.poll_interval": "1m"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/99a56f423df3a0e57b7f20146f0d33b5.asciidoc b/docs/examples/99a56f423df3a0e57b7f20146f0d33b5.asciidoc
new file mode 100644
index 000000000..c99effe65
--- /dev/null
+++ b/docs/examples/99a56f423df3a0e57b7f20146f0d33b5.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/types/match-only-text.asciidoc:26
+
+[source, python]
+----
+resp = client.indices.create(
+ index="logs",
+ mappings={
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ },
+ "message": {
+ "type": "match_only_text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/99b617a0a83fcfbe5755ccc724a4ce62.asciidoc b/docs/examples/99b617a0a83fcfbe5755ccc724a4ce62.asciidoc
new file mode 100644
index 000000000..ee01d2790
--- /dev/null
+++ b/docs/examples/99b617a0a83fcfbe5755ccc724a4ce62.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/context-suggest.asciidoc:118
+
+[source, python]
+----
+resp = client.index(
+ index="place_path_category",
+ id="1",
+ document={
+ "suggest": [
+ "timmy's",
+ "starbucks",
+ "dunkin donuts"
+ ],
+ "cat": [
+ "cafe",
+ "food"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/99c1cfe60f3ccf5bf3abd24c31ed9034.asciidoc b/docs/examples/99c1cfe60f3ccf5bf3abd24c31ed9034.asciidoc
new file mode 100644
index 000000000..a3bf61263
--- /dev/null
+++ b/docs/examples/99c1cfe60f3ccf5bf3abd24c31ed9034.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/auto-follow/put-auto-follow-pattern.asciidoc:14
+
+[source, python]
+----
+resp = client.ccr.put_auto_follow_pattern(
+ name="",
+ remote_cluster="",
+ leader_index_patterns=[
+ ""
+ ],
+ leader_index_exclusion_patterns=[
+ ""
+ ],
+ follow_index_pattern="",
+)
+print(resp)
+----
diff --git a/docs/examples/9a02bd47c000a3d9a8911233c37c890f.asciidoc b/docs/examples/9a02bd47c000a3d9a8911233c37c890f.asciidoc
index 964f05758..b40ebbc7f 100644
--- a/docs/examples/9a02bd47c000a3d9a8911233c37c890f.asciidoc
+++ b/docs/examples/9a02bd47c000a3d9a8911233c37c890f.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:367
[source, python]
@@ -5,32 +6,34 @@
resp = client.index(
index="my-index-000001",
id="1",
- refresh="true",
- body={"date": "2015-10-01T00:30:00Z"},
+ refresh=True,
+ document={
+ "date": "2015-10-01T00:30:00Z"
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="2",
- refresh="true",
- body={"date": "2015-10-01T01:30:00Z"},
+ refresh=True,
+ document={
+ "date": "2015-10-01T01:30:00Z"
+ },
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
size="0",
- body={
- "aggs": {
- "by_day": {
- "date_histogram": {
- "field": "date",
- "calendar_interval": "day",
- }
+ aggs={
+ "by_day": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "day"
}
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/9a036a792be1d39af9fd0d1adb5f3402.asciidoc b/docs/examples/9a036a792be1d39af9fd0d1adb5f3402.asciidoc
new file mode 100644
index 000000000..1a6a9900c
--- /dev/null
+++ b/docs/examples/9a036a792be1d39af9fd0d1adb5f3402.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keep-words-tokenfilter.asciidoc:26
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ {
+ "type": "keep",
+ "keep_words": [
+ "dog",
+ "elephant",
+ "fox"
+ ]
+ }
+ ],
+ text="the quick fox jumps over the lazy dog",
+)
+print(resp)
+----
diff --git a/docs/examples/9a05cc10eea1251e23b82a4549913536.asciidoc b/docs/examples/9a05cc10eea1251e23b82a4549913536.asciidoc
new file mode 100644
index 000000000..29eb24242
--- /dev/null
+++ b/docs/examples/9a05cc10eea1251e23b82a4549913536.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/hotspotting.asciidoc:102
+
+[source, python]
+----
+resp = client.cat.allocation(
+ v=True,
+ s="node",
+ h="node,shards,disk.percent,disk.indices,disk.used",
+)
+print(resp)
+----
diff --git a/docs/examples/9a09d33ec11e20b6081cae882282ca60.asciidoc b/docs/examples/9a09d33ec11e20b6081cae882282ca60.asciidoc
new file mode 100644
index 000000000..352c19931
--- /dev/null
+++ b/docs/examples/9a09d33ec11e20b6081cae882282ca60.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-privileges-cache.asciidoc:57
+
+[source, python]
+----
+resp = client.security.clear_cached_privileges(
+ application="*",
+)
+print(resp)
+----
diff --git a/docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc b/docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc
new file mode 100644
index 000000000..57789d3dd
--- /dev/null
+++ b/docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-cohere.asciidoc:170
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="cohere-embeddings",
+ inference_config={
+ "service": "cohere",
+ "service_settings": {
+ "api_key": "",
+ "model_id": "embed-english-light-v3.0",
+ "embedding_type": "byte"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9a49b7572d571e00e20dbebdd30f9368.asciidoc b/docs/examples/9a49b7572d571e00e20dbebdd30f9368.asciidoc
new file mode 100644
index 000000000..d5531c3be
--- /dev/null
+++ b/docs/examples/9a49b7572d571e00e20dbebdd30f9368.asciidoc
@@ -0,0 +1,50 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-vector-tile-api.asciidoc:114
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ size=10000,
+ query={
+ "geo_bounding_box": {
+ "my-geo-field": {
+ "top_left": {
+ "lat": -40.979898069620134,
+ "lon": -45
+ },
+ "bottom_right": {
+ "lat": -66.51326044311186,
+ "lon": 0
+ }
+ }
+ }
+ },
+ aggregations={
+ "grid": {
+ "geotile_grid": {
+ "field": "my-geo-field",
+ "precision": 11,
+ "size": 65536,
+ "bounds": {
+ "top_left": {
+ "lat": -40.979898069620134,
+ "lon": -45
+ },
+ "bottom_right": {
+ "lat": -66.51326044311186,
+ "lon": 0
+ }
+ }
+ }
+ },
+ "bounds": {
+ "geo_bounds": {
+ "field": "my-geo-field",
+ "wrap_longitude": False
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc b/docs/examples/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc
index 7eb400dd2..5d558d09f 100644
--- a/docs/examples/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc
+++ b/docs/examples/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:827
[source, python]
@@ -5,16 +6,20 @@
resp = client.index(
index="metricbeat-2016.05.30",
id="1",
- refresh="true",
- body={"system.cpu.idle.pct": 0.908},
+ refresh=True,
+ document={
+ "system.cpu.idle.pct": 0.908
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="metricbeat-2016.05.31",
id="1",
- refresh="true",
- body={"system.cpu.idle.pct": 0.105},
+ refresh=True,
+ document={
+ "system.cpu.idle.pct": 0.105
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/9a743b6575c6fe5acdf46024a7fda8a1.asciidoc b/docs/examples/9a743b6575c6fe5acdf46024a7fda8a1.asciidoc
new file mode 100644
index 000000000..6cab67aae
--- /dev/null
+++ b/docs/examples/9a743b6575c6fe5acdf46024a7fda8a1.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:537
+
+[source, python]
+----
+resp = client.search(
+ index="my_test_scores_2",
+ query={
+ "term": {
+ "grad_year": "2099"
+ }
+ },
+ sort=[
+ {
+ "total_score": {
+ "order": "desc"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/9aa2327ae315c39f2bce2bd22e0deb1b.asciidoc b/docs/examples/9aa2327ae315c39f2bce2bd22e0deb1b.asciidoc
new file mode 100644
index 000000000..f342a73d5
--- /dev/null
+++ b/docs/examples/9aa2327ae315c39f2bce2bd22e0deb1b.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/getting-started.asciidoc:131
+
+[source, python]
+----
+resp = client.search(
+ index=".watcher-history*",
+ pretty=True,
+ query={
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "result.condition.met": True
+ }
+ },
+ {
+ "range": {
+ "result.execution_time": {
+ "from": "now-10s"
+ }
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9ab351893dae65ec97fd8cb6832950fb.asciidoc b/docs/examples/9ab351893dae65ec97fd8cb6832950fb.asciidoc
new file mode 100644
index 000000000..6b763a1a6
--- /dev/null
+++ b/docs/examples/9ab351893dae65ec97fd8cb6832950fb.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:1124
+
+[source, python]
+----
+resp = client.search(
+ index="product-index",
+ query={
+ "script_score": {
+ "query": {
+ "bool": {
+ "filter": {
+ "range": {
+ "price": {
+ "gte": 1000
+ }
+ }
+ }
+ }
+ },
+ "script": {
+ "source": "cosineSimilarity(params.queryVector, 'product-vector') + 1.0",
+ "params": {
+ "queryVector": [
+ -0.5,
+ 90,
+ -10,
+ 14.8,
+ -156
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9ad14a9d7bf2699e2d86b6a607d410c0.asciidoc b/docs/examples/9ad14a9d7bf2699e2d86b6a607d410c0.asciidoc
new file mode 100644
index 000000000..3c0d3d2f0
--- /dev/null
+++ b/docs/examples/9ad14a9d7bf2699e2d86b6a607d410c0.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:112
+
+[source, python]
+----
+resp = client.search_application.get(
+ name="my_search_application",
+)
+print(resp)
+----
diff --git a/docs/examples/9ad38ab4d9c3983e97e8c38fec611f10.asciidoc b/docs/examples/9ad38ab4d9c3983e97e8c38fec611f10.asciidoc
new file mode 100644
index 000000000..bb25824a4
--- /dev/null
+++ b/docs/examples/9ad38ab4d9c3983e97e8c38fec611f10.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/getting-started.asciidoc:107
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster": {
+ "remote": {
+ "leader": {
+ "seeds": [
+ "127.0.0.1:9300"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9ae268058c0ea32ef8926568e011c728.asciidoc b/docs/examples/9ae268058c0ea32ef8926568e011c728.asciidoc
new file mode 100644
index 000000000..f0c74cd8a
--- /dev/null
+++ b/docs/examples/9ae268058c0ea32ef8926568e011c728.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-features-api.asciidoc:122
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_connector/my-connector/_features",
+ headers={"Content-Type": "application/json"},
+ body={
+ "features": {
+ "document_level_security": {
+ "enabled": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9af44592fb2e78fb17ad3e834bbef7a7.asciidoc b/docs/examples/9af44592fb2e78fb17ad3e834bbef7a7.asciidoc
new file mode 100644
index 000000000..5e62697f9
--- /dev/null
+++ b/docs/examples/9af44592fb2e78fb17ad3e834bbef7a7.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/geoip-stats.asciidoc:11
+
+[source, python]
+----
+resp = client.ingest.geo_ip_stats()
+print(resp)
+----
diff --git a/docs/examples/9afa0844883b7471883aa378a8dd10b4.asciidoc b/docs/examples/9afa0844883b7471883aa378a8dd10b4.asciidoc
new file mode 100644
index 000000000..15d83c81e
--- /dev/null
+++ b/docs/examples/9afa0844883b7471883aa378a8dd10b4.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// behavioral-analytics/apis/post-analytics-collection-event.asciidoc:69
+
+[source, python]
+----
+resp = client.search_application.post_behavioral_analytics_event(
+ collection_name="my_analytics_collection",
+ event_type="search_click",
+ body={
+ "session": {
+ "id": "1797ca95-91c9-4e2e-b1bd-9c38e6f386a9"
+ },
+ "user": {
+ "id": "5f26f01a-bbee-4202-9298-81261067abbd"
+ },
+ "search": {
+ "query": "search term",
+ "results": {
+ "items": [
+ {
+ "document": {
+ "id": "123",
+ "index": "products"
+ }
+ }
+ ],
+ "total_results": 10
+ },
+ "sort": {
+ "name": "relevance"
+ },
+ "search_application": "website"
+ },
+ "document": {
+ "id": "123",
+ "index": "products"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9b0f34d122a4b348dc86df7410d6ebb6.asciidoc b/docs/examples/9b0f34d122a4b348dc86df7410d6ebb6.asciidoc
new file mode 100644
index 000000000..bb2afba6c
--- /dev/null
+++ b/docs/examples/9b0f34d122a4b348dc86df7410d6ebb6.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/cancel-connector-sync-job-api.asciidoc:50
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_connector/_sync_job/my-connector-sync-job-id/_cancel",
+)
+print(resp)
+----
diff --git a/docs/examples/9b30a69fec54cf01f7af1b04a6e15239.asciidoc b/docs/examples/9b30a69fec54cf01f7af1b04a6e15239.asciidoc
new file mode 100644
index 000000000..215dcff86
--- /dev/null
+++ b/docs/examples/9b30a69fec54cf01f7af1b04a6e15239.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/get-ccr-stats.asciidoc:103
+
+[source, python]
+----
+resp = client.ccr.stats()
+print(resp)
+----
diff --git a/docs/examples/9b345e0bfd45f3a37194585ec9193478.asciidoc b/docs/examples/9b345e0bfd45f3a37194585ec9193478.asciidoc
new file mode 100644
index 000000000..5cab8fba7
--- /dev/null
+++ b/docs/examples/9b345e0bfd45f3a37194585ec9193478.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/forcemerge.asciidoc:173
+
+[source, python]
+----
+resp = client.indices.forcemerge(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/9b68748c061b768c0153c1f2508ce207.asciidoc b/docs/examples/9b68748c061b768c0153c1f2508ce207.asciidoc
new file mode 100644
index 000000000..d8a9e9db6
--- /dev/null
+++ b/docs/examples/9b68748c061b768c0153c1f2508ce207.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/uni-directional-disaster-recovery.asciidoc:49
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster": {
+ "remote": {
+ "clusterA": {
+ "mode": "proxy",
+ "skip_unavailable": "true",
+ "server_name": "clustera.es.region-a.gcp.elastic-cloud.com",
+ "proxy_socket_connections": "18",
+ "proxy_address": "clustera.es.region-a.gcp.elastic-cloud.com:9400"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9b92266d87170e93a84f9700596d9035.asciidoc b/docs/examples/9b92266d87170e93a84f9700596d9035.asciidoc
new file mode 100644
index 000000000..6c353fa09
--- /dev/null
+++ b/docs/examples/9b92266d87170e93a84f9700596d9035.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-shape-query.asciidoc:30
+
+[source, python]
+----
+resp = client.indices.create(
+ index="example",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_shape"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="example",
+ refresh=True,
+ document={
+ "name": "Wind & Wetter, Berlin, Germany",
+ "location": {
+ "type": "point",
+ "coordinates": [
+ 13.400544,
+ 52.530286
+ ]
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/9ba6f1e64c1dfff5aac26eaa1d093f48.asciidoc b/docs/examples/9ba6f1e64c1dfff5aac26eaa1d093f48.asciidoc
new file mode 100644
index 000000000..cb18a83f1
--- /dev/null
+++ b/docs/examples/9ba6f1e64c1dfff5aac26eaa1d093f48.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/stemmer-override-tokenfilter.asciidoc:57
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "custom_stems",
+ "porter_stem"
+ ]
+ }
+ },
+ "filter": {
+ "custom_stems": {
+ "type": "stemmer_override",
+ "rules": [
+ "running, runs => run",
+ "stemmer => stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9ba868784f417a8d3679b3c8ed5939ad.asciidoc b/docs/examples/9ba868784f417a8d3679b3c8ed5939ad.asciidoc
new file mode 100644
index 000000000..f68d8db9c
--- /dev/null
+++ b/docs/examples/9ba868784f417a8d3679b3c8ed5939ad.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-rollover.asciidoc:176
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_size": "100gb"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9bae72e974bdeb56007d9104e73eff92.asciidoc b/docs/examples/9bae72e974bdeb56007d9104e73eff92.asciidoc
index 242c988d5..3651a3480 100644
--- a/docs/examples/9bae72e974bdeb56007d9104e73eff92.asciidoc
+++ b/docs/examples/9bae72e974bdeb56007d9104e73eff92.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:182
[source, python]
@@ -5,7 +6,7 @@
resp = client.update(
index="test",
id="1",
- body={"script": "ctx._source.remove('new_field')"},
+ script="ctx._source.remove('new_field')",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/9bb24fe09e3d1c73a71d00b994ba8cfb.asciidoc b/docs/examples/9bb24fe09e3d1c73a71d00b994ba8cfb.asciidoc
new file mode 100644
index 000000000..438842e0f
--- /dev/null
+++ b/docs/examples/9bb24fe09e3d1c73a71d00b994ba8cfb.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/shards.asciidoc:343
+
+[source, python]
+----
+resp = client.cat.shards(
+ index="my-index-*",
+)
+print(resp)
+----
diff --git a/docs/examples/9beb260834f8cfb240f6308950dbb9c2.asciidoc b/docs/examples/9beb260834f8cfb240f6308950dbb9c2.asciidoc
new file mode 100644
index 000000000..4e029bc94
--- /dev/null
+++ b/docs/examples/9beb260834f8cfb240f6308950dbb9c2.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:521
+
+[source, python]
+----
+resp = client.search(
+ sort=[
+ {
+ "_geo_distance": {
+ "pin.location": "drm3btev3e86",
+ "order": "asc",
+ "unit": "km"
+ }
+ }
+ ],
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9bfdda207b701028a3439e495e800c02.asciidoc b/docs/examples/9bfdda207b701028a3439e495e800c02.asciidoc
index 7364449e5..d6fb075c9 100644
--- a/docs/examples/9bfdda207b701028a3439e495e800c02.asciidoc
+++ b/docs/examples/9bfdda207b701028a3439e495e800c02.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:288
[source, python]
@@ -5,17 +6,15 @@
resp = client.search(
index="sales",
size="0",
- body={
- "aggs": {
- "sales_over_time": {
- "date_histogram": {
- "field": "date",
- "calendar_interval": "1M",
- "format": "yyyy-MM-dd",
- }
+ aggs={
+ "sales_over_time": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M",
+ "format": "yyyy-MM-dd"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/9c01db07c9ac395b6370e3b33965c21f.asciidoc b/docs/examples/9c01db07c9ac395b6370e3b33965c21f.asciidoc
new file mode 100644
index 000000000..95150009b
--- /dev/null
+++ b/docs/examples/9c01db07c9ac395b6370e3b33965c21f.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/oidc-authenticate-api.asciidoc:68
+
+[source, python]
+----
+resp = client.security.oidc_authenticate(
+ body={
+ "redirect_uri": "https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I",
+ "state": "4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I",
+ "nonce": "WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM",
+ "realm": "oidc1"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9c021836acf7c0370e289f611325868d.asciidoc b/docs/examples/9c021836acf7c0370e289f611325868d.asciidoc
new file mode 100644
index 000000000..9fc291d61
--- /dev/null
+++ b/docs/examples/9c021836acf7c0370e289f611325868d.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-configuration-api.asciidoc:308
+
+[source, python]
+----
+resp = client.connector.update_configuration(
+ connector_id="my-spo-connector",
+ values={
+ "tenant_id": "my-tenant-id",
+ "tenant_name": "my-sharepoint-site",
+ "client_id": "foo",
+ "secret_value": "bar",
+ "site_collections": "*"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9c4ac64e73141f6cbf2fb6da0743d9b7.asciidoc b/docs/examples/9c4ac64e73141f6cbf2fb6da0743d9b7.asciidoc
new file mode 100644
index 000000000..4cdb9690e
--- /dev/null
+++ b/docs/examples/9c4ac64e73141f6cbf2fb6da0743d9b7.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/specify-analyzer.asciidoc:130
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "message": {
+ "query": "Quick foxes",
+ "analyzer": "stop"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9c5cbbdbe0075ab9c2611627fe4748fb.asciidoc b/docs/examples/9c5cbbdbe0075ab9c2611627fe4748fb.asciidoc
new file mode 100644
index 000000000..8c9e49c24
--- /dev/null
+++ b/docs/examples/9c5cbbdbe0075ab9c2611627fe4748fb.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/decimal-digit-tokenfilter.asciidoc:75
+
+[source, python]
+----
+resp = client.indices.create(
+ index="decimal_digit_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_decimal_digit": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "decimal_digit"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9c6ea5fe2339d6c7e5e4bf1b98990248.asciidoc b/docs/examples/9c6ea5fe2339d6c7e5e4bf1b98990248.asciidoc
new file mode 100644
index 000000000..f4e389e2d
--- /dev/null
+++ b/docs/examples/9c6ea5fe2339d6c7e5e4bf1b98990248.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:132
+
+[source, python]
+----
+resp = client.search(
+ index="image-index",
+ knn={
+ "field": "image-vector",
+ "query_vector": [
+ -5,
+ 9,
+ -12
+ ],
+ "k": 10,
+ "num_candidates": 100
+ },
+ fields=[
+ "title",
+ "file-type"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/9c7c8051592b6af3adb5d7c490849068.asciidoc b/docs/examples/9c7c8051592b6af3adb5d7c490849068.asciidoc
new file mode 100644
index 000000000..b7dba1f67
--- /dev/null
+++ b/docs/examples/9c7c8051592b6af3adb5d7c490849068.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/put-datafeed.asciidoc:162
+
+[source, python]
+----
+resp = client.ml.put_datafeed(
+ datafeed_id="datafeed-test-job",
+ pretty=True,
+ indices=[
+ "kibana_sample_data_logs"
+ ],
+ query={
+ "bool": {
+ "must": [
+ {
+ "match_all": {}
+ }
+ ]
+ }
+ },
+ job_id="test-job",
+)
+print(resp)
+----
diff --git a/docs/examples/9cbb097e5498a9fde39e3b1d3b62a4d2.asciidoc b/docs/examples/9cbb097e5498a9fde39e3b1d3b62a4d2.asciidoc
index f8fde02c8..15d03e6ab 100644
--- a/docs/examples/9cbb097e5498a9fde39e3b1d3b62a4d2.asciidoc
+++ b/docs/examples/9cbb097e5498a9fde39e3b1d3b62a4d2.asciidoc
@@ -1,18 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/infer-trained-model.asciidoc:945
[source, python]
----
resp = client.ml.infer_trained_model(
model_id="model2",
- body={
- "docs": [{"text_field": "This is a very happy person"}],
- "inference_config": {
- "zero_shot_classification": {
- "labels": ["glad", "sad", "bad", "rad"],
- "multi_label": False,
- }
- },
+ docs=[
+ {
+ "text_field": "This is a very happy person"
+ }
+ ],
+ inference_config={
+ "zero_shot_classification": {
+ "labels": [
+ "glad",
+ "sad",
+ "bad",
+ "rad"
+ ],
+ "multi_label": False
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/9cc64ab2f60f995f5dbfaca67aa6dd41.asciidoc b/docs/examples/9cc64ab2f60f995f5dbfaca67aa6dd41.asciidoc
new file mode 100644
index 000000000..57fbd39dd
--- /dev/null
+++ b/docs/examples/9cc64ab2f60f995f5dbfaca67aa6dd41.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-query-api.asciidoc:10
+
+[source, python]
+----
+resp = client.esql.query(
+ query="\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/9cd37d0ccbc66ad47ddb626564b27cc8.asciidoc b/docs/examples/9cd37d0ccbc66ad47ddb626564b27cc8.asciidoc
new file mode 100644
index 000000000..21eab8e92
--- /dev/null
+++ b/docs/examples/9cd37d0ccbc66ad47ddb626564b27cc8.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/execute-watch.asciidoc:327
+
+[source, python]
+----
+resp = client.watcher.execute_watch(
+ watch={
+ "trigger": {
+ "schedule": {
+ "interval": "10s"
+ }
+ },
+ "input": {
+ "search": {
+ "request": {
+ "indices": [
+ "logs"
+ ],
+ "body": {
+ "query": {
+ "match": {
+ "message": "error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "condition": {
+ "compare": {
+ "ctx.payload.hits.total": {
+ "gt": 0
+ }
+ }
+ },
+ "actions": {
+ "log_error": {
+ "logging": {
+ "text": "Found {{ctx.payload.hits.total}} errors in the logs"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9cf6c7012a4f2bb562bc256aa28c3409.asciidoc b/docs/examples/9cf6c7012a4f2bb562bc256aa28c3409.asciidoc
new file mode 100644
index 000000000..bcc021bbb
--- /dev/null
+++ b/docs/examples/9cf6c7012a4f2bb562bc256aa28c3409.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/execute-watch.asciidoc:314
+
+[source, python]
+----
+resp = client.watcher.execute_watch(
+ id="my_watch",
+ action_modes={
+ "_all": "force_execute"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc b/docs/examples/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc
index 5e42eef66..520146d3d 100644
--- a/docs/examples/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc
+++ b/docs/examples/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc
@@ -1,12 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:521
[source, python]
----
resp = client.delete_by_query(
index="my-index-000001",
- refresh="true",
+ refresh=True,
slices="5",
- body={"query": {"range": {"http.response.bytes": {"lt": 2000000}}}},
+ query={
+ "range": {
+ "http.response.bytes": {
+ "lt": 2000000
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/9d1fb129ac783355a20097effded1845.asciidoc b/docs/examples/9d1fb129ac783355a20097effded1845.asciidoc
new file mode 100644
index 000000000..1e71204b6
--- /dev/null
+++ b/docs/examples/9d1fb129ac783355a20097effded1845.asciidoc
@@ -0,0 +1,52 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/top-metrics-aggregation.asciidoc:12
+
+[source, python]
+----
+resp = client.bulk(
+ index="test",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "s": 1,
+ "m": 3.1415
+ },
+ {
+ "index": {}
+ },
+ {
+ "s": 2,
+ "m": 1
+ },
+ {
+ "index": {}
+ },
+ {
+ "s": 3,
+ "m": 2.71828
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.search(
+ index="test",
+ filter_path="aggregations",
+ aggs={
+ "tm": {
+ "top_metrics": {
+ "metrics": {
+ "field": "m"
+ },
+ "sort": {
+ "s": "desc"
+ }
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/9d31c7eaf8c6b56cee2fdfdde8a442bb.asciidoc b/docs/examples/9d31c7eaf8c6b56cee2fdfdde8a442bb.asciidoc
new file mode 100644
index 000000000..d1fd6e8bf
--- /dev/null
+++ b/docs/examples/9d31c7eaf8c6b56cee2fdfdde8a442bb.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-shrink.asciidoc:90
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "warm": {
+ "actions": {
+ "shrink": {
+ "max_primary_shard_size": "50gb"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9d461ae140ddc018efd2650559800cd1.asciidoc b/docs/examples/9d461ae140ddc018efd2650559800cd1.asciidoc
new file mode 100644
index 000000000..df4a64333
--- /dev/null
+++ b/docs/examples/9d461ae140ddc018efd2650559800cd1.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-allocate.asciidoc:147
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "warm": {
+ "actions": {
+ "allocate": {
+ "number_of_replicas": 1,
+ "require": {
+ "box_type": "cold"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9d47f02a063444da9f098858a1830d28.asciidoc b/docs/examples/9d47f02a063444da9f098858a1830d28.asciidoc
new file mode 100644
index 000000000..0cef3692d
--- /dev/null
+++ b/docs/examples/9d47f02a063444da9f098858a1830d28.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:210
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.disk.watermark.low": "30gb"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9d5855075e7008270459cc88c189043d.asciidoc b/docs/examples/9d5855075e7008270459cc88c189043d.asciidoc
new file mode 100644
index 000000000..cabca1c71
--- /dev/null
+++ b/docs/examples/9d5855075e7008270459cc88c189043d.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/remote-clusters-privileges-cert.asciidoc:112
+
+[source, python]
+----
+resp = client.security.put_user(
+ username="cross-cluster-user",
+ password="l0ng-r4nd0m-p@ssw0rd",
+ roles=[
+ "remote-replication"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/9d662fc9f943c287b7144f5e4e2ae358.asciidoc b/docs/examples/9d662fc9f943c287b7144f5e4e2ae358.asciidoc
new file mode 100644
index 000000000..18e6e587f
--- /dev/null
+++ b/docs/examples/9d662fc9f943c287b7144f5e4e2ae358.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/median-absolute-deviation-aggregation.asciidoc:90
+
+[source, python]
+----
+resp = client.search(
+ index="reviews",
+ size=0,
+ aggs={
+ "review_variability": {
+ "median_absolute_deviation": {
+ "field": "rating",
+ "compression": 100
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9d67db8370a98854812d38ae73ee2a12.asciidoc b/docs/examples/9d67db8370a98854812d38ae73ee2a12.asciidoc
new file mode 100644
index 000000000..0873fa338
--- /dev/null
+++ b/docs/examples/9d67db8370a98854812d38ae73ee2a12.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/highlighting-multi-fields.asciidoc:302
+
+[source, python]
+----
+resp = client.search(
+ index="index2",
+ query={
+ "query_string": {
+ "query": "running with scissors",
+ "fields": [
+ "comment",
+ "comment.english"
+ ]
+ }
+ },
+ highlight={
+ "order": "score",
+ "fields": {
+ "comment": {
+ "type": "fvh",
+ "matched_fields": [
+ "comment",
+ "comment.english"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc b/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc
index c144209d1..b6f73d2cb 100644
--- a/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc
+++ b/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc
@@ -1,7 +1,8 @@
-// health/health.asciidoc:466
+// This file is autogenerated, DO NOT EDIT
+// health/health.asciidoc:465
[source, python]
----
resp = client.health_report()
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/9d9c8d715b72ce336e604c2c8a2b540e.asciidoc b/docs/examples/9d9c8d715b72ce336e604c2c8a2b540e.asciidoc
new file mode 100644
index 000000000..52af54de6
--- /dev/null
+++ b/docs/examples/9d9c8d715b72ce336e604c2c8a2b540e.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/bucket-sort-aggregation.asciidoc:54
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "total_sales": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "sales_bucket_sort": {
+ "bucket_sort": {
+ "sort": [
+ {
+ "total_sales": {
+ "order": "desc"
+ }
+ }
+ ],
+ "size": 3
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9de10a59a5f56dd0906be627896cc789.asciidoc b/docs/examples/9de10a59a5f56dd0906be627896cc789.asciidoc
new file mode 100644
index 000000000..c44a368f5
--- /dev/null
+++ b/docs/examples/9de10a59a5f56dd0906be627896cc789.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:543
+
+[source, python]
+----
+resp = client.search(
+ index="bicycles,other_cycles",
+ query={
+ "match": {
+ "description": "dutch"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9de4704d2f047dae1259249112488697.asciidoc b/docs/examples/9de4704d2f047dae1259249112488697.asciidoc
new file mode 100644
index 000000000..f237aeafe
--- /dev/null
+++ b/docs/examples/9de4704d2f047dae1259249112488697.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/repository-azure.asciidoc:56
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_backup",
+ repository={
+ "type": "azure",
+ "settings": {
+ "client": "secondary"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9de4ea9d5f3d427a71ee07d998cb5611.asciidoc b/docs/examples/9de4ea9d5f3d427a71ee07d998cb5611.asciidoc
index 71e071724..1ef1ca4c5 100644
--- a/docs/examples/9de4ea9d5f3d427a71ee07d998cb5611.asciidoc
+++ b/docs/examples/9de4ea9d5f3d427a71ee07d998cb5611.asciidoc
@@ -1,6 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/blocks.asciidoc:138
[source, python]
----
-
-----
\ No newline at end of file
+resp = client.indices.add_block(
+ index="my-index-000001",
+ block="write",
+)
+print(resp)
+----
diff --git a/docs/examples/9de4edafd22a8b9cb557632b2c8779cd.asciidoc b/docs/examples/9de4edafd22a8b9cb557632b2c8779cd.asciidoc
new file mode 100644
index 000000000..a05788985
--- /dev/null
+++ b/docs/examples/9de4edafd22a8b9cb557632b2c8779cd.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-rest.asciidoc:306
+
+[source, python]
+----
+resp = client.esql.query(
+ query="\n FROM library\n | EVAL year = DATE_EXTRACT(\"year\", release_date)\n | WHERE page_count > ?1 AND author == ?2\n | STATS count = COUNT(*) by year\n | WHERE count > ?3\n | LIMIT 5\n ",
+ params=[
+ 300,
+ "Frank Herbert",
+ 0
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/9e0e3ce27967f164f4585c5231ba9c75.asciidoc b/docs/examples/9e0e3ce27967f164f4585c5231ba9c75.asciidoc
index f0fa86520..1446dfd1d 100644
--- a/docs/examples/9e0e3ce27967f164f4585c5231ba9c75.asciidoc
+++ b/docs/examples/9e0e3ce27967f164f4585c5231ba9c75.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/search-as-you-type.asciidoc:71
[source, python]
@@ -5,8 +6,10 @@
resp = client.index(
index="my-index-000001",
id="1",
- refresh="true",
- body={"my_field": "quick brown fox jump lazy dog"},
+ refresh=True,
+ document={
+ "my_field": "quick brown fox jump lazy dog"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/9e3c28d5820c38ea117eb2e9a5061089.asciidoc b/docs/examples/9e3c28d5820c38ea117eb2e9a5061089.asciidoc
new file mode 100644
index 000000000..1ffad58c1
--- /dev/null
+++ b/docs/examples/9e3c28d5820c38ea117eb2e9a5061089.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/rank-feature-query.asciidoc:321
+
+[source, python]
+----
+resp = client.search(
+ index="test",
+ query={
+ "rank_feature": {
+ "field": "pagerank",
+ "sigmoid": {
+ "pivot": 7,
+ "exponent": 0.6
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9e563b8d5a7845f644db8d5bbf453eb6.asciidoc b/docs/examples/9e563b8d5a7845f644db8d5bbf453eb6.asciidoc
new file mode 100644
index 000000000..d1b60ef2e
--- /dev/null
+++ b/docs/examples/9e563b8d5a7845f644db8d5bbf453eb6.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// synonyms/apis/put-synonyms-set.asciidoc:61
+
+[source, python]
+----
+resp = client.synonyms.put_synonym(
+ id="my-synonyms-set",
+ synonyms_set=[
+ {
+ "id": "test-1",
+ "synonyms": "hello, hi"
+ },
+ {
+ "synonyms": "bye, goodbye"
+ },
+ {
+ "id": "test-2",
+ "synonyms": "test => check"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/9e5ae957fd0663662bfbed9d1effe99e.asciidoc b/docs/examples/9e5ae957fd0663662bfbed9d1effe99e.asciidoc
new file mode 100644
index 000000000..dad52c7d9
--- /dev/null
+++ b/docs/examples/9e5ae957fd0663662bfbed9d1effe99e.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:559
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "set": {
+ "description": "Set '_routing' to 'geoip.country_iso_code' value",
+ "field": "_routing",
+ "value": "{{{geoip.country_iso_code}}}"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/9e962baf1fb407c21d6c47dcd37cec29.asciidoc b/docs/examples/9e962baf1fb407c21d6c47dcd37cec29.asciidoc
new file mode 100644
index 000000000..6a54520b8
--- /dev/null
+++ b/docs/examples/9e962baf1fb407c21d6c47dcd37cec29.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:255
+
+[source, python]
+----
+resp = client.render_search_template(
+ source={
+ "query": {
+ "match": {
+ "message": "{{query_string}}"
+ }
+ },
+ "from": "{{from}}{{^from}}0{{/from}}",
+ "size": "{{size}}{{^size}}10{{/size}}"
+ },
+ params={
+ "query_string": "hello world"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9e9717d9108ae1425bfacf71c7c44539.asciidoc b/docs/examples/9e9717d9108ae1425bfacf71c7c44539.asciidoc
new file mode 100644
index 000000000..fc588c589
--- /dev/null
+++ b/docs/examples/9e9717d9108ae1425bfacf71c7c44539.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// cat.asciidoc:121
+
+[source, python]
+----
+resp = client.cat.indices(
+ bytes="b",
+ s="store.size:desc,index:asc",
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/9eda9c39428b0c2c53cbd8ee7ae0f888.asciidoc b/docs/examples/9eda9c39428b0c2c53cbd8ee7ae0f888.asciidoc
new file mode 100644
index 000000000..9ff63d26f
--- /dev/null
+++ b/docs/examples/9eda9c39428b0c2c53cbd8ee7ae0f888.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/saml-guide.asciidoc:1016
+
+[source, python]
+----
+resp = client.security.saml_authenticate(
+ content="PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD.....",
+ ids=[],
+)
+print(resp)
+----
diff --git a/docs/examples/9eef31d85ebaf6c27054d7375715dbe0.asciidoc b/docs/examples/9eef31d85ebaf6c27054d7375715dbe0.asciidoc
new file mode 100644
index 000000000..c8250cea5
--- /dev/null
+++ b/docs/examples/9eef31d85ebaf6c27054d7375715dbe0.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/actions.asciidoc:228
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="log_event_watch",
+ trigger={
+ "schedule": {
+ "interval": "5m"
+ }
+ },
+ input={
+ "search": {
+ "request": {
+ "indices": "log-events",
+ "body": {
+ "query": {
+ "match": {
+ "status": "error"
+ }
+ }
+ }
+ }
+ }
+ },
+ condition={
+ "compare": {
+ "ctx.payload.hits.total": {
+ "gt": 0
+ }
+ }
+ },
+ actions={
+ "log_hits": {
+ "foreach": "ctx.payload.hits.hits",
+ "max_iterations": 500,
+ "logging": {
+ "text": "Found id {{ctx.payload._id}} with field {{ctx.payload._source.my_field}}"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9f04cc1a0c6cdb3ed2247f1399713767.asciidoc b/docs/examples/9f04cc1a0c6cdb3ed2247f1399713767.asciidoc
index 4104eefb1..35da3d856 100644
--- a/docs/examples/9f04cc1a0c6cdb3ed2247f1399713767.asciidoc
+++ b/docs/examples/9f04cc1a0c6cdb3ed2247f1399713767.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/keyword.asciidoc:31
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"tags": {"type": "keyword"}}}},
+ mappings={
+ "properties": {
+ "tags": {
+ "type": "keyword"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/9f0a0029982d9b3423a2a3de1f1b5136.asciidoc b/docs/examples/9f0a0029982d9b3423a2a3de1f1b5136.asciidoc
new file mode 100644
index 000000000..7c52cd81d
--- /dev/null
+++ b/docs/examples/9f0a0029982d9b3423a2a3de1f1b5136.asciidoc
@@ -0,0 +1,98 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/cartesian-centroid-aggregation.asciidoc:13
+
+[source, python]
+----
+resp = client.indices.create(
+ index="museums",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "point"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="museums",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "location": "POINT (491.2350 5237.4081)",
+ "city": "Amsterdam",
+ "name": "NEMO Science Museum"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "location": "POINT (490.1618 5236.9219)",
+ "city": "Amsterdam",
+ "name": "Museum Het Rembrandthuis"
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "location": "POINT (491.4722 5237.1667)",
+ "city": "Amsterdam",
+ "name": "Nederlands Scheepvaartmuseum"
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "location": "POINT (440.5200 5122.2900)",
+ "city": "Antwerp",
+ "name": "Letterenhuis"
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "location": "POINT (233.6389 4886.1111)",
+ "city": "Paris",
+ "name": "Musée du Louvre"
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "location": "POINT (232.7000 4886.0000)",
+ "city": "Paris",
+ "name": "Musée d'Orsay"
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="museums",
+ size="0",
+ aggs={
+ "centroid": {
+ "cartesian_centroid": {
+ "field": "location"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc b/docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc
new file mode 100644
index 000000000..f56b0349b
--- /dev/null
+++ b/docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-openai.asciidoc:121
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="openai-embeddings",
+ inference_config={
+ "service": "openai",
+ "service_settings": {
+ "api_key": "",
+ "model_id": "text-embedding-ada-002"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9f22a0920cc763eefa233ced963d9624.asciidoc b/docs/examples/9f22a0920cc763eefa233ced963d9624.asciidoc
new file mode 100644
index 000000000..3d966548c
--- /dev/null
+++ b/docs/examples/9f22a0920cc763eefa233ced963d9624.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-term-query.asciidoc:34
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_term": {
+ "user.id": {
+ "term": "kimchy",
+ "boost": 2
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9f286416f1b18940f13cb27ab5c8458e.asciidoc b/docs/examples/9f286416f1b18940f13cb27ab5c8458e.asciidoc
new file mode 100644
index 000000000..bc9649f24
--- /dev/null
+++ b/docs/examples/9f286416f1b18940f13cb27ab5c8458e.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/pattern_replace-tokenfilter.asciidoc:133
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "keyword",
+ "filter": [
+ "my_pattern_replace_filter"
+ ]
+ }
+ },
+ "filter": {
+ "my_pattern_replace_filter": {
+ "type": "pattern_replace",
+ "pattern": "[£|€]",
+ "replacement": "",
+ "all": False
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9f3341489fefd38c4e439c29f6dcb86c.asciidoc b/docs/examples/9f3341489fefd38c4e439c29f6dcb86c.asciidoc
new file mode 100644
index 000000000..76040c776
--- /dev/null
+++ b/docs/examples/9f3341489fefd38c4e439c29f6dcb86c.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/terms-set-query.asciidoc:214
+
+[source, python]
+----
+resp = client.search(
+ index="job-candidates",
+ query={
+ "terms_set": {
+ "programming_languages": {
+ "terms": [
+ "c++",
+ "java",
+ "php"
+ ],
+ "minimum_should_match_script": {
+ "source": "Math.min(params.num_terms, doc['required_matches'].value)"
+ },
+ "boost": 1
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9f66b5243050f71ed51bc787a7ac1218.asciidoc b/docs/examples/9f66b5243050f71ed51bc787a7ac1218.asciidoc
new file mode 100644
index 000000000..3a3345871
--- /dev/null
+++ b/docs/examples/9f66b5243050f71ed51bc787a7ac1218.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/highlighting-multi-fields.asciidoc:215
+
+[source, python]
+----
+resp = client.bulk(
+ index="index2",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "doc1"
+ }
+ },
+ {
+ "comment": "run with scissors"
+ },
+ {
+ "index": {
+ "_id": "doc2"
+ }
+ },
+ {
+ "comment": "running with scissors"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/9f7671119236423e0e40801ef6485af1.asciidoc b/docs/examples/9f7671119236423e0e40801ef6485af1.asciidoc
new file mode 100644
index 000000000..bf46493bf
--- /dev/null
+++ b/docs/examples/9f7671119236423e0e40801ef6485af1.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/uppercase-tokenfilter.asciidoc:30
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "uppercase"
+ ],
+ text="the Quick FoX JUMPs",
+)
+print(resp)
+----
diff --git a/docs/examples/9f99be2d58c48a6bf8e892aa24604197.asciidoc b/docs/examples/9f99be2d58c48a6bf8e892aa24604197.asciidoc
new file mode 100644
index 000000000..37a5c6840
--- /dev/null
+++ b/docs/examples/9f99be2d58c48a6bf8e892aa24604197.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/update-dfanalytics.asciidoc:92
+
+[source, python]
+----
+resp = client.ml.update_data_frame_analytics(
+ id="loganalytics",
+ model_memory_limit="200mb",
+)
+print(resp)
+----
diff --git a/docs/examples/9fa55fc76ec4bd81f372e9389f1da851.asciidoc b/docs/examples/9fa55fc76ec4bd81f372e9389f1da851.asciidoc
new file mode 100644
index 000000000..297868b67
--- /dev/null
+++ b/docs/examples/9fa55fc76ec4bd81f372e9389f1da851.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:318
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my-data-stream",
+ settings={
+ "index": {
+ "refresh_interval": "30s"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9fda516a5dc60ba477b970eaad4429db.asciidoc b/docs/examples/9fda516a5dc60ba477b970eaad4429db.asciidoc
new file mode 100644
index 000000000..8183ae09c
--- /dev/null
+++ b/docs/examples/9fda516a5dc60ba477b970eaad4429db.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/apis/get-lifecycle.asciidoc:117
+
+[source, python]
+----
+resp = client.indices.get_data_lifecycle(
+ name="my-data-stream*",
+)
+print(resp)
+----
diff --git a/docs/examples/9feff356f302ea4915347ab71cc4887a.asciidoc b/docs/examples/9feff356f302ea4915347ab71cc4887a.asciidoc
new file mode 100644
index 000000000..31a0cbc95
--- /dev/null
+++ b/docs/examples/9feff356f302ea4915347ab71cc4887a.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/simulate-template.asciidoc:235
+
+[source, python]
+----
+resp = client.indices.simulate_template(
+ index_patterns=[
+ "my-index-*"
+ ],
+ composed_of=[
+ "ct2"
+ ],
+ priority=10,
+ template={
+ "settings": {
+ "index.number_of_replicas": 1
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/9ff9b2a73419a6c82f17a358b4991499.asciidoc b/docs/examples/9ff9b2a73419a6c82f17a358b4991499.asciidoc
new file mode 100644
index 000000000..c8ce35cb5
--- /dev/null
+++ b/docs/examples/9ff9b2a73419a6c82f17a358b4991499.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/point-in-time-api.asciidoc:121
+
+[source, python]
+----
+resp = client.close_point_in_time(
+ id="46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==",
+)
+print(resp)
+----
diff --git a/docs/examples/9ffe41322c095af1b6ea45a79b640a6f.asciidoc b/docs/examples/9ffe41322c095af1b6ea45a79b640a6f.asciidoc
new file mode 100644
index 000000000..55e6701a3
--- /dev/null
+++ b/docs/examples/9ffe41322c095af1b6ea45a79b640a6f.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-within-query.asciidoc:11
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_within": {
+ "little": {
+ "span_term": {
+ "field1": "foo"
+ }
+ },
+ "big": {
+ "span_near": {
+ "clauses": [
+ {
+ "span_term": {
+ "field1": "bar"
+ }
+ },
+ {
+ "span_term": {
+ "field1": "baz"
+ }
+ }
+ ],
+ "slop": 5,
+ "in_order": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a00311843b5f8f3e9f7d511334a828b1.asciidoc b/docs/examples/a00311843b5f8f3e9f7d511334a828b1.asciidoc
new file mode 100644
index 000000000..21debb682
--- /dev/null
+++ b/docs/examples/a00311843b5f8f3e9f7d511334a828b1.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/rollup-caps.asciidoc:91
+
+[source, python]
+----
+resp = client.rollup.get_rollup_caps(
+ id="sensor-*",
+)
+print(resp)
+----
diff --git a/docs/examples/a008f42379930edc354b4074e0a33344.asciidoc b/docs/examples/a008f42379930edc354b4074e0a33344.asciidoc
new file mode 100644
index 000000000..f8cab3b97
--- /dev/null
+++ b/docs/examples/a008f42379930edc354b4074e0a33344.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:116
+
+[source, python]
+----
+resp = client.index(
+ index="index",
+ id="1",
+ document={
+ "designation": "spoon",
+ "price": 13
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a01753fa7b4ba6dc19054f4f42d91cd9.asciidoc b/docs/examples/a01753fa7b4ba6dc19054f4f42d91cd9.asciidoc
new file mode 100644
index 000000000..6b2e39a55
--- /dev/null
+++ b/docs/examples/a01753fa7b4ba6dc19054f4f42d91cd9.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:620
+
+[source, python]
+----
+resp = client.render_search_template(
+ source="{ \"query\": { \"bool\": { \"filter\": [ { \"range\": { \"@timestamp\": { \"gte\": {{#year_scope}} \"now-1y/d\" {{/year_scope}} {{^year_scope}} \"now-1d/d\" {{/year_scope}} , \"lt\": \"now/d\" }}}, { \"term\": { \"user.id\": \"{{user_id}}\" }}]}}}",
+ params={
+ "year_scope": True,
+ "user_id": "kimchy"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a037beb3d02296e1d36dd43ef5c935dd.asciidoc b/docs/examples/a037beb3d02296e1d36dd43ef5c935dd.asciidoc
new file mode 100644
index 000000000..318cbf217
--- /dev/null
+++ b/docs/examples/a037beb3d02296e1d36dd43ef5c935dd.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keyword-repeat-tokenfilter.asciidoc:49
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "keyword_repeat"
+ ],
+ text="fox running and jumping",
+ explain=True,
+ attributes="keyword",
+)
+print(resp)
+----
diff --git a/docs/examples/a0497157fdefecd04e597edb800a1a95.asciidoc b/docs/examples/a0497157fdefecd04e597edb800a1a95.asciidoc
new file mode 100644
index 000000000..00c954001
--- /dev/null
+++ b/docs/examples/a0497157fdefecd04e597edb800a1a95.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:513
+
+[source, python]
+----
+resp = client.search(
+ source="obj.*",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a04a8d90f8245ff5f30a9983909faa1d.asciidoc b/docs/examples/a04a8d90f8245ff5f30a9983909faa1d.asciidoc
index dcdbb8973..8ffdbb981 100644
--- a/docs/examples/a04a8d90f8245ff5f30a9983909faa1d.asciidoc
+++ b/docs/examples/a04a8d90f8245ff5f30a9983909faa1d.asciidoc
@@ -1,44 +1,48 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:427
[source, python]
----
resp = client.indices.create(
index="my_queries1",
- body={
- "settings": {
- "analysis": {
- "analyzer": {
- "wildcard_prefix": {
- "type": "custom",
- "tokenizer": "standard",
- "filter": ["lowercase", "wildcard_edge_ngram"],
- }
- },
- "filter": {
- "wildcard_edge_ngram": {
- "type": "edge_ngram",
- "min_gram": 1,
- "max_gram": 32,
- }
- },
+ settings={
+ "analysis": {
+ "analyzer": {
+ "wildcard_prefix": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "wildcard_edge_ngram"
+ ]
+ }
+ },
+ "filter": {
+ "wildcard_edge_ngram": {
+ "type": "edge_ngram",
+ "min_gram": 1,
+ "max_gram": 32
+ }
}
- },
- "mappings": {
- "properties": {
- "query": {"type": "percolator"},
- "my_field": {
- "type": "text",
- "fields": {
- "prefix": {
- "type": "text",
- "analyzer": "wildcard_prefix",
- "search_analyzer": "standard",
- }
- },
- },
+ }
+ },
+ mappings={
+ "properties": {
+ "query": {
+ "type": "percolator"
+ },
+ "my_field": {
+ "type": "text",
+ "fields": {
+ "prefix": {
+ "type": "text",
+ "analyzer": "wildcard_prefix",
+ "search_analyzer": "standard"
+ }
+ }
}
- },
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a0871be90badeecd2f8d8ec90230e248.asciidoc b/docs/examples/a0871be90badeecd2f8d8ec90230e248.asciidoc
new file mode 100644
index 000000000..becf4a99c
--- /dev/null
+++ b/docs/examples/a0871be90badeecd2f8d8ec90230e248.asciidoc
@@ -0,0 +1,47 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/charfilters/pattern-replace-charfilter.asciidoc:104
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "char_filter": [
+ "my_char_filter"
+ ],
+ "filter": [
+ "lowercase"
+ ]
+ }
+ },
+ "char_filter": {
+ "my_char_filter": {
+ "type": "pattern_replace",
+ "pattern": "(?<=\\p{Lower})(?=\\p{Upper})",
+ "replacement": " "
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "text": {
+ "type": "text",
+ "analyzer": "my_analyzer"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="The fooBarBaz method",
+)
+print(resp1)
+----
diff --git a/docs/examples/a0a7557bb7e2aff7918557cd648f41af.asciidoc b/docs/examples/a0a7557bb7e2aff7918557cd648f41af.asciidoc
new file mode 100644
index 000000000..3739be268
--- /dev/null
+++ b/docs/examples/a0a7557bb7e2aff7918557cd648f41af.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:127
+
+[source, python]
+----
+resp = client.search(
+ index="index",
+ aggs={
+ "price_ranges": {
+ "range": {
+ "field": "price",
+ "ranges": [
+ {
+ "to": 10
+ },
+ {
+ "from": 10,
+ "to": 100
+ },
+ {
+ "from": 100
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a0c64894f14d28b7e0c902add71d2e9a.asciidoc b/docs/examples/a0c64894f14d28b7e0c902add71d2e9a.asciidoc
new file mode 100644
index 000000000..ab10f8506
--- /dev/null
+++ b/docs/examples/a0c64894f14d28b7e0c902add71d2e9a.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:511
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "xpack.profiling.templates.enabled": True
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a0c868282c0514a342ad04998cdc2175.asciidoc b/docs/examples/a0c868282c0514a342ad04998cdc2175.asciidoc
index 381085e99..5df569c3f 100644
--- a/docs/examples/a0c868282c0514a342ad04998cdc2175.asciidoc
+++ b/docs/examples/a0c868282c0514a342ad04998cdc2175.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:367
[source, python]
@@ -5,7 +6,9 @@
resp = client.delete_by_query(
index="my-index-000001",
conflicts="proceed",
- body={"query": {"match_all": {}}},
+ query={
+ "match_all": {}
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a0d53dcb3df938fc0a01d248571a41e4.asciidoc b/docs/examples/a0d53dcb3df938fc0a01d248571a41e4.asciidoc
new file mode 100644
index 000000000..3d361d935
--- /dev/null
+++ b/docs/examples/a0d53dcb3df938fc0a01d248571a41e4.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:246
+
+[source, python]
+----
+resp = client.search(
+ runtime_mappings={
+ "price.discounted": {
+ "type": "double",
+ "script": "\n double price = doc['price'].value;\n if (doc['product'].value == 'mad max') {\n price *= 0.8;\n }\n emit(price);\n "
+ }
+ },
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "price": {
+ "histogram": {
+ "interval": 5,
+ "field": "price.discounted"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a0f4e902d18460337684d74ea932fbe9.asciidoc b/docs/examples/a0f4e902d18460337684d74ea932fbe9.asciidoc
index e9aad3ad4..80ed4b788 100644
--- a/docs/examples/a0f4e902d18460337684d74ea932fbe9.asciidoc
+++ b/docs/examples/a0f4e902d18460337684d74ea932fbe9.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:257
[source, python]
@@ -5,7 +6,9 @@
resp = client.update(
index="test",
id="1",
- body={"doc": {"name": "new_name"}},
+ doc={
+ "name": "new_name"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a1070cf2f5969d42d71cda057223f152.asciidoc b/docs/examples/a1070cf2f5969d42d71cda057223f152.asciidoc
new file mode 100644
index 000000000..f00a58f52
--- /dev/null
+++ b/docs/examples/a1070cf2f5969d42d71cda057223f152.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/disk-usage-exceeded.asciidoc:26
+
+[source, python]
+----
+resp = client.cat.shards(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/a1377b32d7fe3680079ae0df73009b0e.asciidoc b/docs/examples/a1377b32d7fe3680079ae0df73009b0e.asciidoc
new file mode 100644
index 000000000..c37c5f8f5
--- /dev/null
+++ b/docs/examples/a1377b32d7fe3680079ae0df73009b0e.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/tophits-aggregation.asciidoc:293
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ query={
+ "term": {
+ "tags": "car"
+ }
+ },
+ aggs={
+ "by_sale": {
+ "nested": {
+ "path": "comments"
+ },
+ "aggs": {
+ "by_user": {
+ "terms": {
+ "field": "comments.username",
+ "size": 1
+ },
+ "aggs": {
+ "by_nested": {
+ "top_hits": {}
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a1490f71d705053951870fd2d3bceb39.asciidoc b/docs/examples/a1490f71d705053951870fd2d3bceb39.asciidoc
new file mode 100644
index 000000000..f1991a05d
--- /dev/null
+++ b/docs/examples/a1490f71d705053951870fd2d3bceb39.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/enabled.asciidoc:99
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "session_data": {
+ "type": "object",
+ "enabled": False
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="session_1",
+ document={
+ "session_data": "foo bar"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/a159143bb578403bb9c7ff37d635d7ad.asciidoc b/docs/examples/a159143bb578403bb9c7ff37d635d7ad.asciidoc
new file mode 100644
index 000000000..a2526d66c
--- /dev/null
+++ b/docs/examples/a159143bb578403bb9c7ff37d635d7ad.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/predicate-tokenfilter.asciidoc:20
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ {
+ "type": "predicate_token_filter",
+ "script": {
+ "source": "\n token.term.length() > 3\n "
+ }
+ }
+ ],
+ text="the fox jumps the lazy dog",
+)
+print(resp)
+----
diff --git a/docs/examples/a159e1ce0cba7a35ce44db9bebad22f3.asciidoc b/docs/examples/a159e1ce0cba7a35ce44db9bebad22f3.asciidoc
new file mode 100644
index 000000000..79193519b
--- /dev/null
+++ b/docs/examples/a159e1ce0cba7a35ce44db9bebad22f3.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// slm/apis/slm-get.asciidoc:126
+
+[source, python]
+----
+resp = client.slm.get_lifecycle()
+print(resp)
+----
diff --git a/docs/examples/a162eb50853331c80596f5994e9d1c38.asciidoc b/docs/examples/a162eb50853331c80596f5994e9d1c38.asciidoc
new file mode 100644
index 000000000..2866e98b4
--- /dev/null
+++ b/docs/examples/a162eb50853331c80596f5994e9d1c38.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:212
+
+[source, python]
+----
+resp = client.search_application.render_query(
+ name="my_search_application",
+ body={
+ "params": {
+ "query_string": "rock climbing"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a180c97f8298fb2388fdcaf7b2e1b81e.asciidoc b/docs/examples/a180c97f8298fb2388fdcaf7b2e1b81e.asciidoc
new file mode 100644
index 000000000..4118ae066
--- /dev/null
+++ b/docs/examples/a180c97f8298fb2388fdcaf7b2e1b81e.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:440
+
+[source, python]
+----
+resp = client.slm.put_lifecycle(
+ policy_id="nightly-snapshots",
+ schedule="0 30 2 * * ?",
+ name="",
+ repository="my_repository",
+ config={
+ "indices": "*",
+ "include_global_state": True,
+ "feature_states": [
+ "kibana",
+ "security"
+ ]
+ },
+ retention={
+ "expire_after": "30d",
+ "min_count": 5,
+ "max_count": 50
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a1879930c1dac36a57d7f094a680420b.asciidoc b/docs/examples/a1879930c1dac36a57d7f094a680420b.asciidoc
new file mode 100644
index 000000000..c83af51dc
--- /dev/null
+++ b/docs/examples/a1879930c1dac36a57d7f094a680420b.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geohashgrid-aggregation.asciidoc:130
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggregations={
+ "zoomed-in": {
+ "filter": {
+ "geo_bounding_box": {
+ "location": {
+ "top_left": "u17",
+ "bottom_right": "u17"
+ }
+ }
+ },
+ "aggregations": {
+ "zoom1": {
+ "geohash_grid": {
+ "field": "location",
+ "precision": 8
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a197076e0e74951ea88f20309ec257e2.asciidoc b/docs/examples/a197076e0e74951ea88f20309ec257e2.asciidoc
new file mode 100644
index 000000000..55e54b0e5
--- /dev/null
+++ b/docs/examples/a197076e0e74951ea88f20309ec257e2.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/condition-tokenfilter.asciidoc:125
+
+[source, python]
+----
+resp = client.indices.create(
+ index="palindrome_list",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_reverse_first_token": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "reverse_first_token"
+ ]
+ }
+ },
+ "filter": {
+ "reverse_first_token": {
+ "type": "condition",
+ "filter": [
+ "reverse"
+ ],
+ "script": {
+ "source": "token.getPosition() === 0"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a1acf454bd6477183ce27ace872deb46.asciidoc b/docs/examples/a1acf454bd6477183ce27ace872deb46.asciidoc
new file mode 100644
index 000000000..87c17934b
--- /dev/null
+++ b/docs/examples/a1acf454bd6477183ce27ace872deb46.asciidoc
@@ -0,0 +1,51 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/field-level-security.asciidoc:169
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="test_role7",
+ indices=[
+ {
+ "names": [
+ "*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "field_security": {
+ "grant": [
+ "a.*"
+ ],
+ "except": [
+ "a.b*"
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.security.put_role(
+ name="test_role8",
+ indices=[
+ {
+ "names": [
+ "*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "field_security": {
+ "grant": [
+ "a.b*"
+ ],
+ "except": [
+ "a.b.c*"
+ ]
+ }
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/a1ccd51eef37e43c935a047b0ee15daa.asciidoc b/docs/examples/a1ccd51eef37e43c935a047b0ee15daa.asciidoc
new file mode 100644
index 000000000..d2ad185f9
--- /dev/null
+++ b/docs/examples/a1ccd51eef37e43c935a047b0ee15daa.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-manual.asciidoc:401
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/a1d0603b24a5b048f0959975d8057534.asciidoc b/docs/examples/a1d0603b24a5b048f0959975d8057534.asciidoc
new file mode 100644
index 000000000..750fec900
--- /dev/null
+++ b/docs/examples/a1d0603b24a5b048f0959975d8057534.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/termvectors.asciidoc:354
+
+[source, python]
+----
+resp = client.termvectors(
+ index="my-index-000001",
+ doc={
+ "fullname": "John Doe",
+ "text": "test test test"
+ },
+ fields=[
+ "fullname"
+ ],
+ per_field_analyzer={
+ "fullname": "keyword"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a1dcc6668d13271c8207ff5ff1d35492.asciidoc b/docs/examples/a1dcc6668d13271c8207ff5ff1d35492.asciidoc
new file mode 100644
index 000000000..4b1cedcc2
--- /dev/null
+++ b/docs/examples/a1dcc6668d13271c8207ff5ff1d35492.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/index-mgmt.asciidoc:215
+
+[source, python]
+----
+resp = client.indices.get(
+ index="my-index-000001,my-index-000002",
+)
+print(resp)
+----
diff --git a/docs/examples/a1e5884051755b5a5f4d7549f319f4c7.asciidoc b/docs/examples/a1e5884051755b5a5f4d7549f319f4c7.asciidoc
new file mode 100644
index 000000000..cebc8b7bc
--- /dev/null
+++ b/docs/examples/a1e5884051755b5a5f4d7549f319f4c7.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/nested-aggregation.asciidoc:13
+
+[source, python]
+----
+resp = client.indices.create(
+ index="products",
+ mappings={
+ "properties": {
+ "resellers": {
+ "type": "nested",
+ "properties": {
+ "reseller": {
+ "type": "keyword"
+ },
+ "price": {
+ "type": "double"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a1e5f3956f9a697e79478fc9a6e30e1f.asciidoc b/docs/examples/a1e5f3956f9a697e79478fc9a6e30e1f.asciidoc
new file mode 100644
index 000000000..dda2eb335
--- /dev/null
+++ b/docs/examples/a1e5f3956f9a697e79478fc9a6e30e1f.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/thai-tokenizer.asciidoc:20
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="thai",
+ text="การที่ได้ต้องแสดงว่างานดี",
+)
+print(resp)
+----
diff --git a/docs/examples/a1f70bc71b763b58206814c40a7440e7.asciidoc b/docs/examples/a1f70bc71b763b58206814c40a7440e7.asciidoc
new file mode 100644
index 000000000..88c3ac6fb
--- /dev/null
+++ b/docs/examples/a1f70bc71b763b58206814c40a7440e7.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/update-settings.asciidoc:41
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_watcher/settings",
+ headers={"Content-Type": "application/json"},
+ body={
+ "index.auto_expand_replicas": "0-4"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a21319c9eff1ac47d7fe7490f1ef2efa.asciidoc b/docs/examples/a21319c9eff1ac47d7fe7490f1ef2efa.asciidoc
new file mode 100644
index 000000000..af833fb3e
--- /dev/null
+++ b/docs/examples/a21319c9eff1ac47d7fe7490f1ef2efa.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/decimal-digit-tokenfilter.asciidoc:20
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "decimal_digit"
+ ],
+ text="१-one two-२ ३",
+)
+print(resp)
+----
diff --git a/docs/examples/a21a7bf052b41f5b996dc58f7b69770f.asciidoc b/docs/examples/a21a7bf052b41f5b996dc58f7b69770f.asciidoc
index d1d61d8fe..721d73fd2 100644
--- a/docs/examples/a21a7bf052b41f5b996dc58f7b69770f.asciidoc
+++ b/docs/examples/a21a7bf052b41f5b996dc58f7b69770f.asciidoc
@@ -1,9 +1,10 @@
-// setup/restart-cluster.asciidoc:54
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:323
[source, python]
----
resp = client.ml.set_upgrade_mode(
- enabled="true",
+ enabled=True,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a225fc8c134cb21a85bc6025dac9368b.asciidoc b/docs/examples/a225fc8c134cb21a85bc6025dac9368b.asciidoc
new file mode 100644
index 000000000..073a56a4e
--- /dev/null
+++ b/docs/examples/a225fc8c134cb21a85bc6025dac9368b.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-task.asciidoc:36
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="sparse_embedding",
+ inference_id="elser_embeddings",
+ inference_config={
+ "service": "elser",
+ "service_settings": {
+ "num_allocations": 1,
+ "num_threads": 1
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a253a1712953f7292bdd646c48ec7fd2.asciidoc b/docs/examples/a253a1712953f7292bdd646c48ec7fd2.asciidoc
new file mode 100644
index 000000000..d5c8decbd
--- /dev/null
+++ b/docs/examples/a253a1712953f7292bdd646c48ec7fd2.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:240
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ sort="@timestamp:desc",
+ size="1",
+)
+print(resp)
+----
diff --git a/docs/examples/a28111cdd9b5aaea96c779cbfbf38780.asciidoc b/docs/examples/a28111cdd9b5aaea96c779cbfbf38780.asciidoc
new file mode 100644
index 000000000..7c06862f7
--- /dev/null
+++ b/docs/examples/a28111cdd9b5aaea96c779cbfbf38780.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:482
+
+[source, python]
+----
+resp = client.indices.create(
+ index="czech_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "czech_stop": {
+ "type": "stop",
+ "stopwords": "_czech_"
+ },
+ "czech_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "příklad"
+ ]
+ },
+ "czech_stemmer": {
+ "type": "stemmer",
+ "language": "czech"
+ }
+ },
+ "analyzer": {
+ "rebuilt_czech": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "czech_stop",
+ "czech_keywords",
+ "czech_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a2abd6b6b6b6df7c574a557b5468b5e1.asciidoc b/docs/examples/a2abd6b6b6b6df7c574a557b5468b5e1.asciidoc
new file mode 100644
index 000000000..a4e85817b
--- /dev/null
+++ b/docs/examples/a2abd6b6b6b6df7c574a557b5468b5e1.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/highlighting-multi-fields.asciidoc:191
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index2",
+ mappings={
+ "properties": {
+ "comment": {
+ "type": "text",
+ "analyzer": "standard",
+ "term_vector": "with_positions_offsets",
+ "fields": {
+ "english": {
+ "type": "text",
+ "analyzer": "english",
+ "term_vector": "with_positions_offsets"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a2b2ce031120dac49b5120b26eea8758.asciidoc b/docs/examples/a2b2ce031120dac49b5120b26eea8758.asciidoc
index 23ad3259a..d90984516 100644
--- a/docs/examples/a2b2ce031120dac49b5120b26eea8758.asciidoc
+++ b/docs/examples/a2b2ce031120dac49b5120b26eea8758.asciidoc
@@ -1,11 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// cat/indices.asciidoc:109
[source, python]
----
resp = client.cat.indices(
index="my-index-*",
- v="true",
+ v=True,
s="index",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a2bab367f0e598ae27a2f4ec82e778e9.asciidoc b/docs/examples/a2bab367f0e598ae27a2f4ec82e778e9.asciidoc
new file mode 100644
index 000000000..0d6aa28ec
--- /dev/null
+++ b/docs/examples/a2bab367f0e598ae27a2f4ec82e778e9.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/migrating-to-downsampling.asciidoc:25
+
+[source, python]
+----
+resp = client.rollup.put_job(
+ id="sensor",
+ index_pattern="sensor-*",
+ rollup_index="sensor_rollup",
+ cron="0 0 * * * *",
+ page_size=1000,
+ groups={
+ "date_histogram": {
+ "field": "timestamp",
+ "fixed_interval": "60m"
+ },
+ "terms": {
+ "fields": [
+ "node"
+ ]
+ }
+ },
+ metrics=[
+ {
+ "field": "temperature",
+ "metrics": [
+ "min",
+ "max",
+ "sum"
+ ]
+ },
+ {
+ "field": "voltage",
+ "metrics": [
+ "avg"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/a2bd0782aadfd0a902d7f590ee7f49fe.asciidoc b/docs/examples/a2bd0782aadfd0a902d7f590ee7f49fe.asciidoc
new file mode 100644
index 000000000..077f19948
--- /dev/null
+++ b/docs/examples/a2bd0782aadfd0a902d7f590ee7f49fe.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-elser.asciidoc:44
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index",
+ mappings={
+ "properties": {
+ "content_embedding": {
+ "type": "sparse_vector"
+ },
+ "content": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a2c3e284354e8d49cf51bb8dd5ef3613.asciidoc b/docs/examples/a2c3e284354e8d49cf51bb8dd5ef3613.asciidoc
new file mode 100644
index 000000000..90db588fa
--- /dev/null
+++ b/docs/examples/a2c3e284354e8d49cf51bb8dd5ef3613.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/upgrade-transforms.asciidoc:97
+
+[source, python]
+----
+resp = client.transform.upgrade_transforms()
+print(resp)
+----
diff --git a/docs/examples/a2dabdcbb661e7690166ae6d0de27e46.asciidoc b/docs/examples/a2dabdcbb661e7690166ae6d0de27e46.asciidoc
index 0651bff53..7635f210c 100644
--- a/docs/examples/a2dabdcbb661e7690166ae6d0de27e46.asciidoc
+++ b/docs/examples/a2dabdcbb661e7690166ae6d0de27e46.asciidoc
@@ -1,10 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/alias.asciidoc:55
[source, python]
----
resp = client.field_caps(
index="trips",
- fields=["route_*", "transit_mode"],
+ fields="route_*,transit_mode",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a322c8c73d6f2f5e1e375588ed20b636.asciidoc b/docs/examples/a322c8c73d6f2f5e1e375588ed20b636.asciidoc
new file mode 100644
index 000000000..f8d8cf190
--- /dev/null
+++ b/docs/examples/a322c8c73d6f2f5e1e375588ed20b636.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/remote-clusters-privileges-cert.asciidoc:149
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="remote-search",
+ indices=[
+ {
+ "names": [
+ "target-indices"
+ ],
+ "privileges": [
+ "read",
+ "read_cross_cluster"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/a325f31e94fb1e8739258910593504a8.asciidoc b/docs/examples/a325f31e94fb1e8739258910593504a8.asciidoc
new file mode 100644
index 000000000..a872a5abf
--- /dev/null
+++ b/docs/examples/a325f31e94fb1e8739258910593504a8.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/oidc-guide.asciidoc:610
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="facilitator-role",
+ cluster=[
+ "manage_oidc",
+ "manage_token"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/a3464bd6f0a61623562162859566b078.asciidoc b/docs/examples/a3464bd6f0a61623562162859566b078.asciidoc
new file mode 100644
index 000000000..c7ccb3807
--- /dev/null
+++ b/docs/examples/a3464bd6f0a61623562162859566b078.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/uni-directional-disaster-recovery.asciidoc:75
+
+[source, python]
+----
+resp = client.ccr.follow(
+ index="kibana_sample_data_ecommerce2",
+ wait_for_active_shards="1",
+ remote_cluster="clusterA",
+ leader_index="kibana_sample_data_ecommerce",
+)
+print(resp)
+----
diff --git a/docs/examples/a34d70d7022eb4ba48909d440c80390f.asciidoc b/docs/examples/a34d70d7022eb4ba48909d440c80390f.asciidoc
index 1fad28d92..455bb7f77 100644
--- a/docs/examples/a34d70d7022eb4ba48909d440c80390f.asciidoc
+++ b/docs/examples/a34d70d7022eb4ba48909d440c80390f.asciidoc
@@ -1,14 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// api-conventions.asciidoc:164
[source, python]
----
resp = client.search(
- index=[
- "",
- "",
- "",
- ],
- body={"query": {"match": {"test": "data"}}},
+ index=",,",
+ query={
+ "match": {
+ "test": "data"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a34e758e019f563d323ca90ad9fd6e3e.asciidoc b/docs/examples/a34e758e019f563d323ca90ad9fd6e3e.asciidoc
new file mode 100644
index 000000000..366706ece
--- /dev/null
+++ b/docs/examples/a34e758e019f563d323ca90ad9fd6e3e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:266
+
+[source, python]
+----
+resp = client.indices.get_alias(
+ index="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/a38f29375eabd0103f8d7c00b17bb0ab.asciidoc b/docs/examples/a38f29375eabd0103f8d7c00b17bb0ab.asciidoc
index e1993c2d3..6b055d99b 100644
--- a/docs/examples/a38f29375eabd0103f8d7c00b17bb0ab.asciidoc
+++ b/docs/examples/a38f29375eabd0103f8d7c00b17bb0ab.asciidoc
@@ -1,7 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/allocation/delayed.asciidoc:82
[source, python]
----
resp = client.cluster.health()
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a3a14f7f0e80725f695a901a7e1d579d.asciidoc b/docs/examples/a3a14f7f0e80725f695a901a7e1d579d.asciidoc
new file mode 100644
index 000000000..48212d2f4
--- /dev/null
+++ b/docs/examples/a3a14f7f0e80725f695a901a7e1d579d.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/trim-tokenfilter.asciidoc:65
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="keyword",
+ filter=[
+ "trim"
+ ],
+ text=" fox ",
+)
+print(resp)
+----
diff --git a/docs/examples/a3a2856ac2338a624a1fa5f31aec4db4.asciidoc b/docs/examples/a3a2856ac2338a624a1fa5f31aec4db4.asciidoc
new file mode 100644
index 000000000..638ba69a9
--- /dev/null
+++ b/docs/examples/a3a2856ac2338a624a1fa5f31aec4db4.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:92
+
+[source, python]
+----
+resp = client.security.create_api_key(
+ name="my-api-key",
+ role_descriptors={},
+ metadata={
+ "application": "myapp"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a3a64d568fe93a22b042a8b31b9905b0.asciidoc b/docs/examples/a3a64d568fe93a22b042a8b31b9905b0.asciidoc
new file mode 100644
index 000000000..f03b8da79
--- /dev/null
+++ b/docs/examples/a3a64d568fe93a22b042a8b31b9905b0.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/simulate-pipeline.asciidoc:303
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ verbose=True,
+ pipeline={
+ "description": "_description",
+ "processors": [
+ {
+ "set": {
+ "field": "field2",
+ "value": "_value2"
+ }
+ },
+ {
+ "set": {
+ "field": "field3",
+ "value": "_value3"
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_index": "index",
+ "_id": "id",
+ "_source": {
+ "foo": "bar"
+ }
+ },
+ {
+ "_index": "index",
+ "_id": "id",
+ "_source": {
+ "foo": "rab"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/a3c8f474b0700711a356682f37e62b39.asciidoc b/docs/examples/a3c8f474b0700711a356682f37e62b39.asciidoc
new file mode 100644
index 000000000..08044f55d
--- /dev/null
+++ b/docs/examples/a3c8f474b0700711a356682f37e62b39.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-mapping.asciidoc:174
+
+[source, python]
+----
+resp = client.indices.create(
+ index="azure-ai-studio-embeddings",
+ mappings={
+ "properties": {
+ "content_embedding": {
+ "type": "dense_vector",
+ "dims": 1536,
+ "element_type": "float",
+ "similarity": "dot_product"
+ },
+ "content": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a3ce0cfe2176f3d8a36959a5916995f0.asciidoc b/docs/examples/a3ce0cfe2176f3d8a36959a5916995f0.asciidoc
new file mode 100644
index 000000000..d332c6b9c
--- /dev/null
+++ b/docs/examples/a3ce0cfe2176f3d8a36959a5916995f0.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/tasks.asciidoc:277
+
+[source, python]
+----
+resp = client.tasks.list(
+ group_by="none",
+)
+print(resp)
+----
diff --git a/docs/examples/a3cfd350c73a104b99a998c6be931408.asciidoc b/docs/examples/a3cfd350c73a104b99a998c6be931408.asciidoc
new file mode 100644
index 000000000..b2548ae41
--- /dev/null
+++ b/docs/examples/a3cfd350c73a104b99a998c6be931408.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/state.asciidoc:158
+
+[source, python]
+----
+resp = client.cluster.state(
+ metric="blocks",
+)
+print(resp)
+----
diff --git a/docs/examples/a3d13833714f9bb918e5e0f62a49bd0e.asciidoc b/docs/examples/a3d13833714f9bb918e5e0f62a49bd0e.asciidoc
new file mode 100644
index 000000000..d04856456
--- /dev/null
+++ b/docs/examples/a3d13833714f9bb918e5e0f62a49bd0e.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/iprange-aggregation.asciidoc:114
+
+[source, python]
+----
+resp = client.search(
+ index="ip_addresses",
+ size=0,
+ aggs={
+ "ip_ranges": {
+ "ip_range": {
+ "field": "ip",
+ "ranges": [
+ {
+ "to": "10.0.0.5"
+ },
+ {
+ "from": "10.0.0.5"
+ }
+ ],
+ "keyed": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a3d943ac9d45b4eff4aa0c679b4eceb3.asciidoc b/docs/examples/a3d943ac9d45b4eff4aa0c679b4eceb3.asciidoc
new file mode 100644
index 000000000..9ac1d1d70
--- /dev/null
+++ b/docs/examples/a3d943ac9d45b4eff4aa0c679b4eceb3.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/dangling-index-import.asciidoc:13
+
+[source, python]
+----
+resp = client.dangling_indices.import_dangling_index(
+ index_uuid="",
+ accept_data_loss=True,
+)
+print(resp)
+----
diff --git a/docs/examples/a3e79d6c626a490341c5b731acbb4a5d.asciidoc b/docs/examples/a3e79d6c626a490341c5b731acbb4a5d.asciidoc
index cd3470669..9c4fef882 100644
--- a/docs/examples/a3e79d6c626a490341c5b731acbb4a5d.asciidoc
+++ b/docs/examples/a3e79d6c626a490341c5b731acbb4a5d.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:307
[source, python]
@@ -7,4 +8,4 @@ resp = client.exists_source(
id="1",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a3f19f3787cb331f230cdac67ff578e8.asciidoc b/docs/examples/a3f19f3787cb331f230cdac67ff578e8.asciidoc
new file mode 100644
index 000000000..5927d5274
--- /dev/null
+++ b/docs/examples/a3f19f3787cb331f230cdac67ff578e8.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significantterms-aggregation.asciidoc:660
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "tags": {
+ "significant_terms": {
+ "field": "tags",
+ "execution_hint": "map"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a3f3c1f3f31dbd225da5fd14633bc4a0.asciidoc b/docs/examples/a3f3c1f3f31dbd225da5fd14633bc4a0.asciidoc
new file mode 100644
index 000000000..740462377
--- /dev/null
+++ b/docs/examples/a3f3c1f3f31dbd225da5fd14633bc4a0.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/geo-match-enrich-policy-type-ex.asciidoc:131
+
+[source, python]
+----
+resp = client.get(
+ index="users",
+ id="0",
+)
+print(resp)
+----
diff --git a/docs/examples/a3f56fa16c6cc67c2db31a4ba9ca11a7.asciidoc b/docs/examples/a3f56fa16c6cc67c2db31a4ba9ca11a7.asciidoc
new file mode 100644
index 000000000..cd7724103
--- /dev/null
+++ b/docs/examples/a3f56fa16c6cc67c2db31a4ba9ca11a7.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/range-enrich-policy-type-ex.asciidoc:56
+
+[source, python]
+----
+resp = client.enrich.put_policy(
+ name="networks-policy",
+ range={
+ "indices": "networks",
+ "match_field": "range",
+ "enrich_fields": [
+ "name",
+ "department"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a3f66deb467df86edbf66e1dca31da51.asciidoc b/docs/examples/a3f66deb467df86edbf66e1dca31da51.asciidoc
new file mode 100644
index 000000000..c3c901bdd
--- /dev/null
+++ b/docs/examples/a3f66deb467df86edbf66e1dca31da51.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/completion-suggest.asciidoc:189
+
+[source, python]
+----
+resp = client.search(
+ index="music",
+ source="suggest",
+ suggest={
+ "song-suggest": {
+ "prefix": "nir",
+ "completion": {
+ "field": "suggest",
+ "size": 5
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a412fe22a74900c72434391ed75139dc.asciidoc b/docs/examples/a412fe22a74900c72434391ed75139dc.asciidoc
new file mode 100644
index 000000000..c40fe6a30
--- /dev/null
+++ b/docs/examples/a412fe22a74900c72434391ed75139dc.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geohexgrid-aggregation.asciidoc:105
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggregations={
+ "zoomed-in": {
+ "filter": {
+ "geo_bounding_box": {
+ "location": {
+ "top_left": "POINT (4.9 52.4)",
+ "bottom_right": "POINT (5.0 52.3)"
+ }
+ }
+ },
+ "aggregations": {
+ "zoom1": {
+ "geohex_grid": {
+ "field": "location",
+ "precision": 12
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a425fcab60f603504becee7d001f0a4b.asciidoc b/docs/examples/a425fcab60f603504becee7d001f0a4b.asciidoc
index b027e718f..0be0bcc61 100644
--- a/docs/examples/a425fcab60f603504becee7d001f0a4b.asciidoc
+++ b/docs/examples/a425fcab60f603504becee7d001f0a4b.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/allocation/prioritization.asciidoc:48
[source, python]
----
resp = client.indices.put_settings(
index="index_4",
- body={"index.priority": 1},
+ settings={
+ "index.priority": 1
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a428d518162918733d49261ffd65cfc1.asciidoc b/docs/examples/a428d518162918733d49261ffd65cfc1.asciidoc
new file mode 100644
index 000000000..878b0645f
--- /dev/null
+++ b/docs/examples/a428d518162918733d49261ffd65cfc1.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/unique-tokenfilter.asciidoc:95
+
+[source, python]
+----
+resp = client.indices.create(
+ index="custom_unique_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_truncate": {
+ "tokenizer": "standard",
+ "filter": [
+ "unique"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a43954d055f042d625a905513821f5f0.asciidoc b/docs/examples/a43954d055f042d625a905513821f5f0.asciidoc
new file mode 100644
index 000000000..f13c8770a
--- /dev/null
+++ b/docs/examples/a43954d055f042d625a905513821f5f0.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:824
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my_search_application",
+ params={
+ "knn_field": "image-vector",
+ "query_vector": [
+ -5,
+ 9,
+ -12
+ ],
+ "k": 10,
+ "num_candidates": 100,
+ "fields": [
+ "title",
+ "file-type"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a45244aa3adbf3c793fede100786d1f5.asciidoc b/docs/examples/a45244aa3adbf3c793fede100786d1f5.asciidoc
new file mode 100644
index 000000000..e8b4740be
--- /dev/null
+++ b/docs/examples/a45244aa3adbf3c793fede100786d1f5.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/autodatehistogram-aggregation.asciidoc:17
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "sales_over_time": {
+ "auto_date_histogram": {
+ "field": "date",
+ "buckets": 10
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a45605347d6438e7aecdf3b37198616d.asciidoc b/docs/examples/a45605347d6438e7aecdf3b37198616d.asciidoc
new file mode 100644
index 000000000..7f083b5a2
--- /dev/null
+++ b/docs/examples/a45605347d6438e7aecdf3b37198616d.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/apis/move-to-step.asciidoc:150
+
+[source, python]
+----
+resp = client.ilm.move_to_step(
+ index="my-index-000001",
+ current_step={
+ "phase": "new",
+ "action": "complete",
+ "name": "complete"
+ },
+ next_step={
+ "phase": "warm",
+ "action": "forcemerge",
+ "name": "forcemerge"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a45810722dc4f468f81b1e8a451d21be.asciidoc b/docs/examples/a45810722dc4f468f81b1e8a451d21be.asciidoc
new file mode 100644
index 000000000..9aea04f43
--- /dev/null
+++ b/docs/examples/a45810722dc4f468f81b1e8a451d21be.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/network/tracers.asciidoc:16
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "logger.org.elasticsearch.http.HttpTracer": "TRACE"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a45d80a3fdba70c1b1ba493e51652c8a.asciidoc b/docs/examples/a45d80a3fdba70c1b1ba493e51652c8a.asciidoc
index 681a9f425..746544d21 100644
--- a/docs/examples/a45d80a3fdba70c1b1ba493e51652c8a.asciidoc
+++ b/docs/examples/a45d80a3fdba70c1b1ba493e51652c8a.asciidoc
@@ -1,15 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:284
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "multipoint",
- "coordinates": [[1002, 1002], [1003, 2000]],
+ "coordinates": [
+ [
+ 1002,
+ 1002
+ ],
+ [
+ 1003,
+ 2000
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a45eb0cdd138d9c894ca2de9352549a1.asciidoc b/docs/examples/a45eb0cdd138d9c894ca2de9352549a1.asciidoc
new file mode 100644
index 000000000..571f0b9ea
--- /dev/null
+++ b/docs/examples/a45eb0cdd138d9c894ca2de9352549a1.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/getting-started.asciidoc:27
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="log_error_watch",
+ trigger={
+ "schedule": {
+ "interval": "10s"
+ }
+ },
+ input={
+ "search": {
+ "request": {
+ "indices": [
+ "logs"
+ ],
+ "body": {
+ "query": {
+ "match": {
+ "message": "error"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a49acb27f56fe799a9b1342f85cba0f3.asciidoc b/docs/examples/a49acb27f56fe799a9b1342f85cba0f3.asciidoc
new file mode 100644
index 000000000..b0088d7e7
--- /dev/null
+++ b/docs/examples/a49acb27f56fe799a9b1342f85cba0f3.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/word-delimiter-graph-tokenfilter.asciidoc:137
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "keyword",
+ "filter": [
+ "word_delimiter_graph"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc b/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc
index e0ecce9bb..cc4db4e1d 100644
--- a/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc
+++ b/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// inference/get-inference.asciidoc:73
[source, python]
@@ -7,4 +8,4 @@ resp = client.inference.get(
inference_id="my-elser-model",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a4bae4d956bc0a663f42cfec36bf8e0b.asciidoc b/docs/examples/a4bae4d956bc0a663f42cfec36bf8e0b.asciidoc
new file mode 100644
index 000000000..f59a96738
--- /dev/null
+++ b/docs/examples/a4bae4d956bc0a663f42cfec36bf8e0b.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:150
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index",
+ mappings={
+ "properties": {
+ "price_range": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="index",
+ id="1",
+ document={
+ "designation": "spoon",
+ "price": 13,
+ "price_range": "10-100"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/a4bd9bf52b4f098838d12bcb8dfc3482.asciidoc b/docs/examples/a4bd9bf52b4f098838d12bcb8dfc3482.asciidoc
new file mode 100644
index 000000000..4f220977c
--- /dev/null
+++ b/docs/examples/a4bd9bf52b4f098838d12bcb8dfc3482.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/min-bucket-aggregation.asciidoc:42
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "min_monthly_sales": {
+ "min_bucket": {
+ "buckets_path": "sales_per_month>sales"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a4dbd52004f3ab1580eb73997f77dcab.asciidoc b/docs/examples/a4dbd52004f3ab1580eb73997f77dcab.asciidoc
new file mode 100644
index 000000000..5237c37d4
--- /dev/null
+++ b/docs/examples/a4dbd52004f3ab1580eb73997f77dcab.asciidoc
@@ -0,0 +1,64 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/ecommerce-tutorial.asciidoc:165
+
+[source, python]
+----
+resp = client.transform.put_transform(
+ transform_id="ecommerce-customer-transform",
+ source={
+ "index": [
+ "kibana_sample_data_ecommerce"
+ ],
+ "query": {
+ "bool": {
+ "filter": {
+ "term": {
+ "currency": "EUR"
+ }
+ }
+ }
+ }
+ },
+ pivot={
+ "group_by": {
+ "customer_id": {
+ "terms": {
+ "field": "customer_id"
+ }
+ }
+ },
+ "aggregations": {
+ "total_quantity.sum": {
+ "sum": {
+ "field": "total_quantity"
+ }
+ },
+ "taxless_total_price.sum": {
+ "sum": {
+ "field": "taxless_total_price"
+ }
+ },
+ "total_quantity.max": {
+ "max": {
+ "field": "total_quantity"
+ }
+ },
+ "order_id.cardinality": {
+ "cardinality": {
+ "field": "order_id"
+ }
+ }
+ }
+ },
+ dest={
+ "index": "ecommerce-customers"
+ },
+ retention_policy={
+ "time": {
+ "field": "order_date",
+ "max_age": "60d"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a4e510aa9145ccedae151c4a6634f0a4.asciidoc b/docs/examples/a4e510aa9145ccedae151c4a6634f0a4.asciidoc
new file mode 100644
index 000000000..2a347c566
--- /dev/null
+++ b/docs/examples/a4e510aa9145ccedae151c4a6634f0a4.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/stemmer-tokenfilter.asciidoc:23
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "stemmer"
+ ],
+ text="the foxes jumping quickly",
+)
+print(resp)
+----
diff --git a/docs/examples/a4ec42130f3c75fc9d1d5f7cb6222cd5.asciidoc b/docs/examples/a4ec42130f3c75fc9d1d5f7cb6222cd5.asciidoc
new file mode 100644
index 000000000..8f5158ccc
--- /dev/null
+++ b/docs/examples/a4ec42130f3c75fc9d1d5f7cb6222cd5.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/histogram-aggregation.asciidoc:164
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ query={
+ "constant_score": {
+ "filter": {
+ "range": {
+ "price": {
+ "to": "500"
+ }
+ }
+ }
+ }
+ },
+ aggs={
+ "prices": {
+ "histogram": {
+ "field": "price",
+ "interval": 50,
+ "extended_bounds": {
+ "min": 0,
+ "max": 500
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a4ee2214d621bcfaf768c46d21325958.asciidoc b/docs/examples/a4ee2214d621bcfaf768c46d21325958.asciidoc
new file mode 100644
index 000000000..7c2c97f72
--- /dev/null
+++ b/docs/examples/a4ee2214d621bcfaf768c46d21325958.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-task.asciidoc:66
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="hugging_face_embeddings",
+ inference_config={
+ "service": "hugging_face",
+ "service_settings": {
+ "api_key": "",
+ "url": ""
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a4f259522b4dc10a0323aff58236c2c2.asciidoc b/docs/examples/a4f259522b4dc10a0323aff58236c2c2.asciidoc
new file mode 100644
index 000000000..835f713e8
--- /dev/null
+++ b/docs/examples/a4f259522b4dc10a0323aff58236c2c2.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/completion-suggest.asciidoc:47
+
+[source, python]
+----
+resp = client.index(
+ index="music",
+ id="1",
+ refresh=True,
+ document={
+ "suggest": {
+ "input": [
+ "Nevermind",
+ "Nirvana"
+ ],
+ "weight": 34
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a512e4dd8880ce0395937db1bab1d205.asciidoc b/docs/examples/a512e4dd8880ce0395937db1bab1d205.asciidoc
new file mode 100644
index 000000000..f0ee73277
--- /dev/null
+++ b/docs/examples/a512e4dd8880ce0395937db1bab1d205.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/edgengram-tokenizer.asciidoc:28
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="edge_ngram",
+ text="Quick Fox",
+)
+print(resp)
+----
diff --git a/docs/examples/a520168c1c8b454a8f102d6a13027c73.asciidoc b/docs/examples/a520168c1c8b454a8f102d6a13027c73.asciidoc
new file mode 100644
index 000000000..41527cb83
--- /dev/null
+++ b/docs/examples/a520168c1c8b454a8f102d6a13027c73.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/get-follow-info.asciidoc:143
+
+[source, python]
+----
+resp = client.ccr.follow_info(
+ index="follower_index",
+)
+print(resp)
+----
diff --git a/docs/examples/a5217a93efabceee9be19949e484f930.asciidoc b/docs/examples/a5217a93efabceee9be19949e484f930.asciidoc
new file mode 100644
index 000000000..4503a9a7b
--- /dev/null
+++ b/docs/examples/a5217a93efabceee9be19949e484f930.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/completion-suggest.asciidoc:83
+
+[source, python]
+----
+resp = client.index(
+ index="music",
+ id="1",
+ refresh=True,
+ document={
+ "suggest": [
+ {
+ "input": "Nevermind",
+ "weight": 10
+ },
+ {
+ "input": "Nirvana",
+ "weight": 3
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a53ff77d83222c0e76453e630d64787e.asciidoc b/docs/examples/a53ff77d83222c0e76453e630d64787e.asciidoc
new file mode 100644
index 000000000..52aeed34e
--- /dev/null
+++ b/docs/examples/a53ff77d83222c0e76453e630d64787e.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc:93
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="openai_embeddings",
+ processors=[
+ {
+ "inference": {
+ "model_id": "openai_embeddings",
+ "input_output": {
+ "input_field": "content",
+ "output_field": "content_embedding"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/a547bb926c25f670078b98fbe67de3cc.asciidoc b/docs/examples/a547bb926c25f670078b98fbe67de3cc.asciidoc
new file mode 100644
index 000000000..335b78c15
--- /dev/null
+++ b/docs/examples/a547bb926c25f670078b98fbe67de3cc.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// synonyms/apis/delete-synonym-rule.asciidoc:103
+
+[source, python]
+----
+resp = client.synonyms.delete_synonym_rule(
+ set_id="my-synonyms-set",
+ rule_id="test-1",
+)
+print(resp)
+----
diff --git a/docs/examples/a56c20a733a350673d41829c8daaafbe.asciidoc b/docs/examples/a56c20a733a350673d41829c8daaafbe.asciidoc
new file mode 100644
index 000000000..5908fcffa
--- /dev/null
+++ b/docs/examples/a56c20a733a350673d41829c8daaafbe.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/deciders/fixed-decider.asciidoc:37
+
+[source, python]
+----
+resp = client.autoscaling.put_autoscaling_policy(
+ name="my_autoscaling_policy",
+ policy={
+ "roles": [
+ "data_hot"
+ ],
+ "deciders": {
+ "fixed": {
+ "storage": "1tb",
+ "memory": "32gb",
+ "processors": 2.3,
+ "nodes": 8
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a594f05459d9eecc8050c73fc8da336f.asciidoc b/docs/examples/a594f05459d9eecc8050c73fc8da336f.asciidoc
new file mode 100644
index 000000000..c714c6bd4
--- /dev/null
+++ b/docs/examples/a594f05459d9eecc8050c73fc8da336f.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-task.asciidoc:121
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="azure_openai_embeddings",
+ inference_config={
+ "service": "azureopenai",
+ "service_settings": {
+ "api_key": "",
+ "resource_name": "",
+ "deployment_id": "",
+ "api_version": "2024-02-01"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a5a58e8ad66afe831bc295500e3e8739.asciidoc b/docs/examples/a5a58e8ad66afe831bc295500e3e8739.asciidoc
new file mode 100644
index 000000000..4477668b9
--- /dev/null
+++ b/docs/examples/a5a58e8ad66afe831bc295500e3e8739.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-unfollow.asciidoc:45
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "unfollow": {}
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a5a5fb129de2f492e8fd33043a73439c.asciidoc b/docs/examples/a5a5fb129de2f492e8fd33043a73439c.asciidoc
new file mode 100644
index 000000000..1ba1ead69
--- /dev/null
+++ b/docs/examples/a5a5fb129de2f492e8fd33043a73439c.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/dictionary-decompounder-tokenfilter.asciidoc:152
+
+[source, python]
+----
+resp = client.indices.create(
+ index="dictionary_decompound_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_dictionary_decompound": {
+ "tokenizer": "standard",
+ "filter": [
+ "22_char_dictionary_decompound"
+ ]
+ }
+ },
+ "filter": {
+ "22_char_dictionary_decompound": {
+ "type": "dictionary_decompounder",
+ "word_list_path": "analysis/example_word_list.txt",
+ "max_subword_size": 22
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a5b59f0170a2feaa39e40243fd7ae359.asciidoc b/docs/examples/a5b59f0170a2feaa39e40243fd7ae359.asciidoc
new file mode 100644
index 000000000..cbb160abe
--- /dev/null
+++ b/docs/examples/a5b59f0170a2feaa39e40243fd7ae359.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-client.asciidoc:196
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my-example-app",
+ search_application={
+ "indices": [
+ "my-example-app"
+ ],
+ "template": {
+ "script": {
+ "lang": "mustache",
+ "source": "\n {\n \"query\": {\n \"bool\": {\n \"must\": [\n {{#query}}\n {\n \"query_string\": {\n \"query\": \"{{query}}\",\n \"search_fields\": {{#toJson}}search_fields{{/toJson}}\n }\n }\n {{/query}}\n ]\n }\n }\n }\n ",
+ "params": {
+ "query": "",
+ "search_fields": ""
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a5dfcfd1cfb3558e7912456669c92eee.asciidoc b/docs/examples/a5dfcfd1cfb3558e7912456669c92eee.asciidoc
new file mode 100644
index 000000000..c1c77e7c9
--- /dev/null
+++ b/docs/examples/a5dfcfd1cfb3558e7912456669c92eee.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/saml-prepare-authentication-api.asciidoc:79
+
+[source, python]
+----
+resp = client.security.saml_prepare_authentication(
+ realm="saml1",
+)
+print(resp)
+----
diff --git a/docs/examples/a5e2b3588258430f2e595abda98e3943.asciidoc b/docs/examples/a5e2b3588258430f2e595abda98e3943.asciidoc
new file mode 100644
index 000000000..c3786c06d
--- /dev/null
+++ b/docs/examples/a5e2b3588258430f2e595abda98e3943.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-cache.asciidoc:54
+
+[source, python]
+----
+resp = client.security.clear_cached_realms(
+ realms="default_file",
+)
+print(resp)
+----
diff --git a/docs/examples/a5e6ad9e65615f6f92ae6a19674dd742.asciidoc b/docs/examples/a5e6ad9e65615f6f92ae6a19674dd742.asciidoc
new file mode 100644
index 000000000..35d77326c
--- /dev/null
+++ b/docs/examples/a5e6ad9e65615f6f92ae6a19674dd742.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:595
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "percolate": {
+ "field": "query",
+ "documents": [
+ {
+ "message": "Japanse art"
+ },
+ {
+ "message": "Holand culture"
+ },
+ {
+ "message": "Japanese art and Holand culture"
+ },
+ {
+ "message": "no-match"
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a5e6ccfb6019238e6db602373b9af147.asciidoc b/docs/examples/a5e6ccfb6019238e6db602373b9af147.asciidoc
new file mode 100644
index 000000000..80b38ccbe
--- /dev/null
+++ b/docs/examples/a5e6ccfb6019238e6db602373b9af147.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-manage-existing-data-stream.asciidoc:19
+
+[source, python]
+----
+resp = client.indices.put_data_lifecycle(
+ name="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/a5e793d82a4455cf4105dac82a156617.asciidoc b/docs/examples/a5e793d82a4455cf4105dac82a156617.asciidoc
new file mode 100644
index 000000000..36414e53b
--- /dev/null
+++ b/docs/examples/a5e793d82a4455cf4105dac82a156617.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// search/validate.asciidoc:208
+
+[source, python]
+----
+resp = client.indices.validate_query(
+ index="my-index-000001",
+ rewrite=True,
+ query={
+ "more_like_this": {
+ "like": {
+ "_id": "2"
+ },
+ "boost_terms": 1
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a5ebcd70c34d1ece77a4fb27cc050917.asciidoc b/docs/examples/a5ebcd70c34d1ece77a4fb27cc050917.asciidoc
new file mode 100644
index 000000000..47f941833
--- /dev/null
+++ b/docs/examples/a5ebcd70c34d1ece77a4fb27cc050917.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-rank-aggregation.asciidoc:76
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_ranks": {
+ "percentile_ranks": {
+ "field": "load_time",
+ "values": [
+ 500,
+ 600
+ ],
+ "keyed": False
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a5f9eb40087921e67d820775acf71522.asciidoc b/docs/examples/a5f9eb40087921e67d820775acf71522.asciidoc
index 5d1605a99..77b52e796 100644
--- a/docs/examples/a5f9eb40087921e67d820775acf71522.asciidoc
+++ b/docs/examples/a5f9eb40087921e67d820775acf71522.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:212
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"city": {"type": "text"}}}},
+ mappings={
+ "properties": {
+ "city": {
+ "type": "text"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a6169bc057ce8654bd306ff4b062081b.asciidoc b/docs/examples/a6169bc057ce8654bd306ff4b062081b.asciidoc
new file mode 100644
index 000000000..8c85db108
--- /dev/null
+++ b/docs/examples/a6169bc057ce8654bd306ff4b062081b.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/completion-suggest.asciidoc:279
+
+[source, python]
+----
+resp = client.search(
+ index="music",
+ pretty=True,
+ suggest={
+ "song-suggest": {
+ "prefix": "nor",
+ "completion": {
+ "field": "suggest",
+ "skip_duplicates": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a6204edaa0bcf7b82a89ab4f6bda0914.asciidoc b/docs/examples/a6204edaa0bcf7b82a89ab4f6bda0914.asciidoc
new file mode 100644
index 000000000..b1ada6b8c
--- /dev/null
+++ b/docs/examples/a6204edaa0bcf7b82a89ab4f6bda0914.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/open-job.asciidoc:68
+
+[source, python]
+----
+resp = client.ml.open_job(
+ job_id="low_request_rate",
+ timeout="35m",
+)
+print(resp)
+----
diff --git a/docs/examples/a62833baf15f2c9ac094a9289e56a012.asciidoc b/docs/examples/a62833baf15f2c9ac094a9289e56a012.asciidoc
new file mode 100644
index 000000000..e42385b81
--- /dev/null
+++ b/docs/examples/a62833baf15f2c9ac094a9289e56a012.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/ilm-tutorial.asciidoc:166
+
+[source, python]
+----
+resp = client.index(
+ index="timeseries",
+ document={
+ "message": "logged the request",
+ "@timestamp": "1591890611"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a63e0d0504e0c9313814b7f4e2641353.asciidoc b/docs/examples/a63e0d0504e0c9313814b7f4e2641353.asciidoc
new file mode 100644
index 000000000..e4416424e
--- /dev/null
+++ b/docs/examples/a63e0d0504e0c9313814b7f4e2641353.asciidoc
@@ -0,0 +1,106 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/range-aggregation.asciidoc:340
+
+[source, python]
+----
+resp = client.indices.create(
+ index="metrics_index",
+ mappings={
+ "properties": {
+ "network": {
+ "properties": {
+ "name": {
+ "type": "keyword"
+ }
+ }
+ },
+ "latency_histo": {
+ "type": "histogram"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="metrics_index",
+ id="1",
+ refresh=True,
+ document={
+ "network.name": "net-1",
+ "latency_histo": {
+ "values": [
+ 1,
+ 3,
+ 8,
+ 12,
+ 15
+ ],
+ "counts": [
+ 3,
+ 7,
+ 23,
+ 12,
+ 6
+ ]
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="metrics_index",
+ id="2",
+ refresh=True,
+ document={
+ "network.name": "net-2",
+ "latency_histo": {
+ "values": [
+ 1,
+ 6,
+ 8,
+ 12,
+ 14
+ ],
+ "counts": [
+ 8,
+ 17,
+ 8,
+ 7,
+ 6
+ ]
+ }
+ },
+)
+print(resp2)
+
+resp3 = client.search(
+ index="metrics_index",
+ size="0",
+ filter_path="aggregations",
+ aggs={
+ "latency_ranges": {
+ "range": {
+ "field": "latency_histo",
+ "ranges": [
+ {
+ "to": 2
+ },
+ {
+ "from": 2,
+ "to": 3
+ },
+ {
+ "from": 3,
+ "to": 10
+ },
+ {
+ "from": 10
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/a669e9d56e34c95ef4c780e92ed307f1.asciidoc b/docs/examples/a669e9d56e34c95ef4c780e92ed307f1.asciidoc
new file mode 100644
index 000000000..4169c598d
--- /dev/null
+++ b/docs/examples/a669e9d56e34c95ef4c780e92ed307f1.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1425
+
+[source, python]
+----
+resp = client.eql.get(
+ id="FjlmbndxNmJjU0RPdExBTGg0elNOOEEaQk9xSjJBQzBRMldZa1VVQ2pPa01YUToxMDY=",
+)
+print(resp)
+----
diff --git a/docs/examples/a692b4c0ca7825c467880b346841f5a5.asciidoc b/docs/examples/a692b4c0ca7825c467880b346841f5a5.asciidoc
index c1e195991..24eacbc92 100644
--- a/docs/examples/a692b4c0ca7825c467880b346841f5a5.asciidoc
+++ b/docs/examples/a692b4c0ca7825c467880b346841f5a5.asciidoc
@@ -1,16 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:156
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "name": {"properties": {"first": {"type": "text"}}}
+ mappings={
+ "properties": {
+ "name": {
+ "properties": {
+ "first": {
+ "type": "text"
+ }
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a699189c8d1a7573beeaea768f2fc618.asciidoc b/docs/examples/a699189c8d1a7573beeaea768f2fc618.asciidoc
new file mode 100644
index 000000000..4ddd520bc
--- /dev/null
+++ b/docs/examples/a699189c8d1a7573beeaea768f2fc618.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/restore-from-snapshot.asciidoc:436
+
+[source, python]
+----
+resp = client.snapshot.restore(
+ repository="my_repository",
+ snapshot="snapshot-20200617",
+ indices="kibana_sample_data_flights,.ds-my-data-stream-2022.06.17-000001",
+ include_aliases=True,
+)
+print(resp)
+----
diff --git a/docs/examples/a69b1ce5cc9528fb3639185eaf241ae3.asciidoc b/docs/examples/a69b1ce5cc9528fb3639185eaf241ae3.asciidoc
new file mode 100644
index 000000000..ef8c2ddb1
--- /dev/null
+++ b/docs/examples/a69b1ce5cc9528fb3639185eaf241ae3.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/clear-scroll-api.asciidoc:25
+
+[source, python]
+----
+resp = client.clear_scroll(
+ scroll_id="DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==",
+)
+print(resp)
+----
diff --git a/docs/examples/a6b2815d54df34b6b8d00226e9a1af0c.asciidoc b/docs/examples/a6b2815d54df34b6b8d00226e9a1af0c.asciidoc
new file mode 100644
index 000000000..2dbb049a6
--- /dev/null
+++ b/docs/examples/a6b2815d54df34b6b8d00226e9a1af0c.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/semantic-search/field-mappings.asciidoc:59
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index",
+ mappings={
+ "properties": {
+ "my_embeddings.predicted_value": {
+ "type": "dense_vector",
+ "dims": 384
+ },
+ "my_text_field": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a6bb306ca250cf651f19cae808b97012.asciidoc b/docs/examples/a6bb306ca250cf651f19cae808b97012.asciidoc
index fe3111219..9358bbc19 100644
--- a/docs/examples/a6bb306ca250cf651f19cae808b97012.asciidoc
+++ b/docs/examples/a6bb306ca250cf651f19cae808b97012.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// indices/get-index.asciidoc:11
[source, python]
@@ -6,4 +7,4 @@ resp = client.indices.get(
index="my-index-000001",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a6be6c1cb4a556866fdccb0dee2f1dea.asciidoc b/docs/examples/a6be6c1cb4a556866fdccb0dee2f1dea.asciidoc
new file mode 100644
index 000000000..f4930b061
--- /dev/null
+++ b/docs/examples/a6be6c1cb4a556866fdccb0dee2f1dea.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/index-template-exists-v1.asciidoc:17
+
+[source, python]
+----
+resp = client.indices.exists_template(
+ name="template_1",
+)
+print(resp)
+----
diff --git a/docs/examples/a6ccac9f80c5e5efdaab992f3a32d919.asciidoc b/docs/examples/a6ccac9f80c5e5efdaab992f3a32d919.asciidoc
new file mode 100644
index 000000000..a71eeedb2
--- /dev/null
+++ b/docs/examples/a6ccac9f80c5e5efdaab992f3a32d919.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-migrate-data-stream-from-ilm-to-dsl.asciidoc:403
+
+[source, python]
+----
+resp = client.indices.get_data_stream(
+ name="dsl-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/a6ef8cd8c8218d547727ffc5485bfbd7.asciidoc b/docs/examples/a6ef8cd8c8218d547727ffc5485bfbd7.asciidoc
new file mode 100644
index 000000000..2aa1ae063
--- /dev/null
+++ b/docs/examples/a6ef8cd8c8218d547727ffc5485bfbd7.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/daterange-aggregation.asciidoc:85
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "range": {
+ "date_range": {
+ "field": "date",
+ "missing": "1976/11/30",
+ "ranges": [
+ {
+ "key": "Older",
+ "to": "2016/02/01"
+ },
+ {
+ "key": "Newer",
+ "from": "2016/02/01",
+ "to": "now/d"
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a6fdd0100cd362df54af6c95d1055c96.asciidoc b/docs/examples/a6fdd0100cd362df54af6c95d1055c96.asciidoc
index b98b8b0ea..fe4ad1147 100644
--- a/docs/examples/a6fdd0100cd362df54af6c95d1055c96.asciidoc
+++ b/docs/examples/a6fdd0100cd362df54af6c95d1055c96.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// indices/get-mapping.asciidoc:11
[source, python]
@@ -6,4 +7,4 @@ resp = client.indices.get_mapping(
index="my-index-000001",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a71154ea11a5214f409ecfd118e9b5e3.asciidoc b/docs/examples/a71154ea11a5214f409ecfd118e9b5e3.asciidoc
new file mode 100644
index 000000000..33c55cf15
--- /dev/null
+++ b/docs/examples/a71154ea11a5214f409ecfd118e9b5e3.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/saml-guide.asciidoc:1049
+
+[source, python]
+----
+resp = client.security.saml_invalidate(
+ query="SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D",
+ realm="saml1",
+)
+print(resp)
+----
diff --git a/docs/examples/a72613de3774571ba24def4b495161b5.asciidoc b/docs/examples/a72613de3774571ba24def4b495161b5.asciidoc
index 6a0dcf792..1742374e6 100644
--- a/docs/examples/a72613de3774571ba24def4b495161b5.asciidoc
+++ b/docs/examples/a72613de3774571ba24def4b495161b5.asciidoc
@@ -1,14 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:422
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "properties": {
- "user_id": {"type": "alias", "path": "user_identifier"}
+ properties={
+ "user_id": {
+ "type": "alias",
+ "path": "user_identifier"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a735081e715d385b4d471eea0f2b57da.asciidoc b/docs/examples/a735081e715d385b4d471eea0f2b57da.asciidoc
new file mode 100644
index 000000000..e73b63e15
--- /dev/null
+++ b/docs/examples/a735081e715d385b4d471eea0f2b57da.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:249
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "slm.retention_schedule": "0 30 1 * * ?"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a73a9a6f19516b8ead63182a9ae5b540.asciidoc b/docs/examples/a73a9a6f19516b8ead63182a9ae5b540.asciidoc
index 1415d97c3..6476094be 100644
--- a/docs/examples/a73a9a6f19516b8ead63182a9ae5b540.asciidoc
+++ b/docs/examples/a73a9a6f19516b8ead63182a9ae5b540.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:330
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "MULTILINESTRING ((1002.0 200.0, 1003.0 200.0, 1003.0 300.0, 1002.0 300.0), (1000.0 100.0, 1001.0 100.0, 1001.0 100.0, 1000.0 100.0), (1000.2 0.2, 1000.8 100.2, 1000.8 100.8, 1000.2 100.8))"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a78dfb844d385405d4b0fb0e09b4a5a4.asciidoc b/docs/examples/a78dfb844d385405d4b0fb0e09b4a5a4.asciidoc
index 5ff354df4..93e49ac7c 100644
--- a/docs/examples/a78dfb844d385405d4b0fb0e09b4a5a4.asciidoc
+++ b/docs/examples/a78dfb844d385405d4b0fb0e09b4a5a4.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:205
[source, python]
@@ -5,7 +6,7 @@
resp = client.update(
index="test",
id="1",
- body={"script": "ctx._source['my-object'].remove('my-subfield')"},
+ script="ctx._source['my-object'].remove('my-subfield')",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a799477dff04578b200788a63f9cff71.asciidoc b/docs/examples/a799477dff04578b200788a63f9cff71.asciidoc
new file mode 100644
index 000000000..e6d18c0b9
--- /dev/null
+++ b/docs/examples/a799477dff04578b200788a63f9cff71.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/iprange-aggregation.asciidoc:162
+
+[source, python]
+----
+resp = client.search(
+ index="ip_addresses",
+ size=0,
+ aggs={
+ "ip_ranges": {
+ "ip_range": {
+ "field": "ip",
+ "ranges": [
+ {
+ "key": "infinity",
+ "to": "10.0.0.5"
+ },
+ {
+ "key": "and-beyond",
+ "from": "10.0.0.5"
+ }
+ ],
+ "keyed": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a7cf31f4b907e4c00132aca75f55790c.asciidoc b/docs/examples/a7cf31f4b907e4c00132aca75f55790c.asciidoc
new file mode 100644
index 000000000..189272ce5
--- /dev/null
+++ b/docs/examples/a7cf31f4b907e4c00132aca75f55790c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/delete-pipeline.asciidoc:73
+
+[source, python]
+----
+resp = client.ingest.delete_pipeline(
+ id="pipeline-one",
+)
+print(resp)
+----
diff --git a/docs/examples/a7e58d4dc477a84c1306fd5749aafd8b.asciidoc b/docs/examples/a7e58d4dc477a84c1306fd5749aafd8b.asciidoc
index 338c48280..d1ec7e58d 100644
--- a/docs/examples/a7e58d4dc477a84c1306fd5749aafd8b.asciidoc
+++ b/docs/examples/a7e58d4dc477a84c1306fd5749aafd8b.asciidoc
@@ -1,18 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/explicit-mapping.asciidoc:20
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "age": {"type": "integer"},
- "email": {"type": "keyword"},
- "name": {"type": "text"},
+ mappings={
+ "properties": {
+ "age": {
+ "type": "integer"
+ },
+ "email": {
+ "type": "keyword"
+ },
+ "name": {
+ "type": "text"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a7fb1c0d0827d66bfa66016f2564b10c.asciidoc b/docs/examples/a7fb1c0d0827d66bfa66016f2564b10c.asciidoc
new file mode 100644
index 000000000..043f3cfff
--- /dev/null
+++ b/docs/examples/a7fb1c0d0827d66bfa66016f2564b10c.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/detect-threats-with-eql.asciidoc:139
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n process where process.name == \"regsvr32.exe\" and process.command_line.keyword != null\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/a8019280dab5b04211ae3b21e5e08223.asciidoc b/docs/examples/a8019280dab5b04211ae3b21e5e08223.asciidoc
new file mode 100644
index 000000000..3dce8853f
--- /dev/null
+++ b/docs/examples/a8019280dab5b04211ae3b21e5e08223.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/register-fs-repo.asciidoc:107
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_fs_backup",
+ repository={
+ "type": "fs",
+ "settings": {
+ "location": "My_fs_backup_location"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a810da963d3b28d79dcd17be829bb271.asciidoc b/docs/examples/a810da963d3b28d79dcd17be829bb271.asciidoc
new file mode 100644
index 000000000..7483a1520
--- /dev/null
+++ b/docs/examples/a810da963d3b28d79dcd17be829bb271.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:620
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ docvalue_fields=[
+ "user.id",
+ "http.response.*",
+ {
+ "field": "date",
+ "format": "epoch_millis"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/a811b82ba4632bdd9065829085188bc9.asciidoc b/docs/examples/a811b82ba4632bdd9065829085188bc9.asciidoc
new file mode 100644
index 000000000..ad8fa8a52
--- /dev/null
+++ b/docs/examples/a811b82ba4632bdd9065829085188bc9.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/get-snapshot-api.asciidoc:44
+
+[source, python]
+----
+resp = client.snapshot.get(
+ repository="my_repository",
+ snapshot="my_snapshot",
+)
+print(resp)
+----
diff --git a/docs/examples/a84bc239eb2f607e8bed1fdb70d63823.asciidoc b/docs/examples/a84bc239eb2f607e8bed1fdb70d63823.asciidoc
new file mode 100644
index 000000000..12d52f0d3
--- /dev/null
+++ b/docs/examples/a84bc239eb2f607e8bed1fdb70d63823.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/deciders/proactive-storage-decider.asciidoc:28
+
+[source, python]
+----
+resp = client.autoscaling.put_autoscaling_policy(
+ name="my_autoscaling_policy",
+ policy={
+ "roles": [
+ "data_hot"
+ ],
+ "deciders": {
+ "proactive_storage": {
+ "forecast_window": "10m"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a84ffbaa4ffa68b22f6fe42d3b4f8dd5.asciidoc b/docs/examples/a84ffbaa4ffa68b22f6fe42d3b4f8dd5.asciidoc
deleted file mode 100644
index 37789b6fd..000000000
--- a/docs/examples/a84ffbaa4ffa68b22f6fe42d3b4f8dd5.asciidoc
+++ /dev/null
@@ -1,6 +0,0 @@
-// aggregations/bucket/datehistogram-aggregation.asciidoc:589
-
-[source, python]
-----
-
-----
\ No newline at end of file
diff --git a/docs/examples/a861a89f52008610e813b9f073951c58.asciidoc b/docs/examples/a861a89f52008610e813b9f073951c58.asciidoc
new file mode 100644
index 000000000..7d9b3e32a
--- /dev/null
+++ b/docs/examples/a861a89f52008610e813b9f073951c58.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/stats.asciidoc:129
+
+[source, python]
+----
+resp = client.indices.stats(
+ metric="merge,refresh",
+)
+print(resp)
+----
diff --git a/docs/examples/a89052bcdfe40e604a98d12be6ae59d2.asciidoc b/docs/examples/a89052bcdfe40e604a98d12be6ae59d2.asciidoc
index dee213fac..109dce5f7 100644
--- a/docs/examples/a89052bcdfe40e604a98d12be6ae59d2.asciidoc
+++ b/docs/examples/a89052bcdfe40e604a98d12be6ae59d2.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:475
[source, python]
----
resp = client.index(
index="example",
- body={"location": "BBOX (100.0, 102.0, 2.0, 0.0)"},
+ document={
+ "location": "BBOX (100.0, 102.0, 2.0, 0.0)"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a8add749c3f41ad1308a45308df14103.asciidoc b/docs/examples/a8add749c3f41ad1308a45308df14103.asciidoc
new file mode 100644
index 000000000..1c5f9fa5c
--- /dev/null
+++ b/docs/examples/a8add749c3f41ad1308a45308df14103.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/tophits-aggregation.asciidoc:277
+
+[source, python]
+----
+resp = client.index(
+ index="sales",
+ id="1",
+ refresh=True,
+ document={
+ "tags": [
+ "car",
+ "auto"
+ ],
+ "comments": [
+ {
+ "username": "baddriver007",
+ "comment": "This car could have better brakes"
+ },
+ {
+ "username": "dr_who",
+ "comment": "Where's the autopilot? Can't find it"
+ },
+ {
+ "username": "ilovemotorbikes",
+ "comment": "This car has two extra wheels"
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a9280b55a7284952f604ec7bece712f6.asciidoc b/docs/examples/a9280b55a7284952f604ec7bece712f6.asciidoc
index ab020b7c2..2b8beb63d 100644
--- a/docs/examples/a9280b55a7284952f604ec7bece712f6.asciidoc
+++ b/docs/examples/a9280b55a7284952f604ec7bece712f6.asciidoc
@@ -1,17 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1188
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "query": {
- "range": {
- "voltage_corrected": {"gte": 16, "lte": 20, "boost": 1}
+ query={
+ "range": {
+ "voltage_corrected": {
+ "gte": 16,
+ "lte": 20,
+ "boost": 1
}
- },
- "fields": ["voltage_corrected", "node"],
+ }
},
+ fields=[
+ "voltage_corrected",
+ "node"
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a941fd568f2e20e13df909ab24506073.asciidoc b/docs/examples/a941fd568f2e20e13df909ab24506073.asciidoc
new file mode 100644
index 000000000..135e8f20f
--- /dev/null
+++ b/docs/examples/a941fd568f2e20e13df909ab24506073.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// monitoring/production.asciidoc:52
+
+[source, python]
+----
+resp = client.cluster.get_settings()
+print(resp)
+
+resp1 = client.cluster.put_settings(
+ persistent={
+ "xpack.monitoring.collection.enabled": False
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/a9541c64512ebc5fcff2dc48487dc0b7.asciidoc b/docs/examples/a9541c64512ebc5fcff2dc48487dc0b7.asciidoc
new file mode 100644
index 000000000..a100037fa
--- /dev/null
+++ b/docs/examples/a9541c64512ebc5fcff2dc48487dc0b7.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-rest.asciidoc:16
+
+[source, python]
+----
+resp = client.esql.query(
+ format="txt",
+ query="FROM library | KEEP author, name, page_count, release_date | SORT page_count DESC | LIMIT 5",
+)
+print(resp)
+----
diff --git a/docs/examples/a9554396506888e392a1aee0ca28e6fc.asciidoc b/docs/examples/a9554396506888e392a1aee0ca28e6fc.asciidoc
new file mode 100644
index 000000000..4b8648d66
--- /dev/null
+++ b/docs/examples/a9554396506888e392a1aee0ca28e6fc.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:327
+
+[source, python]
+----
+resp = client.indices.update_aliases(
+ actions=[
+ {
+ "add": {
+ "index": "my-index-2099.05.06-000001",
+ "alias": "my-alias",
+ "filter": {
+ "bool": {
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "now-1d/d",
+ "lt": "now/d"
+ }
+ }
+ },
+ {
+ "term": {
+ "user.id": "kimchy"
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/a95a123b9f862e52ab1e8f875961c852.asciidoc b/docs/examples/a95a123b9f862e52ab1e8f875961c852.asciidoc
new file mode 100644
index 000000000..37a2b6565
--- /dev/null
+++ b/docs/examples/a95a123b9f862e52ab1e8f875961c852.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-multiple-indices.asciidoc:90
+
+[source, python]
+----
+resp = client.search(
+ indices_boost=[
+ {
+ "my-index-000001": 1.4
+ },
+ {
+ "my-index-000002": 1.3
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/a960b43e720b4934edb74ab4b085ca77.asciidoc b/docs/examples/a960b43e720b4934edb74ab4b085ca77.asciidoc
new file mode 100644
index 000000000..6bf107489
--- /dev/null
+++ b/docs/examples/a960b43e720b4934edb74ab4b085ca77.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/list-connectors-api.asciidoc:78
+
+[source, python]
+----
+resp = client.connector.list()
+print(resp)
+----
diff --git a/docs/examples/a97aace57c6442bbb90e1e14effbcda3.asciidoc b/docs/examples/a97aace57c6442bbb90e1e14effbcda3.asciidoc
new file mode 100644
index 000000000..f1e4fab92
--- /dev/null
+++ b/docs/examples/a97aace57c6442bbb90e1e14effbcda3.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:118
+
+[source, python]
+----
+resp = client.sql.query(
+ format="csv",
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=5,
+)
+print(resp)
+----
diff --git a/docs/examples/a97f984c01fa1d96e6d33a0e8e2cb90f.asciidoc b/docs/examples/a97f984c01fa1d96e6d33a0e8e2cb90f.asciidoc
index d39fc69f9..d468e825d 100644
--- a/docs/examples/a97f984c01fa1d96e6d33a0e8e2cb90f.asciidoc
+++ b/docs/examples/a97f984c01fa1d96e6d33a0e8e2cb90f.asciidoc
@@ -1,17 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:20
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "query": {"type": "percolator"},
- "field": {"type": "text"},
+ mappings={
+ "properties": {
+ "query": {
+ "type": "percolator"
+ },
+ "field": {
+ "type": "text"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/a985e6b7b2ead9c3f30a9bc97d8b598e.asciidoc b/docs/examples/a985e6b7b2ead9c3f30a9bc97d8b598e.asciidoc
new file mode 100644
index 000000000..a03a4fe75
--- /dev/null
+++ b/docs/examples/a985e6b7b2ead9c3f30a9bc97d8b598e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/field-caps.asciidoc:196
+
+[source, python]
+----
+resp = client.field_caps(
+ fields="rating,title",
+)
+print(resp)
+----
diff --git a/docs/examples/a98692a565904ec0783884d81a7b71fc.asciidoc b/docs/examples/a98692a565904ec0783884d81a7b71fc.asciidoc
new file mode 100644
index 000000000..d28575ab0
--- /dev/null
+++ b/docs/examples/a98692a565904ec0783884d81a7b71fc.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/health.asciidoc:81
+
+[source, python]
+----
+resp = client.cat.health(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/a999b5661bebb802bbbfe04faacf1971.asciidoc b/docs/examples/a999b5661bebb802bbbfe04faacf1971.asciidoc
new file mode 100644
index 000000000..ee0267901
--- /dev/null
+++ b/docs/examples/a999b5661bebb802bbbfe04faacf1971.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/size-your-shards.asciidoc:509
+
+[source, python]
+----
+resp = client.reindex(
+ source={
+ "index": "my-index-2099.10.*"
+ },
+ dest={
+ "index": "my-index-2099.10"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a99bc141066ef673e35f306157750ec9.asciidoc b/docs/examples/a99bc141066ef673e35f306157750ec9.asciidoc
new file mode 100644
index 000000000..8043d192c
--- /dev/null
+++ b/docs/examples/a99bc141066ef673e35f306157750ec9.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/lowercase-tokenizer.asciidoc:20
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="lowercase",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/a99bf70ae38bdf1c6f350140b25e0422.asciidoc b/docs/examples/a99bf70ae38bdf1c6f350140b25e0422.asciidoc
new file mode 100644
index 000000000..3fc468507
--- /dev/null
+++ b/docs/examples/a99bf70ae38bdf1c6f350140b25e0422.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-shard-routing.asciidoc:125
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ routing="my-routing-value",
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a9c08023354aa9b9023807962df71d13.asciidoc b/docs/examples/a9c08023354aa9b9023807962df71d13.asciidoc
new file mode 100644
index 000000000..b80b858fe
--- /dev/null
+++ b/docs/examples/a9c08023354aa9b9023807962df71d13.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/forcemerge.asciidoc:183
+
+[source, python]
+----
+resp = client.indices.forcemerge(
+ index="my-index-000001,my-index-000002",
+)
+print(resp)
+----
diff --git a/docs/examples/a9d44463dcea3cb0ea4c8f8460cea524.asciidoc b/docs/examples/a9d44463dcea3cb0ea4c8f8460cea524.asciidoc
new file mode 100644
index 000000000..d7fedf9c9
--- /dev/null
+++ b/docs/examples/a9d44463dcea3cb0ea4c8f8460cea524.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geohexgrid-aggregation.asciidoc:176
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggregations={
+ "tiles-in-bounds": {
+ "geohex_grid": {
+ "field": "location",
+ "precision": 12,
+ "bounds": {
+ "top_left": "POINT (4.9 52.4)",
+ "bottom_right": "POINT (5.0 52.3)"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a9dd5cd3f2b31e7c8129ea63bab868b4.asciidoc b/docs/examples/a9dd5cd3f2b31e7c8129ea63bab868b4.asciidoc
new file mode 100644
index 000000000..ff3649b0d
--- /dev/null
+++ b/docs/examples/a9dd5cd3f2b31e7c8129ea63bab868b4.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:656
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my_search_application",
+ search_application={
+ "indices": [
+ "index1",
+ "index2"
+ ],
+ "template": {
+ "script": {
+ "lang": "mustache",
+ "source": "\n {\n \"query\": {\n \"bool\": {\n \"should\": [\n {{#elser_fields}}\n {\n \"sparse_vector\": {\n \"field\": \"ml.inference.{{.}}_expanded.predicted_value\",\n \"inference_id\": \"\",\n \"query\": \"{{query_string}}\"\n }\n },\n {{/elser_fields}}\n ]\n }\n },\n \"min_score\": \"{{min_score}}\"\n }\n ",
+ "params": {
+ "query_string": "*",
+ "min_score": "10",
+ "elser_fields": [
+ {
+ "name": "title"
+ },
+ {
+ "name": "description"
+ }
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/a9dd9595e96c307b8c798beaeb571521.asciidoc b/docs/examples/a9dd9595e96c307b8c798beaeb571521.asciidoc
new file mode 100644
index 000000000..dd6329c4f
--- /dev/null
+++ b/docs/examples/a9dd9595e96c307b8c798beaeb571521.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/upgrade-job-model-snapshot.asciidoc:77
+
+[source, python]
+----
+resp = client.ml.upgrade_job_snapshot(
+ job_id="low_request_rate",
+ snapshot_id="1828371",
+ timeout="45m",
+ wait_for_completion=True,
+)
+print(resp)
+----
diff --git a/docs/examples/a9fe70387d9c96a07830e1859c57efbb.asciidoc b/docs/examples/a9fe70387d9c96a07830e1859c57efbb.asciidoc
index 5362700b8..013117b0e 100644
--- a/docs/examples/a9fe70387d9c96a07830e1859c57efbb.asciidoc
+++ b/docs/examples/a9fe70387d9c96a07830e1859c57efbb.asciidoc
@@ -1,10 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
// indices/create-index.asciidoc:148
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"settings": {"number_of_shards": 3, "number_of_replicas": 2}},
+ settings={
+ "number_of_shards": 3,
+ "number_of_replicas": 2
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/aa1771b702f4b771491ba4ab743a9197.asciidoc b/docs/examples/aa1771b702f4b771491ba4ab743a9197.asciidoc
new file mode 100644
index 000000000..c5e19fe2a
--- /dev/null
+++ b/docs/examples/aa1771b702f4b771491ba4ab743a9197.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/increase-tier-capacity.asciidoc:245
+
+[source, python]
+----
+resp = client.indices.get_settings(
+ index="my-index-000001",
+ name="index.number_of_replicas",
+)
+print(resp)
+----
diff --git a/docs/examples/aa3284717241ed79d3d1d3bdbbdce598.asciidoc b/docs/examples/aa3284717241ed79d3d1d3bdbbdce598.asciidoc
new file mode 100644
index 000000000..e1b277782
--- /dev/null
+++ b/docs/examples/aa3284717241ed79d3d1d3bdbbdce598.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/lowercase-tokenfilter.asciidoc:20
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "lowercase"
+ ],
+ text="THE Quick FoX JUMPs",
+)
+print(resp)
+----
diff --git a/docs/examples/aa5c0fa51a3553ce7caa763c3832120d.asciidoc b/docs/examples/aa5c0fa51a3553ce7caa763c3832120d.asciidoc
new file mode 100644
index 000000000..5c9167a52
--- /dev/null
+++ b/docs/examples/aa5c0fa51a3553ce7caa763c3832120d.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:603
+
+[source, python]
+----
+resp = client.slm.put_lifecycle(
+ policy_id="monthly-snapshots",
+ name="",
+ schedule="0 56 23 1 * ?",
+ repository="my_repository",
+ config={
+ "indices": "*",
+ "include_global_state": True
+ },
+ retention={
+ "expire_after": "366d",
+ "min_count": 1,
+ "max_count": 12
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/aa5fbb68d3a8e0d0c894791cb6cf0b13.asciidoc b/docs/examples/aa5fbb68d3a8e0d0c894791cb6cf0b13.asciidoc
new file mode 100644
index 000000000..d015074b5
--- /dev/null
+++ b/docs/examples/aa5fbb68d3a8e0d0c894791cb6cf0b13.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/reverse-tokenfilter.asciidoc:79
+
+[source, python]
+----
+resp = client.indices.create(
+ index="reverse_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_reverse": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "reverse"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc b/docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc
index 701958e28..e075cf800 100644
--- a/docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc
+++ b/docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc
@@ -1,4 +1,5 @@
-// ml/trained-models/apis/start-trained-model-deployment.asciidoc:160
+// This file is autogenerated, DO NOT EDIT
+// ml/trained-models/apis/start-trained-model-deployment.asciidoc:133
[source, python]
----
@@ -8,4 +9,4 @@ resp = client.ml.start_trained_model_deployment(
timeout="1m",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/aa699ff3234f54d091575a38e859a627.asciidoc b/docs/examples/aa699ff3234f54d091575a38e859a627.asciidoc
new file mode 100644
index 000000000..e06cb9b44
--- /dev/null
+++ b/docs/examples/aa699ff3234f54d091575a38e859a627.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations.asciidoc:287
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ typed_keys=True,
+ aggs={
+ "my-agg-name": {
+ "histogram": {
+ "field": "my-field",
+ "interval": 1000
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/aa7cf5df36b867aee5e3314ac4b4fa68.asciidoc b/docs/examples/aa7cf5df36b867aee5e3314ac4b4fa68.asciidoc
new file mode 100644
index 000000000..120563a97
--- /dev/null
+++ b/docs/examples/aa7cf5df36b867aee5e3314ac4b4fa68.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// slm/apis/slm-put.asciidoc:113
+
+[source, python]
+----
+resp = client.slm.put_lifecycle(
+ policy_id="daily-snapshots",
+ schedule="0 30 1 * * ?",
+ name="",
+ repository="my_repository",
+ config={
+ "indices": [
+ "data-*",
+ "important"
+ ],
+ "ignore_unavailable": False,
+ "include_global_state": False
+ },
+ retention={
+ "expire_after": "30d",
+ "min_count": 5,
+ "max_count": 50
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/aa7f62279b487989440d423c1ed4a1c0.asciidoc b/docs/examples/aa7f62279b487989440d423c1ed4a1c0.asciidoc
new file mode 100644
index 000000000..3a7f885af
--- /dev/null
+++ b/docs/examples/aa7f62279b487989440d423c1ed4a1c0.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/restore-snapshot-api.asciidoc:88
+
+[source, python]
+----
+resp = client.indices.get_index_template(
+ name="*",
+ filter_path="index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream",
+)
+print(resp)
+----
diff --git a/docs/examples/aaa7a61b07861235fb6e489b946c705c.asciidoc b/docs/examples/aaa7a61b07861235fb6e489b946c705c.asciidoc
index c33358bff..44765f597 100644
--- a/docs/examples/aaa7a61b07861235fb6e489b946c705c.asciidoc
+++ b/docs/examples/aaa7a61b07861235fb6e489b946c705c.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/index_.asciidoc:487
[source, python]
@@ -7,7 +8,11 @@ resp = client.index(
id="1",
version="2",
version_type="external",
- body={"user": {"id": "elkbee"}},
+ document={
+ "user": {
+ "id": "elkbee"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/aab3de5a8a3fefbe012fc2ed50dfe4d6.asciidoc b/docs/examples/aab3de5a8a3fefbe012fc2ed50dfe4d6.asciidoc
new file mode 100644
index 000000000..d84bb077f
--- /dev/null
+++ b/docs/examples/aab3de5a8a3fefbe012fc2ed50dfe4d6.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// searchable-snapshots/apis/node-cache-stats.asciidoc:96
+
+[source, python]
+----
+resp = client.searchable_snapshots.cache_stats()
+print(resp)
+----
diff --git a/docs/examples/aaba346e0becdf12db13658296e0b8a1.asciidoc b/docs/examples/aaba346e0becdf12db13658296e0b8a1.asciidoc
new file mode 100644
index 000000000..e775fb30d
--- /dev/null
+++ b/docs/examples/aaba346e0becdf12db13658296e0b8a1.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/error-handling.asciidoc:38
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "index.number_of_shards": 2,
+ "index.lifecycle.name": "shrink-index"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/aac5996a8398cc8f7701a063df0b2346.asciidoc b/docs/examples/aac5996a8398cc8f7701a063df0b2346.asciidoc
new file mode 100644
index 000000000..605a6ceb6
--- /dev/null
+++ b/docs/examples/aac5996a8398cc8f7701a063df0b2346.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/saml-guide.asciidoc:716
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="saml-finance",
+ roles=[
+ "finance_data"
+ ],
+ enabled=True,
+ rules={
+ "all": [
+ {
+ "field": {
+ "realm.name": "saml1"
+ }
+ },
+ {
+ "field": {
+ "groups": "finance-team"
+ }
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/aadf36ae37460a735e06b953b4cee494.asciidoc b/docs/examples/aadf36ae37460a735e06b953b4cee494.asciidoc
new file mode 100644
index 000000000..c95dd1248
--- /dev/null
+++ b/docs/examples/aadf36ae37460a735e06b953b4cee494.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/frequent-item-sets-aggregation.asciidoc:301
+
+[source, python]
+----
+resp = client.search(
+ index="kibana_sample_data_ecommerce",
+ runtime_mappings={
+ "price_range": {
+ "type": "keyword",
+ "script": {
+ "source": "\n def bucket_start = (long) Math.floor(doc['taxful_total_price'].value / 50) * 50;\n def bucket_end = bucket_start + 50;\n emit(bucket_start.toString() + \"-\" + bucket_end.toString());\n "
+ }
+ }
+ },
+ size=0,
+ aggs={
+ "my_agg": {
+ "frequent_item_sets": {
+ "minimum_set_size": 4,
+ "fields": [
+ {
+ "field": "category.keyword"
+ },
+ {
+ "field": "price_range"
+ },
+ {
+ "field": "geoip.city_name"
+ }
+ ],
+ "size": 3
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ab0fd1908c9957cc7f63165c156e48cd.asciidoc b/docs/examples/ab0fd1908c9957cc7f63165c156e48cd.asciidoc
new file mode 100644
index 000000000..f05419700
--- /dev/null
+++ b/docs/examples/ab0fd1908c9957cc7f63165c156e48cd.asciidoc
@@ -0,0 +1,56 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/enabled.asciidoc:17
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "user_id": {
+ "type": "keyword"
+ },
+ "last_updated": {
+ "type": "date"
+ },
+ "session_data": {
+ "type": "object",
+ "enabled": False
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="session_1",
+ document={
+ "user_id": "kimchy",
+ "session_data": {
+ "arbitrary_object": {
+ "some_array": [
+ "foo",
+ "bar",
+ {
+ "baz": 2
+ }
+ ]
+ }
+ },
+ "last_updated": "2015-12-06T18:20:22"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="my-index-000001",
+ id="session_2",
+ document={
+ "user_id": "jpountz",
+ "session_data": "none",
+ "last_updated": "2015-12-06T18:22:13"
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/ab1372270c11bcd6f36d1a13e6c69276.asciidoc b/docs/examples/ab1372270c11bcd6f36d1a13e6c69276.asciidoc
new file mode 100644
index 000000000..1fd6216b1
--- /dev/null
+++ b/docs/examples/ab1372270c11bcd6f36d1a13e6c69276.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-across-clusters.asciidoc:414
+
+[source, python]
+----
+resp = client.async_search.submit(
+ index="my-index-000001,cluster_one:my-index-000001,cluster_two:my-index-000001",
+ ccs_minimize_roundtrips=True,
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ source=[
+ "user.id",
+ "message",
+ "http.response.status_code"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/ab1a989958c1d345a9dc3dd36ad90c27.asciidoc b/docs/examples/ab1a989958c1d345a9dc3dd36ad90c27.asciidoc
index 1bb625fe2..fc330db04 100644
--- a/docs/examples/ab1a989958c1d345a9dc3dd36ad90c27.asciidoc
+++ b/docs/examples/ab1a989958c1d345a9dc3dd36ad90c27.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:242
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "POLYGON ((1000.0 1000.0, 1001.0 1000.0, 1001.0 1001.0, 1000.0 1001.0, 1000.0 1000.0), (1000.2 1000.2, 1000.8 1000.2, 1000.8 1000.8, 1000.2 1000.8, 1000.2 1000.2))"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ab24bfdfd8c1c7b3044b21a3b4684370.asciidoc b/docs/examples/ab24bfdfd8c1c7b3044b21a3b4684370.asciidoc
new file mode 100644
index 000000000..3d433144a
--- /dev/null
+++ b/docs/examples/ab24bfdfd8c1c7b3044b21a3b4684370.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/fields.asciidoc:94
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "cost_price": 100
+ },
+)
+print(resp)
+
+resp1 = client.search(
+ index="my-index-000001",
+ script_fields={
+ "sales_price": {
+ "script": {
+ "lang": "expression",
+ "source": "doc['cost_price'] * markup",
+ "params": {
+ "markup": 0.2
+ }
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/ab29bfbd35ee482cf54052b03d62cd31.asciidoc b/docs/examples/ab29bfbd35ee482cf54052b03d62cd31.asciidoc
new file mode 100644
index 000000000..dd070c0cb
--- /dev/null
+++ b/docs/examples/ab29bfbd35ee482cf54052b03d62cd31.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geodistance-aggregation.asciidoc:96
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggs={
+ "rings": {
+ "geo_distance": {
+ "field": "location",
+ "origin": "POINT (4.894 52.3760)",
+ "unit": "km",
+ "ranges": [
+ {
+ "to": 100
+ },
+ {
+ "from": 100,
+ "to": 300
+ },
+ {
+ "from": 300
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ab317aa09c4bd44abbf02517141e37ef.asciidoc b/docs/examples/ab317aa09c4bd44abbf02517141e37ef.asciidoc
new file mode 100644
index 000000000..319bf51fe
--- /dev/null
+++ b/docs/examples/ab317aa09c4bd44abbf02517141e37ef.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/term-vector.asciidoc:35
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "text": {
+ "type": "text",
+ "term_vector": "with_positions_offsets"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "text": "Quick brown fox"
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "text": "brown fox"
+ }
+ },
+ highlight={
+ "fields": {
+ "text": {}
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/ab3c36b70459093beafbfd3a7ae75b9b.asciidoc b/docs/examples/ab3c36b70459093beafbfd3a7ae75b9b.asciidoc
new file mode 100644
index 000000000..580779626
--- /dev/null
+++ b/docs/examples/ab3c36b70459093beafbfd3a7ae75b9b.asciidoc
@@ -0,0 +1,49 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:386
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "date": "2015-10-01T05:30:00Z"
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="2",
+ refresh=True,
+ document={
+ "date": "2015-10-01T06:30:00Z"
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ size="0",
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "date": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "day",
+ "offset": "+6h",
+ "format": "iso8601"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/ab8b4537fad80107bc88f633d4039a52.asciidoc b/docs/examples/ab8b4537fad80107bc88f633d4039a52.asciidoc
index 75e0dac4f..74d6fa5df 100644
--- a/docs/examples/ab8b4537fad80107bc88f633d4039a52.asciidoc
+++ b/docs/examples/ab8b4537fad80107bc88f633d4039a52.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// indices/create-index.asciidoc:210
[source, python]
----
resp = client.indices.create(
index="logs",
- body={"aliases": {"": {}}},
+ aliases={
+ "": {}
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ab8de34fcfc0277901cb39618ecfc9d5.asciidoc b/docs/examples/ab8de34fcfc0277901cb39618ecfc9d5.asciidoc
index 7782e0d64..9b2ff6473 100644
--- a/docs/examples/ab8de34fcfc0277901cb39618ecfc9d5.asciidoc
+++ b/docs/examples/ab8de34fcfc0277901cb39618ecfc9d5.asciidoc
@@ -1,9 +1,12 @@
-// cluster/allocation-explain.asciidoc:101
+// This file is autogenerated, DO NOT EDIT
+// cluster/allocation-explain.asciidoc:102
[source, python]
----
resp = client.cluster.allocation_explain(
- body={"index": "my-index-000001", "shard": 0, "primary": True},
+ index="my-index-000001",
+ shard=0,
+ primary=True,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/abb4a58089574211d434946a923e5725.asciidoc b/docs/examples/abb4a58089574211d434946a923e5725.asciidoc
new file mode 100644
index 000000000..e35c2bca2
--- /dev/null
+++ b/docs/examples/abb4a58089574211d434946a923e5725.asciidoc
@@ -0,0 +1,89 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/inference-bucket-aggregation.asciidoc:95
+
+[source, python]
+----
+resp = client.search(
+ index="kibana_sample_data_logs",
+ size=0,
+ aggs={
+ "client_ip": {
+ "composite": {
+ "sources": [
+ {
+ "client_ip": {
+ "terms": {
+ "field": "clientip"
+ }
+ }
+ }
+ ]
+ },
+ "aggs": {
+ "url_dc": {
+ "cardinality": {
+ "field": "url.keyword"
+ }
+ },
+ "bytes_sum": {
+ "sum": {
+ "field": "bytes"
+ }
+ },
+ "geo_src_dc": {
+ "cardinality": {
+ "field": "geo.src"
+ }
+ },
+ "geo_dest_dc": {
+ "cardinality": {
+ "field": "geo.dest"
+ }
+ },
+ "responses_total": {
+ "value_count": {
+ "field": "timestamp"
+ }
+ },
+ "success": {
+ "filter": {
+ "term": {
+ "response": "200"
+ }
+ }
+ },
+ "error404": {
+ "filter": {
+ "term": {
+ "response": "404"
+ }
+ }
+ },
+ "error503": {
+ "filter": {
+ "term": {
+ "response": "503"
+ }
+ }
+ },
+ "malicious_client_ip": {
+ "inference": {
+ "model_id": "malicious_clients_model",
+ "buckets_path": {
+ "response_count": "responses_total",
+ "url_dc": "url_dc",
+ "bytes_sum": "bytes_sum",
+ "geo_src_dc": "geo_src_dc",
+ "geo_dest_dc": "geo_dest_dc",
+ "success": "success._count",
+ "error404": "error404._count",
+ "error503": "error503._count"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/abc280775734daa6cf2c28868e155d10.asciidoc b/docs/examples/abc280775734daa6cf2c28868e155d10.asciidoc
new file mode 100644
index 000000000..3bb3c97d7
--- /dev/null
+++ b/docs/examples/abc280775734daa6cf2c28868e155d10.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/weighted-avg-aggregation.asciidoc:101
+
+[source, python]
+----
+resp = client.index(
+ index="exams",
+ refresh=True,
+ document={
+ "grade": [
+ 1,
+ 2,
+ 3
+ ],
+ "weight": 2
+ },
+)
+print(resp)
+
+resp1 = client.search(
+ index="exams",
+ size=0,
+ aggs={
+ "weighted_grade": {
+ "weighted_avg": {
+ "value": {
+ "field": "grade"
+ },
+ "weight": {
+ "field": "weight"
+ }
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/abc496de5fd013099a134db369b34a8b.asciidoc b/docs/examples/abc496de5fd013099a134db369b34a8b.asciidoc
new file mode 100644
index 000000000..5d5179e65
--- /dev/null
+++ b/docs/examples/abc496de5fd013099a134db369b34a8b.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/sum-aggregation.asciidoc:109
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ query={
+ "constant_score": {
+ "filter": {
+ "match": {
+ "type": "hat"
+ }
+ }
+ }
+ },
+ aggs={
+ "hat_prices": {
+ "sum": {
+ "field": "price",
+ "missing": 100
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/abc7a670a47516b58b6b07d7497b140c.asciidoc b/docs/examples/abc7a670a47516b58b6b07d7497b140c.asciidoc
new file mode 100644
index 000000000..7630bf63a
--- /dev/null
+++ b/docs/examples/abc7a670a47516b58b6b07d7497b140c.asciidoc
@@ -0,0 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/search-speed.asciidoc:272
+
+[source, python]
+----
+resp = client.search(
+ index="index",
+ query={
+ "constant_score": {
+ "filter": {
+ "bool": {
+ "should": [
+ {
+ "range": {
+ "my_date": {
+ "gte": "now-1h",
+ "lte": "now-1h/m"
+ }
+ }
+ },
+ {
+ "range": {
+ "my_date": {
+ "gt": "now-1h/m",
+ "lt": "now/m"
+ }
+ }
+ },
+ {
+ "range": {
+ "my_date": {
+ "gte": "now/m",
+ "lte": "now"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/abd4fc3ce7784413a56fe2dcfe2809b5.asciidoc b/docs/examples/abd4fc3ce7784413a56fe2dcfe2809b5.asciidoc
index 31b497283..94b61315a 100644
--- a/docs/examples/abd4fc3ce7784413a56fe2dcfe2809b5.asciidoc
+++ b/docs/examples/abd4fc3ce7784413a56fe2dcfe2809b5.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:748
[source, python]
@@ -5,7 +6,11 @@
resp = client.search(
index="test",
filter_path="hits.total",
- body={"query": {"match": {"flag": "foo"}}},
+ query={
+ "match": {
+ "flag": "foo"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/abdbc81e799e28c833556b1c29f03ba6.asciidoc b/docs/examples/abdbc81e799e28c833556b1c29f03ba6.asciidoc
new file mode 100644
index 000000000..e2b8bbbe6
--- /dev/null
+++ b/docs/examples/abdbc81e799e28c833556b1c29f03ba6.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-users.asciidoc:113
+
+[source, python]
+----
+resp = client.security.get_user()
+print(resp)
+----
diff --git a/docs/examples/ac366b9dda7040e743dee85335354094.asciidoc b/docs/examples/ac366b9dda7040e743dee85335354094.asciidoc
new file mode 100644
index 000000000..cce282e63
--- /dev/null
+++ b/docs/examples/ac366b9dda7040e743dee85335354094.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/shingle-tokenfilter.asciidoc:116
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ {
+ "type": "shingle",
+ "min_shingle_size": 2,
+ "max_shingle_size": 3
+ }
+ ],
+ text="quick brown fox jumps",
+)
+print(resp)
+----
diff --git a/docs/examples/ac483996d479946d57c374c3a86b2621.asciidoc b/docs/examples/ac483996d479946d57c374c3a86b2621.asciidoc
index 83da2415c..305cde356 100644
--- a/docs/examples/ac483996d479946d57c374c3a86b2621.asciidoc
+++ b/docs/examples/ac483996d479946d57c374c3a86b2621.asciidoc
@@ -1,14 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/search-as-you-type.asciidoc:18
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {"my_field": {"type": "search_as_you_type"}}
+ mappings={
+ "properties": {
+ "my_field": {
+ "type": "search_as_you_type"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ac497917ef707538198a8458ae3d5c6b.asciidoc b/docs/examples/ac497917ef707538198a8458ae3d5c6b.asciidoc
index 9f8d5cd90..63187d6b3 100644
--- a/docs/examples/ac497917ef707538198a8458ae3d5c6b.asciidoc
+++ b/docs/examples/ac497917ef707538198a8458ae3d5c6b.asciidoc
@@ -1,9 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/match-query.asciidoc:161
[source, python]
----
resp = client.search(
- body={"query": {"match": {"message": "this is a test"}}},
+ query={
+ "match": {
+ "message": "this is a test"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ac73895ca1882cd1ac65b1facfbb5c63.asciidoc b/docs/examples/ac73895ca1882cd1ac65b1facfbb5c63.asciidoc
index e5b810213..d335cc9e3 100644
--- a/docs/examples/ac73895ca1882cd1ac65b1facfbb5c63.asciidoc
+++ b/docs/examples/ac73895ca1882cd1ac65b1facfbb5c63.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:10
[source, python]
----
resp = client.delete_by_query(
index="my-index-000001",
- body={"query": {"match": {"user.id": "elkbee"}}},
+ query={
+ "match": {
+ "user.id": "elkbee"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ac8328bc51fd396b3ce5f7ef3e1e73df.asciidoc b/docs/examples/ac8328bc51fd396b3ce5f7ef3e1e73df.asciidoc
new file mode 100644
index 000000000..6caa8bed3
--- /dev/null
+++ b/docs/examples/ac8328bc51fd396b3ce5f7ef3e1e73df.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:64
+
+[source, python]
+----
+resp = client.snapshot.get_repository()
+print(resp)
+----
diff --git a/docs/examples/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc b/docs/examples/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc
index cdef1b4a4..b53368172 100644
--- a/docs/examples/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc
+++ b/docs/examples/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// cluster/update-settings.asciidoc:68
[source, python]
----
resp = client.cluster.put_settings(
- flat_settings="true",
- body={"transient": {"indices.recovery.max_bytes_per_sec": "20mb"}},
+ flat_settings=True,
+ transient={
+ "indices.recovery.max_bytes_per_sec": "20mb"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ac9fe9b64891095bcf84066f719b3dc4.asciidoc b/docs/examples/ac9fe9b64891095bcf84066f719b3dc4.asciidoc
new file mode 100644
index 000000000..2b0c50721
--- /dev/null
+++ b/docs/examples/ac9fe9b64891095bcf84066f719b3dc4.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/repository-source-only.asciidoc:38
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_src_only_repository",
+ repository={
+ "type": "source",
+ "settings": {
+ "delegate_type": "fs",
+ "location": "my_backup_repository"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/acb10091ad335ddd15d71021aaf23c62.asciidoc b/docs/examples/acb10091ad335ddd15d71021aaf23c62.asciidoc
new file mode 100644
index 000000000..376de04ba
--- /dev/null
+++ b/docs/examples/acb10091ad335ddd15d71021aaf23c62.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:629
+
+[source, python]
+----
+resp = client.search(
+ track_scores=True,
+ sort=[
+ {
+ "post_date": {
+ "order": "desc"
+ }
+ },
+ {
+ "name": "desc"
+ },
+ {
+ "age": "desc"
+ }
+ ],
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/acb850c08f51226eadb75be09e336076.asciidoc b/docs/examples/acb850c08f51226eadb75be09e336076.asciidoc
new file mode 100644
index 000000000..959f8d18b
--- /dev/null
+++ b/docs/examples/acb850c08f51226eadb75be09e336076.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/async-search.asciidoc:253
+
+[source, python]
+----
+resp = client.async_search.status(
+ id="FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=",
+)
+print(resp)
+----
diff --git a/docs/examples/acc52da725a996ae696b00d9f818dfde.asciidoc b/docs/examples/acc52da725a996ae696b00d9f818dfde.asciidoc
new file mode 100644
index 000000000..74bd049c1
--- /dev/null
+++ b/docs/examples/acc52da725a996ae696b00d9f818dfde.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/pathhierarchy-tokenizer.asciidoc:328
+
+[source, python]
+----
+resp = client.indices.analyze(
+ index="file-path-test",
+ analyzer="custom_path_tree",
+ text="/User/alice/photos/2017/05/16/my_photo1.jpg",
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="file-path-test",
+ analyzer="custom_path_tree_reversed",
+ text="/User/alice/photos/2017/05/16/my_photo1.jpg",
+)
+print(resp1)
+----
diff --git a/docs/examples/acc6cd860032167e34fa5e0c043ab3b0.asciidoc b/docs/examples/acc6cd860032167e34fa5e0c043ab3b0.asciidoc
index dbda1fe25..ecfc1bbc9 100644
--- a/docs/examples/acc6cd860032167e34fa5e0c043ab3b0.asciidoc
+++ b/docs/examples/acc6cd860032167e34fa5e0c043ab3b0.asciidoc
@@ -1,13 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:335
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {"query": "city.\\*:(this AND that OR thus)"}
+ query={
+ "query_string": {
+ "query": "city.\\*:(this AND that OR thus)"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ad0dcbc7fc619e952c8825b8f307b7b2.asciidoc b/docs/examples/ad0dcbc7fc619e952c8825b8f307b7b2.asciidoc
index 594a94f88..e496641ae 100644
--- a/docs/examples/ad0dcbc7fc619e952c8825b8f307b7b2.asciidoc
+++ b/docs/examples/ad0dcbc7fc619e952c8825b8f307b7b2.asciidoc
@@ -1,17 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:410
[source, python]
----
resp = client.search(
- body={
- "query": {
- "multi_match": {
- "query": "Jon",
- "type": "cross_fields",
- "fields": ["first", "first.edge", "last", "last.edge"],
- }
+ query={
+ "multi_match": {
+ "query": "Jon",
+ "type": "cross_fields",
+ "fields": [
+ "first",
+ "first.edge",
+ "last",
+ "last.edge"
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ad2416ca0581316cee6c63129685bca5.asciidoc b/docs/examples/ad2416ca0581316cee6c63129685bca5.asciidoc
index bd0a07dc8..c7ce73d94 100644
--- a/docs/examples/ad2416ca0581316cee6c63129685bca5.asciidoc
+++ b/docs/examples/ad2416ca0581316cee6c63129685bca5.asciidoc
@@ -1,17 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:498
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {
- "fields": ["title", "content"],
- "query": "this OR that OR thus",
- "minimum_should_match": 2,
- }
+ query={
+ "query_string": {
+ "fields": [
+ "title",
+ "content"
+ ],
+ "query": "this OR that OR thus",
+ "minimum_should_match": 2
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ad2b8aed84c67cdc295917b47a12d3dc.asciidoc b/docs/examples/ad2b8aed84c67cdc295917b47a12d3dc.asciidoc
new file mode 100644
index 000000000..3744722f8
--- /dev/null
+++ b/docs/examples/ad2b8aed84c67cdc295917b47a12d3dc.asciidoc
@@ -0,0 +1,55 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/knn-query.asciidoc:42
+
+[source, python]
+----
+resp = client.bulk(
+ index="my-image-index",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "1"
+ }
+ },
+ {
+ "image-vector": [
+ 1,
+ 5,
+ -20
+ ],
+ "file-type": "jpg",
+ "title": "mountain lake"
+ },
+ {
+ "index": {
+ "_id": "2"
+ }
+ },
+ {
+ "image-vector": [
+ 42,
+ 8,
+ -15
+ ],
+ "file-type": "png",
+ "title": "frozen lake"
+ },
+ {
+ "index": {
+ "_id": "3"
+ }
+ },
+ {
+ "image-vector": [
+ 15,
+ 11,
+ 23
+ ],
+ "file-type": "jpg",
+ "title": "mountain lake lodge"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/ad3b159657d4bcb373623fdc61acc3bf.asciidoc b/docs/examples/ad3b159657d4bcb373623fdc61acc3bf.asciidoc
index c176fcb92..e6101c4b9 100644
--- a/docs/examples/ad3b159657d4bcb373623fdc61acc3bf.asciidoc
+++ b/docs/examples/ad3b159657d4bcb373623fdc61acc3bf.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// search/count.asciidoc:10
[source, python]
@@ -7,4 +8,4 @@ resp = client.count(
q="user:kimchy",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ad57ccba0a060da4f5313692fa26a235.asciidoc b/docs/examples/ad57ccba0a060da4f5313692fa26a235.asciidoc
index ee0b8ae24..44fa5cb98 100644
--- a/docs/examples/ad57ccba0a060da4f5313692fa26a235.asciidoc
+++ b/docs/examples/ad57ccba0a060da4f5313692fa26a235.asciidoc
@@ -1,42 +1,72 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/date_nanos.asciidoc:30
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"date": {"type": "date_nanos"}}}},
+ mappings={
+ "properties": {
+ "date": {
+ "type": "date_nanos"
+ }
+ }
+ },
)
print(resp)
-resp = client.bulk(
+resp1 = client.bulk(
index="my-index-000001",
- refresh="true",
- body=[
- {"index": {"_id": "1"}},
- {"date": "2015-01-01"},
- {"index": {"_id": "2"}},
- {"date": "2015-01-01T12:10:30.123456789Z"},
- {"index": {"_id": "3"}},
- {"date": 1420070400000},
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "1"
+ }
+ },
+ {
+ "date": "2015-01-01"
+ },
+ {
+ "index": {
+ "_id": "2"
+ }
+ },
+ {
+ "date": "2015-01-01T12:10:30.123456789Z"
+ },
+ {
+ "index": {
+ "_id": "3"
+ }
+ },
+ {
+ "date": 1420070400000
+ }
],
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
- body={
- "sort": {"date": "asc"},
- "runtime_mappings": {
- "date_has_nanos": {
- "type": "boolean",
- "script": "emit(doc['date'].value.nano != 0)",
- }
- },
- "fields": [
- {"field": "date", "format": "strict_date_optional_time_nanos"},
- {"field": "date_has_nanos"},
- ],
+ sort={
+ "date": "asc"
+ },
+ runtime_mappings={
+ "date_has_nanos": {
+ "type": "boolean",
+ "script": "emit(doc['date'].value.nano != 0)"
+ }
},
+ fields=[
+ {
+ "field": "date",
+ "format": "strict_date_optional_time_nanos"
+ },
+ {
+ "field": "date_has_nanos"
+ }
+ ],
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/ad63eca6829a25293c9be589c1870547.asciidoc b/docs/examples/ad63eca6829a25293c9be589c1870547.asciidoc
new file mode 100644
index 000000000..050497078
--- /dev/null
+++ b/docs/examples/ad63eca6829a25293c9be589c1870547.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/movfn-aggregation.asciidoc:298
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "the_moving_sum": {
+ "moving_fn": {
+ "buckets_path": "the_sum",
+ "window": 10,
+ "script": "MovingFunctions.sum(values)"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ad6d81be5fad4bad87486b699454dce5.asciidoc b/docs/examples/ad6d81be5fad4bad87486b699454dce5.asciidoc
new file mode 100644
index 000000000..b6e59a9c9
--- /dev/null
+++ b/docs/examples/ad6d81be5fad4bad87486b699454dce5.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/t-test-aggregation.asciidoc:32
+
+[source, python]
+----
+resp = client.search(
+ index="node_upgrade",
+ size=0,
+ aggs={
+ "startup_time_ttest": {
+ "t_test": {
+ "a": {
+ "field": "startup_time_before"
+ },
+ "b": {
+ "field": "startup_time_after"
+ },
+ "type": "paired"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ad88e46bb06739991498dee248850223.asciidoc b/docs/examples/ad88e46bb06739991498dee248850223.asciidoc
new file mode 100644
index 000000000..7b3e08bcb
--- /dev/null
+++ b/docs/examples/ad88e46bb06739991498dee248850223.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/thread_pool.asciidoc:136
+
+[source, python]
+----
+resp = client.cat.thread_pool()
+print(resp)
+----
diff --git a/docs/examples/ad92a1a8bb1b0f26d1536fe8ba4ffd17.asciidoc b/docs/examples/ad92a1a8bb1b0f26d1536fe8ba4ffd17.asciidoc
new file mode 100644
index 000000000..dd83f695e
--- /dev/null
+++ b/docs/examples/ad92a1a8bb1b0f26d1536fe8ba4ffd17.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// search/render-search-template-api.asciidoc:33
+
+[source, python]
+----
+resp = client.render_search_template(
+ id="my-search-template",
+ params={
+ "query_string": "hello world",
+ "from": 20,
+ "size": 10
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ada2675a9c631da2bfe627fc2618f5ed.asciidoc b/docs/examples/ada2675a9c631da2bfe627fc2618f5ed.asciidoc
new file mode 100644
index 000000000..4566f7481
--- /dev/null
+++ b/docs/examples/ada2675a9c631da2bfe627fc2618f5ed.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/script-score-query.asciidoc:18
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "script_score": {
+ "query": {
+ "match": {
+ "message": "elasticsearch"
+ }
+ },
+ "script": {
+ "source": "doc['my-int'].value / 10 "
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/adc18ca0c344d81d68ec3b9422b54ff5.asciidoc b/docs/examples/adc18ca0c344d81d68ec3b9422b54ff5.asciidoc
new file mode 100644
index 000000000..c4abb1185
--- /dev/null
+++ b/docs/examples/adc18ca0c344d81d68ec3b9422b54ff5.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// search/multi-search.asciidoc:312
+
+[source, python]
+----
+resp = client.msearch(
+ index="my-index-000001",
+ searches=[
+ {},
+ {
+ "query": {
+ "match_all": {}
+ },
+ "from": 0,
+ "size": 10
+ },
+ {},
+ {
+ "query": {
+ "match_all": {}
+ }
+ },
+ {
+ "index": "my-index-000002"
+ },
+ {
+ "query": {
+ "match_all": {}
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/add240aa149d8b11139947502b279ee0.asciidoc b/docs/examples/add240aa149d8b11139947502b279ee0.asciidoc
new file mode 100644
index 000000000..1eb49e7e3
--- /dev/null
+++ b/docs/examples/add240aa149d8b11139947502b279ee0.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:401
+
+[source, python]
+----
+resp = client.scroll(
+ scroll="1m",
+ scroll_id="DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==",
+)
+print(resp)
+----
diff --git a/docs/examples/adf36e2d8fc05c3719c91912481c4e19.asciidoc b/docs/examples/adf36e2d8fc05c3719c91912481c4e19.asciidoc
new file mode 100644
index 000000000..e78abe0de
--- /dev/null
+++ b/docs/examples/adf36e2d8fc05c3719c91912481c4e19.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/enable-users.asciidoc:44
+
+[source, python]
+----
+resp = client.security.enable_user(
+ username="jacknich",
+)
+print(resp)
+----
diff --git a/docs/examples/adf728b0c11c5c309c730205609a379d.asciidoc b/docs/examples/adf728b0c11c5c309c730205609a379d.asciidoc
new file mode 100644
index 000000000..95d603099
--- /dev/null
+++ b/docs/examples/adf728b0c11c5c309c730205609a379d.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:532
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "set": {
+ "description": "Set dynamic '' field to 'code' value",
+ "field": "{{{service}}}",
+ "value": "{{{code}}}"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/ae0d20c2ebb59278e08a26c9634d90c9.asciidoc b/docs/examples/ae0d20c2ebb59278e08a26c9634d90c9.asciidoc
new file mode 100644
index 000000000..a266dc4a3
--- /dev/null
+++ b/docs/examples/ae0d20c2ebb59278e08a26c9634d90c9.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:290
+
+[source, python]
+----
+resp = client.snapshot.create(
+ repository="my_repository",
+ snapshot="",
+)
+print(resp)
+----
diff --git a/docs/examples/ae398a6b6494e7982ef2549fc2cd2d8e.asciidoc b/docs/examples/ae398a6b6494e7982ef2549fc2cd2d8e.asciidoc
index c98de5ff8..a0661cc1f 100644
--- a/docs/examples/ae398a6b6494e7982ef2549fc2cd2d8e.asciidoc
+++ b/docs/examples/ae398a6b6494e7982ef2549fc2cd2d8e.asciidoc
@@ -1,45 +1,58 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:353
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "full_name": {
- "path_match": ["name.*", "user.name.*"],
- "path_unmatch": ["*.middle", "*.midinitial"],
- "mapping": {
- "type": "text",
- "copy_to": "full_name",
- },
+ mappings={
+ "dynamic_templates": [
+ {
+ "full_name": {
+ "path_match": [
+ "name.*",
+ "user.name.*"
+ ],
+ "path_unmatch": [
+ "*.middle",
+ "*.midinitial"
+ ],
+ "mapping": {
+ "type": "text",
+ "copy_to": "full_name"
}
}
- ]
- }
+ }
+ ]
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={
- "name": {"first": "John", "middle": "Winston", "last": "Lennon"}
+ document={
+ "name": {
+ "first": "John",
+ "middle": "Winston",
+ "last": "Lennon"
+ }
},
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="my-index-000001",
id="2",
- body={
+ document={
"user": {
- "name": {"first": "Jane", "midinitial": "M", "last": "Salazar"}
+ "name": {
+ "first": "Jane",
+ "midinitial": "M",
+ "last": "Salazar"
+ }
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/ae4aa368617637a390074535df86e64b.asciidoc b/docs/examples/ae4aa368617637a390074535df86e64b.asciidoc
new file mode 100644
index 000000000..86c8a2122
--- /dev/null
+++ b/docs/examples/ae4aa368617637a390074535df86e64b.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/common/apis/set-upgrade-mode.asciidoc:74
+
+[source, python]
+----
+resp = client.ml.set_upgrade_mode(
+ enabled=True,
+ timeout="10m",
+)
+print(resp)
+----
diff --git a/docs/examples/ae591d49e54b838c15cdcf64a8dee9c2.asciidoc b/docs/examples/ae591d49e54b838c15cdcf64a8dee9c2.asciidoc
new file mode 100644
index 000000000..3eed8fae8
--- /dev/null
+++ b/docs/examples/ae591d49e54b838c15cdcf64a8dee9c2.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-rollover.asciidoc:222
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_primary_shard_docs": 10000000
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ae82eb17c23cb8e5761cb6240a5ed0a6.asciidoc b/docs/examples/ae82eb17c23cb8e5761cb6240a5ed0a6.asciidoc
new file mode 100644
index 000000000..92158eaad
--- /dev/null
+++ b/docs/examples/ae82eb17c23cb8e5761cb6240a5ed0a6.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/put-dfanalytics.asciidoc:787
+
+[source, python]
+----
+resp = client.ml.put_data_frame_analytics(
+ id="student_performance_mathematics_0.3",
+ source={
+ "index": "student_performance_mathematics"
+ },
+ dest={
+ "index": "student_performance_mathematics_reg"
+ },
+ analysis={
+ "regression": {
+ "dependent_variable": "G3",
+ "training_percent": 70,
+ "randomize_seed": 19673948271
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ae9ccfaa146731ab9176df90670db1c2.asciidoc b/docs/examples/ae9ccfaa146731ab9176df90670db1c2.asciidoc
index 668510e72..1651f5822 100644
--- a/docs/examples/ae9ccfaa146731ab9176df90670db1c2.asciidoc
+++ b/docs/examples/ae9ccfaa146731ab9176df90670db1c2.asciidoc
@@ -1,17 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
// docs/bulk.asciidoc:499
[source, python]
----
resp = client.bulk(
- body=[
- {"index": {"_index": "test", "_id": "1"}},
- {"field1": "value1"},
- {"delete": {"_index": "test", "_id": "2"}},
- {"create": {"_index": "test", "_id": "3"}},
- {"field1": "value3"},
- {"update": {"_id": "1", "_index": "test"}},
- {"doc": {"field2": "value2"}},
+ operations=[
+ {
+ "index": {
+ "_index": "test",
+ "_id": "1"
+ }
+ },
+ {
+ "field1": "value1"
+ },
+ {
+ "delete": {
+ "_index": "test",
+ "_id": "2"
+ }
+ },
+ {
+ "create": {
+ "_index": "test",
+ "_id": "3"
+ }
+ },
+ {
+ "field1": "value3"
+ },
+ {
+ "update": {
+ "_id": "1",
+ "_index": "test"
+ }
+ },
+ {
+ "doc": {
+ "field2": "value2"
+ }
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/aeaa97939a05f5b2f3f2c43b771f35e3.asciidoc b/docs/examples/aeaa97939a05f5b2f3f2c43b771f35e3.asciidoc
new file mode 100644
index 000000000..bdc24bf70
--- /dev/null
+++ b/docs/examples/aeaa97939a05f5b2f3f2c43b771f35e3.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/termvectors.asciidoc:310
+
+[source, python]
+----
+resp = client.termvectors(
+ index="my-index-000001",
+ id="1",
+ fields=[
+ "text",
+ "some_field_without_term_vectors"
+ ],
+ offsets=True,
+ positions=True,
+ term_statistics=True,
+ field_statistics=True,
+)
+print(resp)
+----
diff --git a/docs/examples/aee26dd62fbb6d614a0798f3344c0598.asciidoc b/docs/examples/aee26dd62fbb6d614a0798f3344c0598.asciidoc
new file mode 100644
index 000000000..ef2f914b9
--- /dev/null
+++ b/docs/examples/aee26dd62fbb6d614a0798f3344c0598.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/reverse-nested-aggregation.asciidoc:57
+
+[source, python]
+----
+resp = client.search(
+ index="issues",
+ query={
+ "match_all": {}
+ },
+ aggs={
+ "comments": {
+ "nested": {
+ "path": "comments"
+ },
+ "aggs": {
+ "top_usernames": {
+ "terms": {
+ "field": "comments.username"
+ },
+ "aggs": {
+ "comment_to_issue": {
+ "reverse_nested": {},
+ "aggs": {
+ "top_tags_per_comment": {
+ "terms": {
+ "field": "tags"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/aee4734ee63dbbbd12a21ee886f7a829.asciidoc b/docs/examples/aee4734ee63dbbbd12a21ee886f7a829.asciidoc
new file mode 100644
index 000000000..cb793773a
--- /dev/null
+++ b/docs/examples/aee4734ee63dbbbd12a21ee886f7a829.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:546
+
+[source, python]
+----
+resp = client.search(
+ sort=[
+ {
+ "_geo_distance": {
+ "pin.location": [
+ -70,
+ 40
+ ],
+ "order": "asc",
+ "unit": "km"
+ }
+ }
+ ],
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/af00a58d9171d32f6efe52d94e51e526.asciidoc b/docs/examples/af00a58d9171d32f6efe52d94e51e526.asciidoc
new file mode 100644
index 000000000..8c59c6d81
--- /dev/null
+++ b/docs/examples/af00a58d9171d32f6efe52d94e51e526.asciidoc
@@ -0,0 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:992
+
+[source, python]
+----
+resp = client.indices.create(
+ index="hindi_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "hindi_stop": {
+ "type": "stop",
+ "stopwords": "_hindi_"
+ },
+ "hindi_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "उदाहरण"
+ ]
+ },
+ "hindi_stemmer": {
+ "type": "stemmer",
+ "language": "hindi"
+ }
+ },
+ "analyzer": {
+ "rebuilt_hindi": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "decimal_digit",
+ "hindi_keywords",
+ "indic_normalization",
+ "hindi_normalization",
+ "hindi_stop",
+ "hindi_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/af18f5c5fb2364ae23c6a14431820aba.asciidoc b/docs/examples/af18f5c5fb2364ae23c6a14431820aba.asciidoc
new file mode 100644
index 000000000..f89b0e83c
--- /dev/null
+++ b/docs/examples/af18f5c5fb2364ae23c6a14431820aba.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/enrich/get-enrich-policy.asciidoc:88
+
+[source, python]
+----
+resp = client.enrich.get_policy(
+ name="my-policy",
+)
+print(resp)
+----
diff --git a/docs/examples/af44cc7fb0c435d4497c77baf904bf5e.asciidoc b/docs/examples/af44cc7fb0c435d4497c77baf904bf5e.asciidoc
index 8ad9787f2..24ecd3706 100644
--- a/docs/examples/af44cc7fb0c435d4497c77baf904bf5e.asciidoc
+++ b/docs/examples/af44cc7fb0c435d4497c77baf904bf5e.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:103
[source, python]
@@ -5,16 +6,14 @@
resp = client.search(
index="sales",
size="0",
- body={
- "aggs": {
- "sales_over_time": {
- "date_histogram": {
- "field": "date",
- "calendar_interval": "month",
- }
+ aggs={
+ "sales_over_time": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/af517b6936fa41d124d68b107b2efdc3.asciidoc b/docs/examples/af517b6936fa41d124d68b107b2efdc3.asciidoc
new file mode 100644
index 000000000..2835b2069
--- /dev/null
+++ b/docs/examples/af517b6936fa41d124d68b107b2efdc3.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/apis/delete-lifecycle.asciidoc:76
+
+[source, python]
+----
+resp = client.ilm.delete_lifecycle(
+ name="my_policy",
+)
+print(resp)
+----
diff --git a/docs/examples/af607715d0693587dd12962266359a96.asciidoc b/docs/examples/af607715d0693587dd12962266359a96.asciidoc
new file mode 100644
index 000000000..c05664775
--- /dev/null
+++ b/docs/examples/af607715d0693587dd12962266359a96.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/repository-s3.asciidoc:225
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_s3_repository",
+ repository={
+ "type": "s3",
+ "settings": {
+ "bucket": "my-bucket",
+ "another_setting": "setting-value"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/af746266a49a693ff6170c88da8a8c04.asciidoc b/docs/examples/af746266a49a693ff6170c88da8a8c04.asciidoc
new file mode 100644
index 000000000..b739bb0fa
--- /dev/null
+++ b/docs/examples/af746266a49a693ff6170c88da8a8c04.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/stop-tokenfilter.asciidoc:210
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "default": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "my_custom_stop_words_filter"
+ ]
+ }
+ },
+ "filter": {
+ "my_custom_stop_words_filter": {
+ "type": "stop",
+ "ignore_case": True,
+ "stopwords": [
+ "and",
+ "is",
+ "the"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/af7c5add165b005aefb552d79130fed6.asciidoc b/docs/examples/af7c5add165b005aefb552d79130fed6.asciidoc
new file mode 100644
index 000000000..f7c9d5a23
--- /dev/null
+++ b/docs/examples/af7c5add165b005aefb552d79130fed6.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-grid-query.asciidoc:232
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "geo_grid": {
+ "location": {
+ "geotile": "6/32/22"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/af84b3995564a7ca84360a526a4ac896.asciidoc b/docs/examples/af84b3995564a7ca84360a526a4ac896.asciidoc
new file mode 100644
index 000000000..2a8976c11
--- /dev/null
+++ b/docs/examples/af84b3995564a7ca84360a526a4ac896.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/truncate-tokenfilter.asciidoc:128
+
+[source, python]
+----
+resp = client.indices.create(
+ index="5_char_words_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "lowercase_5_char": {
+ "tokenizer": "lowercase",
+ "filter": [
+ "5_char_trunc"
+ ]
+ }
+ },
+ "filter": {
+ "5_char_trunc": {
+ "type": "truncate",
+ "length": 5
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/af85ad2551d1cc6742c6521d71c889cc.asciidoc b/docs/examples/af85ad2551d1cc6742c6521d71c889cc.asciidoc
new file mode 100644
index 000000000..217af1620
--- /dev/null
+++ b/docs/examples/af85ad2551d1cc6742c6521d71c889cc.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/specify-analyzer.asciidoc:50
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "title": {
+ "type": "text",
+ "analyzer": "whitespace"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/af91019991bee136df5460e2fd4ac72a.asciidoc b/docs/examples/af91019991bee136df5460e2fd4ac72a.asciidoc
new file mode 100644
index 000000000..30977ee75
--- /dev/null
+++ b/docs/examples/af91019991bee136df5460e2fd4ac72a.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/rollover-index.asciidoc:237
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="my-data-stream",
+ lazy=True,
+)
+print(resp)
+----
diff --git a/docs/examples/af970eb8b93cdea52209e1256eba9d8c.asciidoc b/docs/examples/af970eb8b93cdea52209e1256eba9d8c.asciidoc
new file mode 100644
index 000000000..04a36f456
--- /dev/null
+++ b/docs/examples/af970eb8b93cdea52209e1256eba9d8c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/shard-stores.asciidoc:124
+
+[source, python]
+----
+resp = client.indices.shard_stores(
+ index="test1,test2",
+)
+print(resp)
+----
diff --git a/docs/examples/afa11ebb493ebbfd77acbbe50d2ce6db.asciidoc b/docs/examples/afa11ebb493ebbfd77acbbe50d2ce6db.asciidoc
new file mode 100644
index 000000000..591e3db08
--- /dev/null
+++ b/docs/examples/afa11ebb493ebbfd77acbbe50d2ce6db.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-manual.asciidoc:591
+
+[source, python]
+----
+resp = client.search(
+ index="my-data-stream",
+ size=0,
+ aggs={
+ "tsid": {
+ "terms": {
+ "field": "_tsid"
+ },
+ "aggs": {
+ "over_time": {
+ "date_histogram": {
+ "field": "@timestamp",
+ "fixed_interval": "1d"
+ },
+ "aggs": {
+ "min": {
+ "min": {
+ "field": "kubernetes.container.memory.usage.bytes"
+ }
+ },
+ "max": {
+ "max": {
+ "field": "kubernetes.container.memory.usage.bytes"
+ }
+ },
+ "avg": {
+ "avg": {
+ "field": "kubernetes.container.memory.usage.bytes"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/afa24b7d72c2d9f586023a49bd655ec7.asciidoc b/docs/examples/afa24b7d72c2d9f586023a49bd655ec7.asciidoc
new file mode 100644
index 000000000..a419cceed
--- /dev/null
+++ b/docs/examples/afa24b7d72c2d9f586023a49bd655ec7.asciidoc
@@ -0,0 +1,50 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/use-elasticsearch-for-time-series-data.asciidoc:158
+
+[source, python]
+----
+resp = client.async_search.submit(
+ index="my-data-stream",
+ runtime_mappings={
+ "source.ip": {
+ "type": "ip",
+ "script": "\n String sourceip=grok('%{IPORHOST:sourceip} .*').extract(doc[ \"message\" ].value)?.sourceip;\n if (sourceip != null) emit(sourceip);\n "
+ }
+ },
+ query={
+ "bool": {
+ "filter": [
+ {
+ "range": {
+ "@timestamp": {
+ "gte": "now-2y/d",
+ "lt": "now/d"
+ }
+ }
+ },
+ {
+ "range": {
+ "source.ip": {
+ "gte": "192.0.2.0",
+ "lte": "192.0.2.255"
+ }
+ }
+ }
+ ]
+ }
+ },
+ fields=[
+ "*"
+ ],
+ source=False,
+ sort=[
+ {
+ "@timestamp": "desc"
+ },
+ {
+ "source.ip": "desc"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/afadb6bb7d0fa5a4531708af1ea8f9f8.asciidoc b/docs/examples/afadb6bb7d0fa5a4531708af1ea8f9f8.asciidoc
new file mode 100644
index 000000000..72ebc05c5
--- /dev/null
+++ b/docs/examples/afadb6bb7d0fa5a4531708af1ea8f9f8.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/ilm-with-existing-indices.asciidoc:159
+
+[source, python]
+----
+resp = client.reindex(
+ source={
+ "index": "mylogs-*"
+ },
+ dest={
+ "index": "mylogs",
+ "op_type": "create"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/afbea723c4ba0d50c67d04ebb73a4101.asciidoc b/docs/examples/afbea723c4ba0d50c67d04ebb73a4101.asciidoc
new file mode 100644
index 000000000..97e849ed6
--- /dev/null
+++ b/docs/examples/afbea723c4ba0d50c67d04ebb73a4101.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search-application/apis/delete-search-application.asciidoc:70
+
+[source, python]
+----
+resp = client.search_application.delete(
+ name="my-app",
+)
+print(resp)
+----
diff --git a/docs/examples/afc0a9cffc0100797a3f093094394763.asciidoc b/docs/examples/afc0a9cffc0100797a3f093094394763.asciidoc
new file mode 100644
index 000000000..a7d9d4dd4
--- /dev/null
+++ b/docs/examples/afc0a9cffc0100797a3f093094394763.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/saml-invalidate-api.asciidoc:82
+
+[source, python]
+----
+resp = client.security.saml_invalidate(
+ query_string="SAMLRequest=nZFda4MwFIb%2FiuS%2BmviRpqFaClKQdbvo2g12M2KMraCJ9cRR9utnW4Wyi13sMie873MeznJ1aWrnS3VQGR0j4mLkKC1NUeljjA77zYyhVbIE0dR%2By7fmaHq7U%2BdegXWGpAZ%2B%2F4pR32luBFTAtWgUcCv56%2Fp5y30X87Yz1khTIycdgpUW9kY7WdsC9zxoXTvMvWuVV98YyMnSGH2SYE5pwALBIr9QKiwDGpW0oGVUznGeMyJZKFkQ4jBf5HnhUymjIhzCAL3KNFihbYx8TBYzzGaY7EnIyZwHzCWMfiDnbRIftkSjJr%2BFu0e9v%2B0EgOquRiiZjKpiVFp6j50T4WXoyNJ%2FEWC9fdqc1t%2F1%2B2F3aUpjzhPiXpqMz1%2FHSn4A&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=MsAYz2NFdovMG2mXf6TSpu5vlQQyEJAg%2B4KCwBqJTmrb3yGXKUtIgvjqf88eCAK32v3eN8vupjPC8LglYmke1ZnjK0%2FKxzkvSjTVA7mMQe2AQdKbkyC038zzRq%2FYHcjFDE%2Bz0qISwSHZY2NyLePmwU7SexEXnIz37jKC6NMEhus%3D",
+ realm="saml1",
+)
+print(resp)
+----
diff --git a/docs/examples/afcacd742d18bf220e02f0bc6891526d.asciidoc b/docs/examples/afcacd742d18bf220e02f0bc6891526d.asciidoc
new file mode 100644
index 000000000..86931217c
--- /dev/null
+++ b/docs/examples/afcacd742d18bf220e02f0bc6891526d.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/autodatehistogram-aggregation.asciidoc:270
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "sale_date": {
+ "auto_date_histogram": {
+ "field": "date",
+ "buckets": 10,
+ "minimum_interval": "minute"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/afd90d268187f995dc002abc189f818d.asciidoc b/docs/examples/afd90d268187f995dc002abc189f818d.asciidoc
new file mode 100644
index 000000000..44ff72ac1
--- /dev/null
+++ b/docs/examples/afd90d268187f995dc002abc189f818d.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:345
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "date": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "1d",
+ "format": "yyyy-MM-dd"
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/afdb19ad1ebb4f64e235528b640817b6.asciidoc b/docs/examples/afdb19ad1ebb4f64e235528b640817b6.asciidoc
new file mode 100644
index 000000000..356990132
--- /dev/null
+++ b/docs/examples/afdb19ad1ebb4f64e235528b640817b6.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:793
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "drop": {
+ "description": "Drop documents with 'network.name' of 'Guest'",
+ "if": "ctx?.network?.name == 'Guest'"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/afe30f159937b38d74c869570cfcd369.asciidoc b/docs/examples/afe30f159937b38d74c869570cfcd369.asciidoc
new file mode 100644
index 000000000..844a2f7cd
--- /dev/null
+++ b/docs/examples/afe30f159937b38d74c869570cfcd369.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/restore-snapshot-api.asciidoc:268
+
+[source, python]
+----
+resp = client.indices.close(
+ index="index_1",
+)
+print(resp)
+
+resp1 = client.snapshot.restore(
+ repository="my_repository",
+ snapshot="snapshot_2",
+ wait_for_completion=True,
+ indices="index_1",
+)
+print(resp1)
+----
diff --git a/docs/examples/afe5aeb9317f0ae470b28e85a8d98274.asciidoc b/docs/examples/afe5aeb9317f0ae470b28e85a8d98274.asciidoc
new file mode 100644
index 000000000..21abf6db5
--- /dev/null
+++ b/docs/examples/afe5aeb9317f0ae470b28e85a8d98274.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/null-value.asciidoc:12
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "status_code": {
+ "type": "keyword",
+ "null_value": "NULL"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "status_code": None
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="my-index-000001",
+ id="2",
+ document={
+ "status_code": []
+ },
+)
+print(resp2)
+
+resp3 = client.search(
+ index="my-index-000001",
+ query={
+ "term": {
+ "status_code": "NULL"
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/afe87a2850326e0328fbebbefec2e839.asciidoc b/docs/examples/afe87a2850326e0328fbebbefec2e839.asciidoc
new file mode 100644
index 000000000..28bfe048b
--- /dev/null
+++ b/docs/examples/afe87a2850326e0328fbebbefec2e839.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-shards.asciidoc:170
+
+[source, python]
+----
+resp = client.search_shards(
+ index="my-index-000001",
+ routing="foo,bar",
+)
+print(resp)
+----
diff --git a/docs/examples/afef5cac988592b97ae289ab39c2f437.asciidoc b/docs/examples/afef5cac988592b97ae289ab39c2f437.asciidoc
index b834fcedb..b669c17e3 100644
--- a/docs/examples/afef5cac988592b97ae289ab39c2f437.asciidoc
+++ b/docs/examples/afef5cac988592b97ae289ab39c2f437.asciidoc
@@ -1,19 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/text.asciidoc:295
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "my_field": {
- "type": "text",
- "fields": {"keyword": {"type": "keyword"}},
+ mappings={
+ "properties": {
+ "my_field": {
+ "type": "text",
+ "fields": {
+ "keyword": {
+ "type": "keyword"
+ }
}
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/affc7ff234dc3acccb2bf7dc51f54813.asciidoc b/docs/examples/affc7ff234dc3acccb2bf7dc51f54813.asciidoc
new file mode 100644
index 000000000..c7e9ae827
--- /dev/null
+++ b/docs/examples/affc7ff234dc3acccb2bf7dc51f54813.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/charfilters/htmlstrip-charfilter.asciidoc:21
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="keyword",
+ char_filter=[
+ "html_strip"
+ ],
+ text="I'm so happy!
",
+)
+print(resp)
+----
diff --git a/docs/examples/b00ac39faf96785e89be8d4205fb984d.asciidoc b/docs/examples/b00ac39faf96785e89be8d4205fb984d.asciidoc
new file mode 100644
index 000000000..de74d8272
--- /dev/null
+++ b/docs/examples/b00ac39faf96785e89be8d4205fb984d.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:572
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my_search_application",
+ params={
+ "text": True,
+ "size": 5,
+ "query_string": "mountain climbing",
+ "text_fields": [
+ {
+ "name": "title",
+ "boost": 10
+ },
+ {
+ "name": "description",
+ "boost": 5
+ },
+ {
+ "name": "state",
+ "boost": 1
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b00d74eed431a272c829c0f798e3a539.asciidoc b/docs/examples/b00d74eed431a272c829c0f798e3a539.asciidoc
new file mode 100644
index 000000000..144506989
--- /dev/null
+++ b/docs/examples/b00d74eed431a272c829c0f798e3a539.asciidoc
@@ -0,0 +1,84 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/top-metrics-aggregation.asciidoc:89
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test",
+ mappings={
+ "properties": {
+ "d": {
+ "type": "date"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="test",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "s": 1,
+ "m": 3.1415,
+ "i": 1,
+ "d": "2020-01-01T00:12:12Z",
+ "t": "cat"
+ },
+ {
+ "index": {}
+ },
+ {
+ "s": 2,
+ "m": 1,
+ "i": 6,
+ "d": "2020-01-02T00:12:12Z",
+ "t": "dog"
+ },
+ {
+ "index": {}
+ },
+ {
+ "s": 3,
+ "m": 2.71828,
+ "i": -12,
+ "d": "2019-12-31T00:12:12Z",
+ "t": "chicken"
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="test",
+ filter_path="aggregations",
+ aggs={
+ "tm": {
+ "top_metrics": {
+ "metrics": [
+ {
+ "field": "m"
+ },
+ {
+ "field": "i"
+ },
+ {
+ "field": "d"
+ },
+ {
+ "field": "t.keyword"
+ }
+ ],
+ "sort": {
+ "s": "desc"
+ }
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/b00f3bc0e47905aaa2124d6a025c75d4.asciidoc b/docs/examples/b00f3bc0e47905aaa2124d6a025c75d4.asciidoc
new file mode 100644
index 000000000..a49ab0bee
--- /dev/null
+++ b/docs/examples/b00f3bc0e47905aaa2124d6a025c75d4.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:21
+
+[source, python]
+----
+resp = client.sql.query(
+ format="txt",
+ query="SELECT * FROM library ORDER BY page_count DESC LIMIT 5",
+)
+print(resp)
+----
diff --git a/docs/examples/b02e4907c9936c1adc16ccce9d49900d.asciidoc b/docs/examples/b02e4907c9936c1adc16ccce9d49900d.asciidoc
index aa0948b1a..ef96465f9 100644
--- a/docs/examples/b02e4907c9936c1adc16ccce9d49900d.asciidoc
+++ b/docs/examples/b02e4907c9936c1adc16ccce9d49900d.asciidoc
@@ -1,7 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
// cluster/health.asciidoc:156
[source, python]
----
resp = client.cluster.health()
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b0b1ae9582599f501f3b3ed8a42ea2af.asciidoc b/docs/examples/b0b1ae9582599f501f3b3ed8a42ea2af.asciidoc
new file mode 100644
index 000000000..1b9617fa6
--- /dev/null
+++ b/docs/examples/b0b1ae9582599f501f3b3ed8a42ea2af.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/circle.asciidoc:66
+
+[source, python]
+----
+resp = client.index(
+ index="circles",
+ id="1",
+ pipeline="polygonize_circles",
+ document={
+ "circle": "CIRCLE (30 10 40)"
+ },
+)
+print(resp)
+
+resp1 = client.get(
+ index="circles",
+ id="1",
+)
+print(resp1)
+----
diff --git a/docs/examples/b0bddf2ffaa83049b195829c06b875cd.asciidoc b/docs/examples/b0bddf2ffaa83049b195829c06b875cd.asciidoc
new file mode 100644
index 000000000..2ac514f11
--- /dev/null
+++ b/docs/examples/b0bddf2ffaa83049b195829c06b875cd.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:187
+
+[source, python]
+----
+resp = client.search_application.render_query(
+ name="my_search_application",
+ body=None,
+)
+print(resp)
+----
diff --git a/docs/examples/b0ce54ff4fec0b0c712506eb81e633f4.asciidoc b/docs/examples/b0ce54ff4fec0b0c712506eb81e633f4.asciidoc
new file mode 100644
index 000000000..acd45db1b
--- /dev/null
+++ b/docs/examples/b0ce54ff4fec0b0c712506eb81e633f4.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/date-index-name.asciidoc:78
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "description": "monthly date-time index naming",
+ "processors": [
+ {
+ "date_index_name": {
+ "field": "date1",
+ "index_name_prefix": "my-index-",
+ "date_rounding": "M"
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_source": {
+ "date1": "2016-04-25T12:02:01.789Z"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/b0d3f839237fabf8cdc2221734c668ad.asciidoc b/docs/examples/b0d3f839237fabf8cdc2221734c668ad.asciidoc
new file mode 100644
index 000000000..d68b9638c
--- /dev/null
+++ b/docs/examples/b0d3f839237fabf8cdc2221734c668ad.asciidoc
@@ -0,0 +1,50 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/distance-feature-query.asciidoc:62
+
+[source, python]
+----
+resp = client.index(
+ index="items",
+ id="1",
+ refresh=True,
+ document={
+ "name": "chocolate",
+ "production_date": "2018-02-01",
+ "location": [
+ -71.34,
+ 41.12
+ ]
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="items",
+ id="2",
+ refresh=True,
+ document={
+ "name": "chocolate",
+ "production_date": "2018-01-01",
+ "location": [
+ -71.3,
+ 41.15
+ ]
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="items",
+ id="3",
+ refresh=True,
+ document={
+ "name": "chocolate",
+ "production_date": "2017-12-01",
+ "location": [
+ -71.3,
+ 41.12
+ ]
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/b0eaf67e5cce24ef8889bf20951ccec1.asciidoc b/docs/examples/b0eaf67e5cce24ef8889bf20951ccec1.asciidoc
index dee1322a6..2c798a03c 100644
--- a/docs/examples/b0eaf67e5cce24ef8889bf20951ccec1.asciidoc
+++ b/docs/examples/b0eaf67e5cce24ef8889bf20951ccec1.asciidoc
@@ -1,19 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:131
[source, python]
----
resp = client.search(
- body={
- "query": {
- "dis_max": {
- "queries": [
- {"match": {"subject": "brown fox"}},
- {"match": {"message": "brown fox"}},
- ],
- "tie_breaker": 0.3,
- }
+ query={
+ "dis_max": {
+ "queries": [
+ {
+ "match": {
+ "subject": "brown fox"
+ }
+ },
+ {
+ "match": {
+ "message": "brown fox"
+ }
+ }
+ ],
+ "tie_breaker": 0.3
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b0fa301cd3c6b9db128e34114f0c1e8f.asciidoc b/docs/examples/b0fa301cd3c6b9db128e34114f0c1e8f.asciidoc
index 3be35619d..720cd29ba 100644
--- a/docs/examples/b0fa301cd3c6b9db128e34114f0c1e8f.asciidoc
+++ b/docs/examples/b0fa301cd3c6b9db128e34114f0c1e8f.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:105
[source, python]
@@ -5,7 +6,12 @@
resp = client.index(
index="test",
id="1",
- body={"counter": 1, "tags": ["red"]},
+ document={
+ "counter": 1,
+ "tags": [
+ "red"
+ ]
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b0fe9a7c8e519995258786be4bef36c4.asciidoc b/docs/examples/b0fe9a7c8e519995258786be4bef36c4.asciidoc
new file mode 100644
index 000000000..1318dded6
--- /dev/null
+++ b/docs/examples/b0fe9a7c8e519995258786be4bef36c4.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-inference.asciidoc:92
+
+[source, python]
+----
+resp = client.tasks.cancel(
+ task_id="",
+)
+print(resp)
+----
diff --git a/docs/examples/b109d0141ec8a0aed5d3805abc349a20.asciidoc b/docs/examples/b109d0141ec8a0aed5d3805abc349a20.asciidoc
new file mode 100644
index 000000000..45c0a912a
--- /dev/null
+++ b/docs/examples/b109d0141ec8a0aed5d3805abc349a20.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/movfn-aggregation.asciidoc:438
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "the_movavg": {
+ "moving_fn": {
+ "buckets_path": "the_sum",
+ "window": 10,
+ "script": "MovingFunctions.linearWeightedAvg(values)"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b11a0675e49df0709be693297ca73a2c.asciidoc b/docs/examples/b11a0675e49df0709be693297ca73a2c.asciidoc
new file mode 100644
index 000000000..8eab9b4d7
--- /dev/null
+++ b/docs/examples/b11a0675e49df0709be693297ca73a2c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/info.asciidoc:193
+
+[source, python]
+----
+resp = client.xpack.info(
+ categories="build,features",
+)
+print(resp)
+----
diff --git a/docs/examples/b14122481ae1f158f1a9a1bfbc4a41b1.asciidoc b/docs/examples/b14122481ae1f158f1a9a1bfbc4a41b1.asciidoc
index 0ca0ece51..38396f0d7 100644
--- a/docs/examples/b14122481ae1f158f1a9a1bfbc4a41b1.asciidoc
+++ b/docs/examples/b14122481ae1f158f1a9a1bfbc4a41b1.asciidoc
@@ -1,9 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
// setup/secure-settings.asciidoc:39
[source, python]
----
resp = client.nodes.reload_secure_settings(
- body={"secure_settings_password": "keystore-password"},
+ secure_settings_password="keystore-password",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b17143780e9904bfc1e1c53436497fa1.asciidoc b/docs/examples/b17143780e9904bfc1e1c53436497fa1.asciidoc
new file mode 100644
index 000000000..152b85824
--- /dev/null
+++ b/docs/examples/b17143780e9904bfc1e1c53436497fa1.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:574
+
+[source, python]
+----
+resp = client.sql.query(
+ format="json",
+ wait_for_completion_timeout="2s",
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=5,
+)
+print(resp)
+----
diff --git a/docs/examples/b176e0d428726705298184ef39ad5cb2.asciidoc b/docs/examples/b176e0d428726705298184ef39ad5cb2.asciidoc
new file mode 100644
index 000000000..a3853583b
--- /dev/null
+++ b/docs/examples/b176e0d428726705298184ef39ad5cb2.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-role-mappings.asciidoc:147
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="mapping2",
+ roles=[
+ "user",
+ "admin"
+ ],
+ enabled=True,
+ rules={
+ "field": {
+ "username": [
+ "esadmin01",
+ "esadmin02"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b195068563b1dc0f721f5f8c8d172312.asciidoc b/docs/examples/b195068563b1dc0f721f5f8c8d172312.asciidoc
index 44f78bcc7..868dc6de7 100644
--- a/docs/examples/b195068563b1dc0f721f5f8c8d172312.asciidoc
+++ b/docs/examples/b195068563b1dc0f721f5f8c8d172312.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:299
[source, python]
----
resp = client.index(
index="example",
- body={"location": "MULTIPOINT (1002.0 2000.0, 1003.0 2000.0)"},
+ document={
+ "location": "MULTIPOINT (1002.0 2000.0, 1003.0 2000.0)"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b1ee1b0b5f7af596e5f81743cfd3755f.asciidoc b/docs/examples/b1ee1b0b5f7af596e5f81743cfd3755f.asciidoc
new file mode 100644
index 000000000..e49919089
--- /dev/null
+++ b/docs/examples/b1ee1b0b5f7af596e5f81743cfd3755f.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/rollover-index.asciidoc:369
+
+[source, python]
+----
+resp = client.search(
+ index=",,",
+)
+print(resp)
+----
diff --git a/docs/examples/b1efa1c51a34dd5ab5511b71a399f5b1.asciidoc b/docs/examples/b1efa1c51a34dd5ab5511b71a399f5b1.asciidoc
index 1f2c69e22..52dccbd9a 100644
--- a/docs/examples/b1efa1c51a34dd5ab5511b71a399f5b1.asciidoc
+++ b/docs/examples/b1efa1c51a34dd5ab5511b71a399f5b1.asciidoc
@@ -1,12 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:450
[source, python]
----
resp = client.reindex(
- body={
- "source": {"index": "source"},
- "dest": {"index": "dest", "pipeline": "some_ingest_pipeline"},
+ source={
+ "index": "source"
+ },
+ dest={
+ "index": "dest",
+ "pipeline": "some_ingest_pipeline"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b1f7cb4157b13368373383abd7d2b8cb.asciidoc b/docs/examples/b1f7cb4157b13368373383abd7d2b8cb.asciidoc
new file mode 100644
index 000000000..916fb4aab
--- /dev/null
+++ b/docs/examples/b1f7cb4157b13368373383abd7d2b8cb.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/cluster/remote-clusters-connect.asciidoc:168
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster": {
+ "remote": {
+ "cluster_two": {
+ "transport.compress": False
+ },
+ "cluster_three": {
+ "transport.compress": True,
+ "transport.ping_schedule": "60s"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b22559a7c319f90bc63a41cac1c39b4c.asciidoc b/docs/examples/b22559a7c319f90bc63a41cac1c39b4c.asciidoc
new file mode 100644
index 000000000..df4bced52
--- /dev/null
+++ b/docs/examples/b22559a7c319f90bc63a41cac1c39b4c.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-api-keys.asciidoc:156
+
+[source, python]
+----
+resp = client.security.invalidate_api_key(
+ ids=[
+ "VuaCfGcBCdbkQm-e5aOx"
+ ],
+ owner=True,
+)
+print(resp)
+----
diff --git a/docs/examples/b23ed357dce8ec0014708b7b2850a8fb.asciidoc b/docs/examples/b23ed357dce8ec0014708b7b2850a8fb.asciidoc
new file mode 100644
index 000000000..068770a3d
--- /dev/null
+++ b/docs/examples/b23ed357dce8ec0014708b7b2850a8fb.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/tasks.asciidoc:78
+
+[source, python]
+----
+resp = client.cat.tasks(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/b2440b492149b705ef107137fdccb0c2.asciidoc b/docs/examples/b2440b492149b705ef107137fdccb0c2.asciidoc
new file mode 100644
index 000000000..de487a140
--- /dev/null
+++ b/docs/examples/b2440b492149b705ef107137fdccb0c2.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/get-follow-info.asciidoc:28
+
+[source, python]
+----
+resp = client.ccr.follow_info(
+ index="",
+)
+print(resp)
+----
diff --git a/docs/examples/b24a374c0ad264abbcacb5686f5ed61c.asciidoc b/docs/examples/b24a374c0ad264abbcacb5686f5ed61c.asciidoc
new file mode 100644
index 000000000..1b8ec1cc4
--- /dev/null
+++ b/docs/examples/b24a374c0ad264abbcacb5686f5ed61c.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/delimited-payload-tokenfilter.asciidoc:246
+
+[source, python]
+----
+resp = client.termvectors(
+ index="text_payloads",
+ id="1",
+ fields=[
+ "text"
+ ],
+ payloads=True,
+)
+print(resp)
+----
diff --git a/docs/examples/b25256ed615cd837461b0bfa590526b7.asciidoc b/docs/examples/b25256ed615cd837461b0bfa590526b7.asciidoc
new file mode 100644
index 000000000..4c2b3480e
--- /dev/null
+++ b/docs/examples/b25256ed615cd837461b0bfa590526b7.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/auto-follow/pause-auto-follow-pattern.asciidoc:79
+
+[source, python]
+----
+resp = client.ccr.pause_auto_follow_pattern(
+ name="my_auto_follow_pattern",
+)
+print(resp)
+----
diff --git a/docs/examples/b2652b1763a5fd31e95c983869b433bd.asciidoc b/docs/examples/b2652b1763a5fd31e95c983869b433bd.asciidoc
new file mode 100644
index 000000000..fab586ca6
--- /dev/null
+++ b/docs/examples/b2652b1763a5fd31e95c983869b433bd.asciidoc
@@ -0,0 +1,68 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/avg-aggregation.asciidoc:118
+
+[source, python]
+----
+resp = client.index(
+ index="metrics_index",
+ id="1",
+ document={
+ "network.name": "net-1",
+ "latency_histo": {
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 3,
+ 7,
+ 23,
+ 12,
+ 6
+ ]
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="metrics_index",
+ id="2",
+ document={
+ "network.name": "net-2",
+ "latency_histo": {
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 8,
+ 17,
+ 8,
+ 7,
+ 6
+ ]
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="metrics_index",
+ size="0",
+ aggs={
+ "avg_latency": {
+ "avg": {
+ "field": "latency_histo"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/b26b5574438e4eaf146b2428bf537c51.asciidoc b/docs/examples/b26b5574438e4eaf146b2428bf537c51.asciidoc
new file mode 100644
index 000000000..ad8b79e9a
--- /dev/null
+++ b/docs/examples/b26b5574438e4eaf146b2428bf537c51.asciidoc
@@ -0,0 +1,50 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/attachment.asciidoc:349
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="attachment",
+ description="Extract attachment information from arrays",
+ processors=[
+ {
+ "foreach": {
+ "field": "attachments",
+ "processor": {
+ "attachment": {
+ "target_field": "_ingest._value.attachment",
+ "field": "_ingest._value.data",
+ "remove_binary": False
+ }
+ }
+ }
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="my_id",
+ pipeline="attachment",
+ document={
+ "attachments": [
+ {
+ "filename": "ipsum.txt",
+ "data": "dGhpcyBpcwpqdXN0IHNvbWUgdGV4dAo="
+ },
+ {
+ "filename": "test.txt",
+ "data": "VGhpcyBpcyBhIHRlc3QK"
+ }
+ ]
+ },
+)
+print(resp1)
+
+resp2 = client.get(
+ index="my-index-000001",
+ id="my_id",
+)
+print(resp2)
+----
diff --git a/docs/examples/b2b26f8568c5dba7649e79f09b859272.asciidoc b/docs/examples/b2b26f8568c5dba7649e79f09b859272.asciidoc
new file mode 100644
index 000000000..5b5b5b357
--- /dev/null
+++ b/docs/examples/b2b26f8568c5dba7649e79f09b859272.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/saml-guide.asciidoc:944
+
+[source, python]
+----
+resp = client.security.put_user(
+ username="saml-service-user",
+ password="",
+ roles=[
+ "saml-service-role"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/b2dec193082462c775169db438308bc3.asciidoc b/docs/examples/b2dec193082462c775169db438308bc3.asciidoc
new file mode 100644
index 000000000..07cc9d549
--- /dev/null
+++ b/docs/examples/b2dec193082462c775169db438308bc3.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/remote-clusters-privileges-cert.asciidoc:46
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="remote-replication",
+ cluster=[
+ "read_ccr"
+ ],
+ indices=[
+ {
+ "names": [
+ "leader-index-name"
+ ],
+ "privileges": [
+ "monitor",
+ "read"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/b2e1e802fc3c5fbeb4190af7d598c23e.asciidoc b/docs/examples/b2e1e802fc3c5fbeb4190af7d598c23e.asciidoc
index 6b64ae725..7b16d31aa 100644
--- a/docs/examples/b2e1e802fc3c5fbeb4190af7d598c23e.asciidoc
+++ b/docs/examples/b2e1e802fc3c5fbeb4190af7d598c23e.asciidoc
@@ -1,14 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// docs/index_.asciidoc:277
[source, python]
----
resp = client.index(
index="my-index-000001",
- body={
+ document={
"@timestamp": "2099-11-15T13:12:00",
"message": "GET /search HTTP/1.1 200 1070000",
- "user": {"id": "kimchy"},
+ "user": {
+ "id": "kimchy"
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b2e20bca1846d7d584626b12eae9f6dc.asciidoc b/docs/examples/b2e20bca1846d7d584626b12eae9f6dc.asciidoc
new file mode 100644
index 000000000..c525f2679
--- /dev/null
+++ b/docs/examples/b2e20bca1846d7d584626b12eae9f6dc.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/disk/increase-other-node-capacity.asciidoc:80
+
+[source, python]
+----
+resp = client.cat.nodes(
+ v=True,
+ h="name,node.role,disk.used_percent,disk.used,disk.avail,disk.total",
+)
+print(resp)
+----
diff --git a/docs/examples/b2e4f3257c0e0aa3311f7270034bbc42.asciidoc b/docs/examples/b2e4f3257c0e0aa3311f7270034bbc42.asciidoc
new file mode 100644
index 000000000..a6d613e65
--- /dev/null
+++ b/docs/examples/b2e4f3257c0e0aa3311f7270034bbc42.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// data-management/migrate-index-allocation-filters.asciidoc:175
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my-index",
+ settings={
+ "index.routing.allocation.require.data": None,
+ "index.routing.allocation.include._tier_preference": "data_hot"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b3623b8c7f3e7650f52b6fb8b050f583.asciidoc b/docs/examples/b3623b8c7f3e7650f52b6fb8b050f583.asciidoc
new file mode 100644
index 000000000..149889b53
--- /dev/null
+++ b/docs/examples/b3623b8c7f3e7650f52b6fb8b050f583.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:405
+
+[source, python]
+----
+resp = client.features.get_features()
+print(resp)
+----
diff --git a/docs/examples/b3685560cb328f179d96ffe7c2668f72.asciidoc b/docs/examples/b3685560cb328f179d96ffe7c2668f72.asciidoc
new file mode 100644
index 000000000..9596661ad
--- /dev/null
+++ b/docs/examples/b3685560cb328f179d96ffe7c2668f72.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/movfn-aggregation.asciidoc:611
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "the_movavg": {
+ "moving_fn": {
+ "buckets_path": "the_sum",
+ "window": 10,
+ "script": "if (values.length > 5*2) {MovingFunctions.holtWinters(values, 0.3, 0.1, 0.1, 5, false)}"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b3756e700d0f6c7e8919003bdf26bc8f.asciidoc b/docs/examples/b3756e700d0f6c7e8919003bdf26bc8f.asciidoc
new file mode 100644
index 000000000..03ee84804
--- /dev/null
+++ b/docs/examples/b3756e700d0f6c7e8919003bdf26bc8f.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/delete-desired-balance.asciidoc:21
+
+[source, python]
+----
+resp = client.perform_request(
+ "DELETE",
+ "/_internal/desired_balance",
+)
+print(resp)
+----
diff --git a/docs/examples/b37919cc438b47477343833b4e522408.asciidoc b/docs/examples/b37919cc438b47477343833b4e522408.asciidoc
new file mode 100644
index 000000000..527c4a589
--- /dev/null
+++ b/docs/examples/b37919cc438b47477343833b4e522408.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/termvectors.asciidoc:418
+
+[source, python]
+----
+resp = client.termvectors(
+ index="imdb",
+ doc={
+ "plot": "When wealthy industrialist Tony Stark is forced to build an armored suit after a life-threatening incident, he ultimately decides to use its technology to fight against evil."
+ },
+ term_statistics=True,
+ field_statistics=True,
+ positions=False,
+ offsets=False,
+ filter={
+ "max_num_terms": 3,
+ "min_term_freq": 1,
+ "min_doc_freq": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b3a1c4220617ded67ed43fff2051d324.asciidoc b/docs/examples/b3a1c4220617ded67ed43fff2051d324.asciidoc
new file mode 100644
index 000000000..27c08527e
--- /dev/null
+++ b/docs/examples/b3a1c4220617ded67ed43fff2051d324.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/eager-global-ordinals.asciidoc:51
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my-index-000001",
+ properties={
+ "tags": {
+ "type": "keyword",
+ "eager_global_ordinals": True
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b3a711c3deddcdb8a3f6623184a8b794.asciidoc b/docs/examples/b3a711c3deddcdb8a3f6623184a8b794.asciidoc
index dda6087ad..1bb60badb 100644
--- a/docs/examples/b3a711c3deddcdb8a3f6623184a8b794.asciidoc
+++ b/docs/examples/b3a711c3deddcdb8a3f6623184a8b794.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:118
[source, python]
@@ -5,13 +6,13 @@
resp = client.update(
index="test",
id="1",
- body={
- "script": {
- "source": "ctx._source.counter += params.count",
- "lang": "painless",
- "params": {"count": 4},
+ script={
+ "source": "ctx._source.counter += params.count",
+ "lang": "painless",
+ "params": {
+ "count": 4
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b3ed567d2c0915a280b6b15f7a37539b.asciidoc b/docs/examples/b3ed567d2c0915a280b6b15f7a37539b.asciidoc
new file mode 100644
index 000000000..0df64674b
--- /dev/null
+++ b/docs/examples/b3ed567d2c0915a280b6b15f7a37539b.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/percentiles-bucket-aggregation.asciidoc:43
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "percentiles_monthly_sales": {
+ "percentiles_bucket": {
+ "buckets_path": "sales_per_month>sales",
+ "percents": [
+ 25,
+ 50,
+ 75
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b3fffd96fdb118cd059b5f1d67d928de.asciidoc b/docs/examples/b3fffd96fdb118cd059b5f1d67d928de.asciidoc
index 171f1277f..f675bdc39 100644
--- a/docs/examples/b3fffd96fdb118cd059b5f1d67d928de.asciidoc
+++ b/docs/examples/b3fffd96fdb118cd059b5f1d67d928de.asciidoc
@@ -1,15 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:331
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "MultiPoint",
- "coordinates": [[102, 2], [103, 2]],
+ "coordinates": [
+ [
+ 102,
+ 2
+ ],
+ [
+ 103,
+ 2
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b42e7d627cd79e4c5e7a4a3cd8b19ce0.asciidoc b/docs/examples/b42e7d627cd79e4c5e7a4a3cd8b19ce0.asciidoc
new file mode 100644
index 000000000..cc44a0d86
--- /dev/null
+++ b/docs/examples/b42e7d627cd79e4c5e7a4a3cd8b19ce0.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:948
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="one-pipeline-to-rule-them-all",
+ processors=[
+ {
+ "pipeline": {
+ "description": "If 'service.name' is 'apache_httpd', use 'httpd_pipeline'",
+ "if": "ctx.service?.name == 'apache_httpd'",
+ "name": "httpd_pipeline"
+ }
+ },
+ {
+ "pipeline": {
+ "description": "If 'service.name' is 'syslog', use 'syslog_pipeline'",
+ "if": "ctx.service?.name == 'syslog'",
+ "name": "syslog_pipeline"
+ }
+ },
+ {
+ "fail": {
+ "description": "If 'service.name' is not 'apache_httpd' or 'syslog', return a failure message",
+ "if": "ctx.service?.name != 'apache_httpd' && ctx.service?.name != 'syslog'",
+ "message": "This pipeline requires service.name to be either `syslog` or `apache_httpd`"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/b430122345d560bbd2a77826f5c475f7.asciidoc b/docs/examples/b430122345d560bbd2a77826f5c475f7.asciidoc
index 436ff6bdb..d86315735 100644
--- a/docs/examples/b430122345d560bbd2a77826f5c475f7.asciidoc
+++ b/docs/examples/b430122345d560bbd2a77826f5c475f7.asciidoc
@@ -1,34 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:272
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "ip_fields": {
- "match": ["ip_*", "*_ip"],
- "unmatch": ["one*", "*two"],
- "mapping": {"type": "ip"},
+ mappings={
+ "dynamic_templates": [
+ {
+ "ip_fields": {
+ "match": [
+ "ip_*",
+ "*_ip"
+ ],
+ "unmatch": [
+ "one*",
+ "*two"
+ ],
+ "mapping": {
+ "type": "ip"
}
}
- ]
- }
+ }
+ ]
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index",
id="1",
- body={
+ document={
"one_ip": "will not match",
"ip_two": "will not match",
"three_ip": "12.12.12.12",
- "ip_four": "13.13.13.13",
+ "ip_four": "13.13.13.13"
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc b/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc
index 4a346277c..9b704644e 100644
--- a/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc
+++ b/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// inference/post-inference.asciidoc:106
[source, python]
@@ -5,7 +6,7 @@
resp = client.inference.inference(
task_type="completion",
inference_id="openai_chat_completions",
- body={"input": "What is Elastic?"},
+ input="What is Elastic?",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b45c60f908b329835ab40609423f378e.asciidoc b/docs/examples/b45c60f908b329835ab40609423f378e.asciidoc
new file mode 100644
index 000000000..83ea40f77
--- /dev/null
+++ b/docs/examples/b45c60f908b329835ab40609423f378e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/increase-tier-capacity.asciidoc:272
+
+[source, python]
+----
+resp = client.cat.nodes(
+ h="node.role",
+)
+print(resp)
+----
diff --git a/docs/examples/b468d0124dc485385a34504d5b7af82a.asciidoc b/docs/examples/b468d0124dc485385a34504d5b7af82a.asciidoc
new file mode 100644
index 000000000..a613d0c3d
--- /dev/null
+++ b/docs/examples/b468d0124dc485385a34504d5b7af82a.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-reindex.asciidoc:54
+
+[source, python]
+----
+resp = client.reindex(
+ wait_for_completion=False,
+ source={
+ "index": "test-data",
+ "size": 50
+ },
+ dest={
+ "index": "hugging-face-embeddings",
+ "pipeline": "hugging_face_embeddings"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b4693f2aa9fa65db04ab2499355c54fc.asciidoc b/docs/examples/b4693f2aa9fa65db04ab2499355c54fc.asciidoc
new file mode 100644
index 000000000..1816e6e93
--- /dev/null
+++ b/docs/examples/b4693f2aa9fa65db04ab2499355c54fc.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-search.asciidoc:4
+
+[source, python]
+----
+resp = client.search(
+ index="cohere-embeddings",
+ knn={
+ "field": "content_embedding",
+ "query_vector_builder": {
+ "text_embedding": {
+ "model_id": "cohere_embeddings",
+ "model_text": "Muscles in human body"
+ }
+ },
+ "k": 10,
+ "num_candidates": 100
+ },
+ source=[
+ "id",
+ "content"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/b47945c7db8868dd36ba079b742f2a90.asciidoc b/docs/examples/b47945c7db8868dd36ba079b742f2a90.asciidoc
new file mode 100644
index 000000000..063d7e389
--- /dev/null
+++ b/docs/examples/b47945c7db8868dd36ba079b742f2a90.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// search-application/apis/put-search-application.asciidoc:197
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my-app",
+ params={
+ "default_field": "author",
+ "query_string": "Jane"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b4946ecc9101b97102a1c5bcb19e5607.asciidoc b/docs/examples/b4946ecc9101b97102a1c5bcb19e5607.asciidoc
new file mode 100644
index 000000000..d71043989
--- /dev/null
+++ b/docs/examples/b4946ecc9101b97102a1c5bcb19e5607.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:534
+
+[source, python]
+----
+resp = client.render_search_template(
+ source="{ \"query\": { \"bool\": { \"filter\": [ {{#year_scope}} { \"range\": { \"@timestamp\": { \"gte\": \"now-1y/d\", \"lt\": \"now/d\" } } }, {{/year_scope}} { \"term\": { \"user.id\": \"{{user_id}}\" }}]}}}",
+ params={
+ "year_scope": True,
+ "user_id": "kimchy"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b4aec2a1d353852507c091bdb629b765.asciidoc b/docs/examples/b4aec2a1d353852507c091bdb629b765.asciidoc
new file mode 100644
index 000000000..8e73e995a
--- /dev/null
+++ b/docs/examples/b4aec2a1d353852507c091bdb629b765.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/put-filter.asciidoc:51
+
+[source, python]
+----
+resp = client.ml.put_filter(
+ filter_id="safe_domains",
+ description="A list of safe domains",
+ items=[
+ "*.google.com",
+ "wikipedia.org"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/b4d1fc887e40885cdf6ac2d01487cb76.asciidoc b/docs/examples/b4d1fc887e40885cdf6ac2d01487cb76.asciidoc
new file mode 100644
index 000000000..bf208d2f9
--- /dev/null
+++ b/docs/examples/b4d1fc887e40885cdf6ac2d01487cb76.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-multi-term-query.asciidoc:28
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_multi": {
+ "match": {
+ "prefix": {
+ "user.id": {
+ "value": "ki",
+ "boost": 1.08
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b4d9d5017d42f27281e734e969949623.asciidoc b/docs/examples/b4d9d5017d42f27281e734e969949623.asciidoc
new file mode 100644
index 000000000..4715dbe14
--- /dev/null
+++ b/docs/examples/b4d9d5017d42f27281e734e969949623.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/snapshot/corrupt-repository.asciidoc:140
+
+[source, python]
+----
+resp = client.snapshot.get_repository(
+ name="my-repo",
+)
+print(resp)
+----
diff --git a/docs/examples/b4da132cb934c33d61e2b60988c6d4a3.asciidoc b/docs/examples/b4da132cb934c33d61e2b60988c6d4a3.asciidoc
new file mode 100644
index 000000000..9cede5651
--- /dev/null
+++ b/docs/examples/b4da132cb934c33d61e2b60988c6d4a3.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/serial-diff-aggregation.asciidoc:69
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "day"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "lemmings"
+ }
+ },
+ "thirtieth_difference": {
+ "serial_diff": {
+ "buckets_path": "the_sum",
+ "lag": 30
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b4f3165e873f551fbaa03945877eb370.asciidoc b/docs/examples/b4f3165e873f551fbaa03945877eb370.asciidoc
index f34dbe7dc..cf56aae16 100644
--- a/docs/examples/b4f3165e873f551fbaa03945877eb370.asciidoc
+++ b/docs/examples/b4f3165e873f551fbaa03945877eb370.asciidoc
@@ -1,17 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/field-mapping.asciidoc:126
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"dynamic_date_formats": ["yyyy/MM", "MM/dd/yyyy"]}},
+ mappings={
+ "dynamic_date_formats": [
+ "yyyy/MM",
+ "MM/dd/yyyy"
+ ]
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"create_date": "09/25/2015"},
+ document={
+ "create_date": "09/25/2015"
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/b4f4c9ad3301c97fb3c38d108a3bc453.asciidoc b/docs/examples/b4f4c9ad3301c97fb3c38d108a3bc453.asciidoc
new file mode 100644
index 000000000..99786471c
--- /dev/null
+++ b/docs/examples/b4f4c9ad3301c97fb3c38d108a3bc453.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/cluster/remote-clusters-connect.asciidoc:125
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster": {
+ "remote": {
+ "cluster_one": {
+ "seeds": [
+ "127.0.0.1:{remote-interface-default-port}"
+ ]
+ },
+ "cluster_two": {
+ "mode": "sniff",
+ "seeds": [
+ "127.0.0.1:{remote-interface-default-port-plus1}"
+ ],
+ "transport.compress": True,
+ "skip_unavailable": True
+ },
+ "cluster_three": {
+ "mode": "proxy",
+ "proxy_address": "127.0.0.1:{remote-interface-default-port-plus2}"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b504119238b44cddd3b5944da20a498d.asciidoc b/docs/examples/b504119238b44cddd3b5944da20a498d.asciidoc
index 1896c8b7e..b58828267 100644
--- a/docs/examples/b504119238b44cddd3b5944da20a498d.asciidoc
+++ b/docs/examples/b504119238b44cddd3b5944da20a498d.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:214
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "POLYGON ((1000.0 -1001.0, 1001.0 -1001.0, 1001.0 -1000.0, 1000.0 -1000.0, 1000.0 -1001.0))"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b515427f8685ca7d79176def672d19fa.asciidoc b/docs/examples/b515427f8685ca7d79176def672d19fa.asciidoc
index 1c2ba8431..968ed6448 100644
--- a/docs/examples/b515427f8685ca7d79176def672d19fa.asciidoc
+++ b/docs/examples/b515427f8685ca7d79176def672d19fa.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:612
[source, python]
@@ -5,11 +6,11 @@
resp = client.indices.refresh()
print(resp)
-resp = client.search(
+resp1 = client.search(
index="my-index-000001",
size="0",
q="extra:test",
filter_path="hits.total",
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/b52951b78cd5fb2f9353d1c7e6d37070.asciidoc b/docs/examples/b52951b78cd5fb2f9353d1c7e6d37070.asciidoc
index 3e91295a4..26cb458c7 100644
--- a/docs/examples/b52951b78cd5fb2f9353d1c7e6d37070.asciidoc
+++ b/docs/examples/b52951b78cd5fb2f9353d1c7e6d37070.asciidoc
@@ -1,19 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/wildcard-query.asciidoc:21
[source, python]
----
resp = client.search(
- body={
- "query": {
- "wildcard": {
- "user.id": {
- "value": "ki*y",
- "boost": 1,
- "rewrite": "constant_score_blended",
- }
+ query={
+ "wildcard": {
+ "user.id": {
+ "value": "ki*y",
+ "boost": 1,
+ "rewrite": "constant_score_blended"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b557f114e21dbc6f531d4e7621a08e8f.asciidoc b/docs/examples/b557f114e21dbc6f531d4e7621a08e8f.asciidoc
new file mode 100644
index 000000000..0b87c58c8
--- /dev/null
+++ b/docs/examples/b557f114e21dbc6f531d4e7621a08e8f.asciidoc
@@ -0,0 +1,52 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/source-field.asciidoc:80
+
+[source, python]
+----
+resp = client.indices.create(
+ index="logs",
+ mappings={
+ "_source": {
+ "includes": [
+ "*.count",
+ "meta.*"
+ ],
+ "excludes": [
+ "meta.description",
+ "meta.other.*"
+ ]
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="logs",
+ id="1",
+ document={
+ "requests": {
+ "count": 10,
+ "foo": "bar"
+ },
+ "meta": {
+ "name": "Some metric",
+ "description": "Some metric description",
+ "other": {
+ "foo": "one",
+ "baz": "two"
+ }
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="logs",
+ query={
+ "match": {
+ "meta.other.foo": "one"
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/b573e893de0d5f92d67f4f5eb7f0c353.asciidoc b/docs/examples/b573e893de0d5f92d67f4f5eb7f0c353.asciidoc
new file mode 100644
index 000000000..9d6ead2fe
--- /dev/null
+++ b/docs/examples/b573e893de0d5f92d67f4f5eb7f0c353.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/stats-bucket-aggregation.asciidoc:41
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "stats_monthly_sales": {
+ "stats_bucket": {
+ "buckets_path": "sales_per_month>sales"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b577e7e7eb5ce9d16cb582356e2cc45c.asciidoc b/docs/examples/b577e7e7eb5ce9d16cb582356e2cc45c.asciidoc
new file mode 100644
index 000000000..8a8e061a5
--- /dev/null
+++ b/docs/examples/b577e7e7eb5ce9d16cb582356e2cc45c.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/geoip.asciidoc:83
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="geoip",
+ description="Add geoip info",
+ processors=[
+ {
+ "geoip": {
+ "field": "ip"
+ }
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="my_id",
+ pipeline="geoip",
+ document={
+ "ip": "89.160.20.128"
+ },
+)
+print(resp1)
+
+resp2 = client.get(
+ index="my-index-000001",
+ id="my_id",
+)
+print(resp2)
+----
diff --git a/docs/examples/b583bf8d3a2f49d633aa2cfed5606418.asciidoc b/docs/examples/b583bf8d3a2f49d633aa2cfed5606418.asciidoc
new file mode 100644
index 000000000..104cdbd91
--- /dev/null
+++ b/docs/examples/b583bf8d3a2f49d633aa2cfed5606418.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-component-template.asciidoc:186
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="template_1",
+ template={
+ "settings": {
+ "number_of_shards": 1
+ },
+ "aliases": {
+ "alias1": {},
+ "alias2": {
+ "filter": {
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
+ "routing": "shard-1"
+ },
+ "{index}-alias": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b58b17975bbce307b2ccce5051a449e8.asciidoc b/docs/examples/b58b17975bbce307b2ccce5051a449e8.asciidoc
index 698a8e83e..f22ed8c1c 100644
--- a/docs/examples/b58b17975bbce307b2ccce5051a449e8.asciidoc
+++ b/docs/examples/b58b17975bbce307b2ccce5051a449e8.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:538
[source, python]
@@ -6,7 +7,13 @@ resp = client.search(
index="my-index-000001",
size="0",
filter_path="hits.total",
- body={"query": {"range": {"http.response.bytes": {"lt": 2000000}}}},
+ query={
+ "range": {
+ "http.response.bytes": {
+ "lt": 2000000
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b5bc1bb7278f2f95bc54790c78c928e0.asciidoc b/docs/examples/b5bc1bb7278f2f95bc54790c78c928e0.asciidoc
new file mode 100644
index 000000000..5f3f94bdc
--- /dev/null
+++ b/docs/examples/b5bc1bb7278f2f95bc54790c78c928e0.asciidoc
@@ -0,0 +1,47 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/get-job.asciidoc:163
+
+[source, python]
+----
+resp = client.rollup.put_job(
+ id="sensor2",
+ index_pattern="sensor-*",
+ rollup_index="sensor_rollup",
+ cron="*/30 * * * * ?",
+ page_size=1000,
+ groups={
+ "date_histogram": {
+ "field": "timestamp",
+ "fixed_interval": "1h",
+ "delay": "7d"
+ },
+ "terms": {
+ "fields": [
+ "node"
+ ]
+ }
+ },
+ metrics=[
+ {
+ "field": "temperature",
+ "metrics": [
+ "min",
+ "max",
+ "sum"
+ ]
+ },
+ {
+ "field": "voltage",
+ "metrics": [
+ "avg"
+ ]
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.rollup.get_jobs(
+ id="_all",
+)
+print(resp1)
+----
diff --git a/docs/examples/b5e5cd4eccc40d7c5f2a1fcb654bd4a4.asciidoc b/docs/examples/b5e5cd4eccc40d7c5f2a1fcb654bd4a4.asciidoc
new file mode 100644
index 000000000..658be6c5c
--- /dev/null
+++ b/docs/examples/b5e5cd4eccc40d7c5f2a1fcb654bd4a4.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/diversified-sampler-aggregation.asciidoc:33
+
+[source, python]
+----
+resp = client.search(
+ index="stackoverflow",
+ size="0",
+ query={
+ "query_string": {
+ "query": "tags:elasticsearch"
+ }
+ },
+ aggs={
+ "my_unbiased_sample": {
+ "diversified_sampler": {
+ "shard_size": 200,
+ "field": "author"
+ },
+ "aggs": {
+ "keywords": {
+ "significant_terms": {
+ "field": "tags",
+ "exclude": [
+ "elasticsearch"
+ ]
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b601bc78fb69e15a42e0783219ddc38d.asciidoc b/docs/examples/b601bc78fb69e15a42e0783219ddc38d.asciidoc
new file mode 100644
index 000000000..810b68128
--- /dev/null
+++ b/docs/examples/b601bc78fb69e15a42e0783219ddc38d.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/max-bucket-aggregation.asciidoc:42
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "max_monthly_sales": {
+ "max_bucket": {
+ "buckets_path": "sales_per_month>sales"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b607eea422295a3e9acd75f9ed1c8cb7.asciidoc b/docs/examples/b607eea422295a3e9acd75f9ed1c8cb7.asciidoc
new file mode 100644
index 000000000..c1251db36
--- /dev/null
+++ b/docs/examples/b607eea422295a3e9acd75f9ed1c8cb7.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:370
+
+[source, python]
+----
+resp = client.search(
+ sort=[
+ {
+ "price": {
+ "missing": "_last"
+ }
+ }
+ ],
+ query={
+ "term": {
+ "product": "chocolate"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b61afb7ca29a11243232ffcc8b5a43cf.asciidoc b/docs/examples/b61afb7ca29a11243232ffcc8b5a43cf.asciidoc
new file mode 100644
index 000000000..115fa8975
--- /dev/null
+++ b/docs/examples/b61afb7ca29a11243232ffcc8b5a43cf.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-field-mapping.asciidoc:165
+
+[source, python]
+----
+resp = client.indices.get_field_mapping(
+ index="publications",
+ fields="a*",
+)
+print(resp)
+----
diff --git a/docs/examples/b620ef4400d2f660fe2c67835938442c.asciidoc b/docs/examples/b620ef4400d2f660fe2c67835938442c.asciidoc
new file mode 100644
index 000000000..1960d81c3
--- /dev/null
+++ b/docs/examples/b620ef4400d2f660fe2c67835938442c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/apis/delete-autoscaling-policy.asciidoc:62
+
+[source, python]
+----
+resp = client.autoscaling.delete_autoscaling_policy(
+ name="my_autoscaling_policy",
+)
+print(resp)
+----
diff --git a/docs/examples/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc b/docs/examples/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc
new file mode 100644
index 000000000..a785417c2
--- /dev/null
+++ b/docs/examples/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc
@@ -0,0 +1,195 @@
+// This file is autogenerated, DO NOT EDIT
+// text-structure/apis/find-field-structure.asciidoc:89
+
+[source, python]
+----
+resp = client.bulk(
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized"
+ },
+ {
+ "index": {
+ "_index": "test-logs"
+ }
+ },
+ {
+ "message": "[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ..."
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.text_structure.find_field_structure(
+ index="test-logs",
+ field="message",
+ body=None,
+)
+print(resp1)
+----
diff --git a/docs/examples/b638e11d6a8a084290f8934d224abd52.asciidoc b/docs/examples/b638e11d6a8a084290f8934d224abd52.asciidoc
new file mode 100644
index 000000000..ef1879112
--- /dev/null
+++ b/docs/examples/b638e11d6a8a084290f8934d224abd52.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/troubleshooting-shards-capacity.asciidoc:450
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.max_shards_per_node.frozen": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b63ce79ce4fa1bb9b99a789f4dcfef4e.asciidoc b/docs/examples/b63ce79ce4fa1bb9b99a789f4dcfef4e.asciidoc
new file mode 100644
index 000000000..8e011fca9
--- /dev/null
+++ b/docs/examples/b63ce79ce4fa1bb9b99a789f4dcfef4e.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/top-metrics-aggregation.asciidoc:272
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="test",
+ settings={
+ "top_metrics_max_size": 100
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b65dbb51ddd496189c65a9326a53480c.asciidoc b/docs/examples/b65dbb51ddd496189c65a9326a53480c.asciidoc
new file mode 100644
index 000000000..3843df6b0
--- /dev/null
+++ b/docs/examples/b65dbb51ddd496189c65a9326a53480c.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/repository-read-only-url.asciidoc:14
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_read_only_url_repository",
+ repository={
+ "type": "url",
+ "settings": {
+ "url": "file:/mount/backups/my_fs_backup_location"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b66be1daf6c220eb66d94e708b2fae39.asciidoc b/docs/examples/b66be1daf6c220eb66d94e708b2fae39.asciidoc
new file mode 100644
index 000000000..8902c863a
--- /dev/null
+++ b/docs/examples/b66be1daf6c220eb66d94e708b2fae39.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/state.asciidoc:144
+
+[source, python]
+----
+resp = client.cluster.state(
+ metric="metadata,routing_table",
+ index="foo,bar",
+)
+print(resp)
+----
diff --git a/docs/examples/b67fa8c560dd10a8e6f226048cd21562.asciidoc b/docs/examples/b67fa8c560dd10a8e6f226048cd21562.asciidoc
new file mode 100644
index 000000000..f8388e328
--- /dev/null
+++ b/docs/examples/b67fa8c560dd10a8e6f226048cd21562.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:472
+
+[source, python]
+----
+resp = client.render_search_template(
+ source="{ \"query\": { \"bool\": { \"must\": {{#toJson}}clauses{{/toJson}} }}}",
+ params={
+ "clauses": [
+ {
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
+ {
+ "term": {
+ "url.domain": "example.com"
+ }
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b68ed7037042719945a2452d23e64c78.asciidoc b/docs/examples/b68ed7037042719945a2452d23e64c78.asciidoc
new file mode 100644
index 000000000..ff3787f68
--- /dev/null
+++ b/docs/examples/b68ed7037042719945a2452d23e64c78.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:343
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="3",
+ refresh=True,
+ document={
+ "query": {
+ "match": {
+ "message": "brown fox"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b691d41f84b5b46e9051b51db22a46af.asciidoc b/docs/examples/b691d41f84b5b46e9051b51db22a46af.asciidoc
new file mode 100644
index 000000000..4ec1f9394
--- /dev/null
+++ b/docs/examples/b691d41f84b5b46e9051b51db22a46af.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/rare-terms-aggregation.asciidoc:308
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "genres": {
+ "rare_terms": {
+ "field": "genre",
+ "include": [
+ "swing",
+ "rock"
+ ],
+ "exclude": [
+ "jazz"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b6a6aa9ba20e9a019371ae268488833f.asciidoc b/docs/examples/b6a6aa9ba20e9a019371ae268488833f.asciidoc
index b6617e407..16ae792b9 100644
--- a/docs/examples/b6a6aa9ba20e9a019371ae268488833f.asciidoc
+++ b/docs/examples/b6a6aa9ba20e9a019371ae268488833f.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// modules/cluster/remote-clusters-migration.asciidoc:96
[source, python]
@@ -6,4 +7,4 @@ resp = client.cluster.get_settings(
filter_path="persistent.cluster.remote",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b6a7ffd2003c38f4aa321f067d162be5.asciidoc b/docs/examples/b6a7ffd2003c38f4aa321f067d162be5.asciidoc
new file mode 100644
index 000000000..5bcfbbfb9
--- /dev/null
+++ b/docs/examples/b6a7ffd2003c38f4aa321f067d162be5.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-elser.asciidoc:248
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "bool": {
+ "should": [
+ {
+ "sparse_vector": {
+ "field": "content_embedding",
+ "inference_id": "my-elser-endpoint",
+ "query": "How to avoid muscle soreness after running?",
+ "boost": 1
+ }
+ },
+ {
+ "query_string": {
+ "query": "toxins",
+ "boost": 4
+ }
+ }
+ ]
+ }
+ },
+ min_score=10,
+)
+print(resp)
+----
diff --git a/docs/examples/b6c872d04eabb39d1947cde6b29d4ae1.asciidoc b/docs/examples/b6c872d04eabb39d1947cde6b29d4ae1.asciidoc
index 4c493746b..2638973dc 100644
--- a/docs/examples/b6c872d04eabb39d1947cde6b29d4ae1.asciidoc
+++ b/docs/examples/b6c872d04eabb39d1947cde6b29d4ae1.asciidoc
@@ -1,11 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:419
[source, python]
----
resp = client.search(
- body={
- "aggs": {"tags": {"terms": {"field": "tags", "min_doc_count": 10}}}
+ aggs={
+ "tags": {
+ "terms": {
+ "field": "tags",
+ "min_doc_count": 10
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b6e29a0e14b611d4aaafb3051220ea56.asciidoc b/docs/examples/b6e29a0e14b611d4aaafb3051220ea56.asciidoc
new file mode 100644
index 000000000..a6e14337e
--- /dev/null
+++ b/docs/examples/b6e29a0e14b611d4aaafb3051220ea56.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/specify-analyzer.asciidoc:158
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "title": {
+ "type": "text",
+ "analyzer": "whitespace",
+ "search_analyzer": "simple"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b6e385760e036e36827f719b540d9c11.asciidoc b/docs/examples/b6e385760e036e36827f719b540d9c11.asciidoc
new file mode 100644
index 000000000..c8743faa1
--- /dev/null
+++ b/docs/examples/b6e385760e036e36827f719b540d9c11.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/profile.asciidoc:1181
+
+[source, python]
+----
+resp = client.search(
+ index="my-dfs-index",
+ search_type="dfs_query_then_fetch",
+ pretty=True,
+ size="0",
+ profile=True,
+ query={
+ "term": {
+ "my-keyword": {
+ "value": "a"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b6f690896001f8f9ad5bf24e1304a552.asciidoc b/docs/examples/b6f690896001f8f9ad5bf24e1304a552.asciidoc
index 2e256e211..9d4e68d83 100644
--- a/docs/examples/b6f690896001f8f9ad5bf24e1304a552.asciidoc
+++ b/docs/examples/b6f690896001f8f9ad5bf24e1304a552.asciidoc
@@ -1,21 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/dense-vector.asciidoc:158
[source, python]
----
resp = client.indices.create(
index="my-byte-quantized-index",
- body={
- "mappings": {
- "properties": {
- "my_vector": {
- "type": "dense_vector",
- "dims": 4,
- "index": True,
- "index_options": {"type": "int4_hnsw"},
+ mappings={
+ "properties": {
+ "my_vector": {
+ "type": "dense_vector",
+ "dims": 4,
+ "index": True,
+ "index_options": {
+ "type": "int4_hnsw"
}
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b717a583b5165e5c6caafc42fdfd9086.asciidoc b/docs/examples/b717a583b5165e5c6caafc42fdfd9086.asciidoc
new file mode 100644
index 000000000..eb1d131c2
--- /dev/null
+++ b/docs/examples/b717a583b5165e5c6caafc42fdfd9086.asciidoc
@@ -0,0 +1,82 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/cartesian-bounds-aggregation.asciidoc:97
+
+[source, python]
+----
+resp = client.indices.create(
+ index="places",
+ mappings={
+ "properties": {
+ "geometry": {
+ "type": "shape"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="places",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "name": "NEMO Science Museum",
+ "geometry": "POINT(491.2350 5237.4081)"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "name": "Sportpark De Weeren",
+ "geometry": {
+ "type": "Polygon",
+ "coordinates": [
+ [
+ [
+ 496.5305328369141,
+ 5239.347642069457
+ ],
+ [
+ 496.6979026794433,
+ 5239.172175893484
+ ],
+ [
+ 496.9425201416015,
+ 5239.238958618537
+ ],
+ [
+ 496.7944622039794,
+ 5239.420969150824
+ ],
+ [
+ 496.5305328369141,
+ 5239.347642069457
+ ]
+ ]
+ ]
+ }
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="places",
+ size="0",
+ aggs={
+ "viewport": {
+ "cartesian_bounds": {
+ "field": "geometry"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/b724f547c5d67e95bbc0a9920e47033c.asciidoc b/docs/examples/b724f547c5d67e95bbc0a9920e47033c.asciidoc
new file mode 100644
index 000000000..502ba4b3b
--- /dev/null
+++ b/docs/examples/b724f547c5d67e95bbc0a9920e47033c.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/pathhierarchy-tokenizer.asciidoc:289
+
+[source, python]
+----
+resp = client.search(
+ index="file-path-test",
+ query={
+ "term": {
+ "file_path.tree": "/User/alice/photos/2017/05/16"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b728d6ba226dba719aadcd8b8099cc74.asciidoc b/docs/examples/b728d6ba226dba719aadcd8b8099cc74.asciidoc
new file mode 100644
index 000000000..73ab3b7f8
--- /dev/null
+++ b/docs/examples/b728d6ba226dba719aadcd8b8099cc74.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:174
+
+[source, python]
+----
+resp = client.cat.allocation(
+ v=True,
+ h="node,shards,disk.*",
+)
+print(resp)
+----
diff --git a/docs/examples/b7a4f5b9a93eff44268a1ee38ee1c6d3.asciidoc b/docs/examples/b7a4f5b9a93eff44268a1ee38ee1c6d3.asciidoc
new file mode 100644
index 000000000..f27bdf7bf
--- /dev/null
+++ b/docs/examples/b7a4f5b9a93eff44268a1ee38ee1c6d3.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:199
+
+[source, python]
+----
+resp = client.reindex(
+ source={
+ "index": "archive"
+ },
+ dest={
+ "index": "my-data-stream",
+ "op_type": "create"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc b/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc
index 7ef6bb0df..d3c62f335 100644
--- a/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc
+++ b/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc
@@ -1,9 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// setup/logging-config.asciidoc:193
[source, python]
----
resp = client.cluster.put_settings(
- body={"persistent": {"logger.org.elasticsearch.discovery": None}},
+ persistent={
+ "logger.org.elasticsearch.discovery": None
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b7ad394975863a8f5ee29627c3ab738b.asciidoc b/docs/examples/b7ad394975863a8f5ee29627c3ab738b.asciidoc
new file mode 100644
index 000000000..a5dea7364
--- /dev/null
+++ b/docs/examples/b7ad394975863a8f5ee29627c3ab738b.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/histogram-aggregation.asciidoc:248
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "prices": {
+ "histogram": {
+ "field": "price",
+ "interval": 50,
+ "keyed": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b7bb5503e64bd869b2ac1c46c434a079.asciidoc b/docs/examples/b7bb5503e64bd869b2ac1c46c434a079.asciidoc
new file mode 100644
index 000000000..0f18d1f8e
--- /dev/null
+++ b/docs/examples/b7bb5503e64bd869b2ac1c46c434a079.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:226
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "histo": {
+ "histogram": {
+ "field": "price",
+ "interval": 5
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b7c99eb38d4b37e22de1ffcb0e88ae4c.asciidoc b/docs/examples/b7c99eb38d4b37e22de1ffcb0e88ae4c.asciidoc
new file mode 100644
index 000000000..878f2ab0a
--- /dev/null
+++ b/docs/examples/b7c99eb38d4b37e22de1ffcb0e88ae4c.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:279
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="2",
+ document={
+ "message": "A new bonsai tree in the office"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b7df0848b2dc3093f931976db5b8cfff.asciidoc b/docs/examples/b7df0848b2dc3093f931976db5b8cfff.asciidoc
new file mode 100644
index 000000000..eb44d6b47
--- /dev/null
+++ b/docs/examples/b7df0848b2dc3093f931976db5b8cfff.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:32
+
+[source, python]
+----
+resp = client.cluster.health(
+ filter_path="status,*_shards",
+)
+print(resp)
+----
diff --git a/docs/examples/b7f8bd33c22f3c93336ab57c2e091f73.asciidoc b/docs/examples/b7f8bd33c22f3c93336ab57c2e091f73.asciidoc
new file mode 100644
index 000000000..45fac83a4
--- /dev/null
+++ b/docs/examples/b7f8bd33c22f3c93336ab57c2e091f73.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// query-rules/apis/delete-query-rule.asciidoc:72
+
+[source, python]
+----
+resp = client.query_rules.delete_rule(
+ ruleset_id="my-ruleset",
+ rule_id="my-rule1",
+)
+print(resp)
+----
diff --git a/docs/examples/b80e1f5b26bae4f3c2f8a604b7caaf17.asciidoc b/docs/examples/b80e1f5b26bae4f3c2f8a604b7caaf17.asciidoc
new file mode 100644
index 000000000..df7cab9e6
--- /dev/null
+++ b/docs/examples/b80e1f5b26bae4f3c2f8a604b7caaf17.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-role-mappings.asciidoc:284
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="mapping7",
+ roles=[
+ "ldap-example-user"
+ ],
+ enabled=True,
+ rules={
+ "all": [
+ {
+ "field": {
+ "dn": "*,ou=subtree,dc=example,dc=com"
+ }
+ },
+ {
+ "field": {
+ "realm.name": "ldap1"
+ }
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b81a7b5f5ef19553f9cd49196f31018c.asciidoc b/docs/examples/b81a7b5f5ef19553f9cd49196f31018c.asciidoc
new file mode 100644
index 000000000..214715321
--- /dev/null
+++ b/docs/examples/b81a7b5f5ef19553f9cd49196f31018c.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/distance-feature-query.asciidoc:37
+
+[source, python]
+----
+resp = client.indices.create(
+ index="items",
+ mappings={
+ "properties": {
+ "name": {
+ "type": "keyword"
+ },
+ "production_date": {
+ "type": "date"
+ },
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b82b156c7b9d1d78054577a6947a6cdd.asciidoc b/docs/examples/b82b156c7b9d1d78054577a6947a6cdd.asciidoc
new file mode 100644
index 000000000..23cfa5c17
--- /dev/null
+++ b/docs/examples/b82b156c7b9d1d78054577a6947a6cdd.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/geo-grid.asciidoc:91
+
+[source, python]
+----
+resp = client.index(
+ index="geocells",
+ id="1",
+ pipeline="geotile2shape",
+ document={
+ "geocell": "4/8/5"
+ },
+)
+print(resp)
+
+resp1 = client.get(
+ index="geocells",
+ id="1",
+)
+print(resp1)
+----
diff --git a/docs/examples/b839f79a5d58506baed5714f1876ab55.asciidoc b/docs/examples/b839f79a5d58506baed5714f1876ab55.asciidoc
new file mode 100644
index 000000000..59095bc1a
--- /dev/null
+++ b/docs/examples/b839f79a5d58506baed5714f1876ab55.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql-search-api.asciidoc:24
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n process where process.name == \"regsvr32.exe\"\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/b84932030e60a2cd58884b9dc6d3147f.asciidoc b/docs/examples/b84932030e60a2cd58884b9dc6d3147f.asciidoc
new file mode 100644
index 000000000..21948d4cc
--- /dev/null
+++ b/docs/examples/b84932030e60a2cd58884b9dc6d3147f.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:644
+
+[source, python]
+----
+resp = client.search_application.search(
+ name="my_search_application",
+)
+print(resp)
+----
diff --git a/docs/examples/b85716ba42a57096452665c38995da7d.asciidoc b/docs/examples/b85716ba42a57096452665c38995da7d.asciidoc
new file mode 100644
index 000000000..d6e72e9ce
--- /dev/null
+++ b/docs/examples/b85716ba42a57096452665c38995da7d.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/preview-dfanalytics.asciidoc:69
+
+[source, python]
+----
+resp = client.ml.preview_data_frame_analytics(
+ config={
+ "source": {
+ "index": "houses_sold_last_10_yrs"
+ },
+ "analysis": {
+ "regression": {
+ "dependent_variable": "price"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b857abedc64e367def172bd07075e5c7.asciidoc b/docs/examples/b857abedc64e367def172bd07075e5c7.asciidoc
new file mode 100644
index 000000000..65a2215bb
--- /dev/null
+++ b/docs/examples/b857abedc64e367def172bd07075e5c7.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/fingerprint-analyzer.asciidoc:89
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_fingerprint_analyzer": {
+ "type": "fingerprint",
+ "stopwords": "_english_"
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_fingerprint_analyzer",
+ text="Yes yes, Gödel said this sentence is consistent and.",
+)
+print(resp1)
+----
diff --git a/docs/examples/b87438263ccd68624b1d69d8750f9432.asciidoc b/docs/examples/b87438263ccd68624b1d69d8750f9432.asciidoc
new file mode 100644
index 000000000..94db3486a
--- /dev/null
+++ b/docs/examples/b87438263ccd68624b1d69d8750f9432.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/doc-values.asciidoc:37
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "status_code": {
+ "type": "long"
+ },
+ "session_id": {
+ "type": "long",
+ "index": False
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b87bc8a521995051c7e7395f9c047e1c.asciidoc b/docs/examples/b87bc8a521995051c7e7395f9c047e1c.asciidoc
new file mode 100644
index 000000000..f087fcbb5
--- /dev/null
+++ b/docs/examples/b87bc8a521995051c7e7395f9c047e1c.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/ignore-malformed.asciidoc:16
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "number_one": {
+ "type": "integer",
+ "ignore_malformed": True
+ },
+ "number_two": {
+ "type": "integer"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "text": "Some text value",
+ "number_one": "foo"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="my-index-000001",
+ id="2",
+ document={
+ "text": "Some text value",
+ "number_two": "foo"
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/b88a2d96da1401d548a4540cca223d27.asciidoc b/docs/examples/b88a2d96da1401d548a4540cca223d27.asciidoc
new file mode 100644
index 000000000..87c9d8ad7
--- /dev/null
+++ b/docs/examples/b88a2d96da1401d548a4540cca223d27.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-vector-tile-api.asciidoc:702
+
+[source, python]
+----
+resp = client.search_mvt(
+ index="museums",
+ field="location",
+ zoom="13",
+ x="4207",
+ y="2692",
+ grid_agg="geotile",
+ grid_precision=2,
+ fields=[
+ "name",
+ "price"
+ ],
+ query={
+ "term": {
+ "included": True
+ }
+ },
+ aggs={
+ "min_price": {
+ "min": {
+ "field": "price"
+ }
+ },
+ "max_price": {
+ "max": {
+ "field": "price"
+ }
+ },
+ "avg_price": {
+ "avg": {
+ "field": "price"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b8c03bbd917d0cf5474a3e46ebdd7aad.asciidoc b/docs/examples/b8c03bbd917d0cf5474a3e46ebdd7aad.asciidoc
new file mode 100644
index 000000000..cc983c076
--- /dev/null
+++ b/docs/examples/b8c03bbd917d0cf5474a3e46ebdd7aad.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/cjk-bigram-tokenfilter.asciidoc:22
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "cjk_bigram"
+ ],
+ text="東京都は、日本の首都であり",
+)
+print(resp)
+----
diff --git a/docs/examples/b8cc74a92bac837bfd8ba6d5935350ed.asciidoc b/docs/examples/b8cc74a92bac837bfd8ba6d5935350ed.asciidoc
new file mode 100644
index 000000000..fa53a0f91
--- /dev/null
+++ b/docs/examples/b8cc74a92bac837bfd8ba6d5935350ed.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:317
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "enabled": False
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "user_id": "kimchy",
+ "session_data": {
+ "object": {
+ "some_field": "some_value"
+ }
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ fields=[
+ "user_id",
+ {
+ "field": "session_data.object.*",
+ "include_unmapped": True
+ }
+ ],
+ source=False,
+)
+print(resp2)
+----
diff --git a/docs/examples/b8dc3764c4467922474b2cdec74bb86b.asciidoc b/docs/examples/b8dc3764c4467922474b2cdec74bb86b.asciidoc
new file mode 100644
index 000000000..b8379aa45
--- /dev/null
+++ b/docs/examples/b8dc3764c4467922474b2cdec74bb86b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/examples.asciidoc:445
+
+[source, python]
+----
+resp = client.transform.start_transform(
+ transform_id="last-log-from-clientip",
+)
+print(resp)
+----
diff --git a/docs/examples/b8e6e320a19936f6edfc242ccb5cde43.asciidoc b/docs/examples/b8e6e320a19936f6edfc242ccb5cde43.asciidoc
new file mode 100644
index 000000000..87c707458
--- /dev/null
+++ b/docs/examples/b8e6e320a19936f6edfc242ccb5cde43.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/position-increment-gap.asciidoc:15
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "names": [
+ "John Abraham",
+ "Lincoln Smith"
+ ]
+ },
+)
+print(resp)
+
+resp1 = client.search(
+ index="my-index-000001",
+ query={
+ "match_phrase": {
+ "names": {
+ "query": "Abraham Lincoln"
+ }
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ query={
+ "match_phrase": {
+ "names": {
+ "query": "Abraham Lincoln",
+ "slop": 101
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/b9370fa1aa18fe4bc00cf81ef0c0d45b.asciidoc b/docs/examples/b9370fa1aa18fe4bc00cf81ef0c0d45b.asciidoc
index 7f6770d7d..ce99d9c1b 100644
--- a/docs/examples/b9370fa1aa18fe4bc00cf81ef0c0d45b.asciidoc
+++ b/docs/examples/b9370fa1aa18fe4bc00cf81ef0c0d45b.asciidoc
@@ -1,16 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:318
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {
- "fields": ["city.*"],
- "query": "this AND that OR thus",
- }
+ query={
+ "query_string": {
+ "fields": [
+ "city.*"
+ ],
+ "query": "this AND that OR thus"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/b94cee0f74f57742b3948f9b784dfdd4.asciidoc b/docs/examples/b94cee0f74f57742b3948f9b784dfdd4.asciidoc
new file mode 100644
index 000000000..d682836ca
--- /dev/null
+++ b/docs/examples/b94cee0f74f57742b3948f9b784dfdd4.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:535
+
+[source, python]
+----
+resp = client.clear_scroll(
+ scroll_id="DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==,DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAABFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAAAxZrUllkUVlCa1NqNmRMaUhiQlZkMWFBAAAAAAAAAAIWa1JZZFFZQmtTajZkTGlIYkJWZDFhQQAAAAAAAAAFFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAABBZrUllkUVlCa1NqNmRMaUhiQlZkMWFB",
+)
+print(resp)
+----
diff --git a/docs/examples/b968853454b4416f7baa3209eb335957.asciidoc b/docs/examples/b968853454b4416f7baa3209eb335957.asciidoc
new file mode 100644
index 000000000..a726b02f1
--- /dev/null
+++ b/docs/examples/b968853454b4416f7baa3209eb335957.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/cartesian-centroid-aggregation.asciidoc:79
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggs={
+ "cities": {
+ "terms": {
+ "field": "city.keyword"
+ },
+ "aggs": {
+ "centroid": {
+ "cartesian_centroid": {
+ "field": "location"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b96f465abb658fe32889c3d183f159a3.asciidoc b/docs/examples/b96f465abb658fe32889c3d183f159a3.asciidoc
new file mode 100644
index 000000000..3d8cca2d0
--- /dev/null
+++ b/docs/examples/b96f465abb658fe32889c3d183f159a3.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/limit-token-count-tokenfilter.asciidoc:96
+
+[source, python]
+----
+resp = client.indices.create(
+ index="limit_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_one_token_limit": {
+ "tokenizer": "standard",
+ "filter": [
+ "limit"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/b9a8f39ab9b1ed18c6c1db61ac4e6a9e.asciidoc b/docs/examples/b9a8f39ab9b1ed18c6c1db61ac4e6a9e.asciidoc
new file mode 100644
index 000000000..1f24aa4f0
--- /dev/null
+++ b/docs/examples/b9a8f39ab9b1ed18c6c1db61ac4e6a9e.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:317
+
+[source, python]
+----
+resp = client.snapshot.get(
+ repository="my_repository",
+ snapshot="_current",
+)
+print(resp)
+----
diff --git a/docs/examples/b9f716219359a6c973dafc50b348de33.asciidoc b/docs/examples/b9f716219359a6c973dafc50b348de33.asciidoc
new file mode 100644
index 000000000..e70260385
--- /dev/null
+++ b/docs/examples/b9f716219359a6c973dafc50b348de33.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/source-field.asciidoc:24
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "_source": {
+ "enabled": False
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ba07330ed3291b3970f4eb01dacd8086.asciidoc b/docs/examples/ba07330ed3291b3970f4eb01dacd8086.asciidoc
new file mode 100644
index 000000000..ee58a19ee
--- /dev/null
+++ b/docs/examples/ba07330ed3291b3970f4eb01dacd8086.asciidoc
@@ -0,0 +1,105 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geodistance-aggregation.asciidoc:10
+
+[source, python]
+----
+resp = client.indices.create(
+ index="museums",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="museums",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "location": "POINT (4.912350 52.374081)",
+ "name": "NEMO Science Museum"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "location": "POINT (4.901618 52.369219)",
+ "name": "Museum Het Rembrandthuis"
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "location": "POINT (4.914722 52.371667)",
+ "name": "Nederlands Scheepvaartmuseum"
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "location": "POINT (4.405200 51.222900)",
+ "name": "Letterenhuis"
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "location": "POINT (2.336389 48.861111)",
+ "name": "Musée du Louvre"
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "location": "POINT (2.327000 48.860000)",
+ "name": "Musée d'Orsay"
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="museums",
+ size="0",
+ aggs={
+ "rings_around_amsterdam": {
+ "geo_distance": {
+ "field": "location",
+ "origin": "POINT (4.894 52.3760)",
+ "ranges": [
+ {
+ "to": 100000
+ },
+ {
+ "from": 100000,
+ "to": 300000
+ },
+ {
+ "from": 300000
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/ba10b644a4e9a2e7d78744ca607355d0.asciidoc b/docs/examples/ba10b644a4e9a2e7d78744ca607355d0.asciidoc
new file mode 100644
index 000000000..4458c3d08
--- /dev/null
+++ b/docs/examples/ba10b644a4e9a2e7d78744ca607355d0.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/put-follow.asciidoc:85
+
+[source, python]
+----
+resp = client.ccr.follow(
+ index=".ds-logs-mysql-default_copy-2022-01-01-000001",
+ remote_cluster="remote_cluster",
+ leader_index=".ds-logs-mysql-default-2022-01-01-000001",
+ data_stream_name="logs-mysql-default_copy",
+)
+print(resp)
+----
diff --git a/docs/examples/ba21a7fbb74180ff138d97032f28ace7.asciidoc b/docs/examples/ba21a7fbb74180ff138d97032f28ace7.asciidoc
new file mode 100644
index 000000000..7895c8e6c
--- /dev/null
+++ b/docs/examples/ba21a7fbb74180ff138d97032f28ace7.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/update-user-profile-data.asciidoc:100
+
+[source, python]
+----
+resp = client.security.update_user_profile_data(
+ uid="u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0",
+ labels={
+ "direction": "east"
+ },
+ data={
+ "app1": {
+ "theme": "default"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ba3b9783aa188c6841e1926c5ab1472d.asciidoc b/docs/examples/ba3b9783aa188c6841e1926c5ab1472d.asciidoc
new file mode 100644
index 000000000..3e64503ba
--- /dev/null
+++ b/docs/examples/ba3b9783aa188c6841e1926c5ab1472d.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:101
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my_search_application",
+ search_application={
+ "indices": [
+ "index1",
+ "index2"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ba59a3b9a0a2694704b2bf9c6ad4a8cf.asciidoc b/docs/examples/ba59a3b9a0a2694704b2bf9c6ad4a8cf.asciidoc
deleted file mode 100644
index 8622ad4b6..000000000
--- a/docs/examples/ba59a3b9a0a2694704b2bf9c6ad4a8cf.asciidoc
+++ /dev/null
@@ -1,6 +0,0 @@
-// aggregations/bucket/datehistogram-aggregation.asciidoc:611
-
-[source, python]
-----
-
-----
\ No newline at end of file
diff --git a/docs/examples/ba5dc6fb9bbe1406714da5d641462a23.asciidoc b/docs/examples/ba5dc6fb9bbe1406714da5d641462a23.asciidoc
index b162caf00..8fa85f14b 100644
--- a/docs/examples/ba5dc6fb9bbe1406714da5d641462a23.asciidoc
+++ b/docs/examples/ba5dc6fb9bbe1406714da5d641462a23.asciidoc
@@ -1,22 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:96
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "strings_as_ip": {
- "match_mapping_type": "string",
- "match": "ip*",
- "runtime": {"type": "ip"},
+ mappings={
+ "dynamic_templates": [
+ {
+ "strings_as_ip": {
+ "match_mapping_type": "string",
+ "match": "ip*",
+ "runtime": {
+ "type": "ip"
}
}
- ]
- }
+ }
+ ]
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ba6040de55afb2c8fb9e5b24bb038820.asciidoc b/docs/examples/ba6040de55afb2c8fb9e5b24bb038820.asciidoc
new file mode 100644
index 000000000..1655222d3
--- /dev/null
+++ b/docs/examples/ba6040de55afb2c8fb9e5b24bb038820.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-index-template-v1.asciidoc:88
+
+[source, python]
+----
+resp = client.indices.get_template(
+ name="temp*",
+)
+print(resp)
+----
diff --git a/docs/examples/ba66768ed04f7b87906badff40ff40ed.asciidoc b/docs/examples/ba66768ed04f7b87906badff40ff40ed.asciidoc
new file mode 100644
index 000000000..4cc3c29ee
--- /dev/null
+++ b/docs/examples/ba66768ed04f7b87906badff40ff40ed.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-rollover.asciidoc:153
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_primary_shard_size": "50gb"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ba8c3578613ae0bf890f6a05706ce776.asciidoc b/docs/examples/ba8c3578613ae0bf890f6a05706ce776.asciidoc
new file mode 100644
index 000000000..327bfc18b
--- /dev/null
+++ b/docs/examples/ba8c3578613ae0bf890f6a05706ce776.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1024
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ filter_path="-hits.events._source",
+ query="\n process where process.name == \"regsvr32.exe\"\n ",
+ fields=[
+ "event.type",
+ "process.*",
+ {
+ "field": "@timestamp",
+ "format": "epoch_millis"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/ba9a5f66a6148612de0ad2491fd6c90d.asciidoc b/docs/examples/ba9a5f66a6148612de0ad2491fd6c90d.asciidoc
new file mode 100644
index 000000000..fc1735285
--- /dev/null
+++ b/docs/examples/ba9a5f66a6148612de0ad2491fd6c90d.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/classic-tokenizer.asciidoc:148
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "my_tokenizer"
+ }
+ },
+ "tokenizer": {
+ "my_tokenizer": {
+ "type": "classic",
+ "max_token_length": 5
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp1)
+----
diff --git a/docs/examples/baadbfffcd0c16f51eb3537f516dc3ed.asciidoc b/docs/examples/baadbfffcd0c16f51eb3537f516dc3ed.asciidoc
new file mode 100644
index 000000000..3cc6bcd3f
--- /dev/null
+++ b/docs/examples/baadbfffcd0c16f51eb3537f516dc3ed.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/disable-user-profile.asciidoc:59
+
+[source, python]
+----
+resp = client.security.disable_user_profile(
+ uid="u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0",
+)
+print(resp)
+----
diff --git a/docs/examples/bab4c3b22c1768fcc7153345e4096dfb.asciidoc b/docs/examples/bab4c3b22c1768fcc7153345e4096dfb.asciidoc
new file mode 100644
index 000000000..e52a62318
--- /dev/null
+++ b/docs/examples/bab4c3b22c1768fcc7153345e4096dfb.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/remove-duplicates-tokenfilter.asciidoc:79
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "keyword_repeat",
+ "stemmer",
+ "remove_duplicates"
+ ],
+ text="jumping dog",
+)
+print(resp)
+----
diff --git a/docs/examples/bb067c049331cc850a77b18bdfff81b5.asciidoc b/docs/examples/bb067c049331cc850a77b18bdfff81b5.asciidoc
new file mode 100644
index 000000000..344e78867
--- /dev/null
+++ b/docs/examples/bb067c049331cc850a77b18bdfff81b5.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1311
+
+[source, python]
+----
+resp = client.indices.create(
+ index="lithuanian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "lithuanian_stop": {
+ "type": "stop",
+ "stopwords": "_lithuanian_"
+ },
+ "lithuanian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "pavyzdys"
+ ]
+ },
+ "lithuanian_stemmer": {
+ "type": "stemmer",
+ "language": "lithuanian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_lithuanian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "lithuanian_stop",
+ "lithuanian_keywords",
+ "lithuanian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bb28d1f7f3f09f5061d7f4351aee89fc.asciidoc b/docs/examples/bb28d1f7f3f09f5061d7f4351aee89fc.asciidoc
new file mode 100644
index 000000000..cc85b2008
--- /dev/null
+++ b/docs/examples/bb28d1f7f3f09f5061d7f4351aee89fc.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/field-level-security.asciidoc:96
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="test_role4",
+ indices=[
+ {
+ "names": [
+ "*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "field_security": {
+ "grant": [
+ "customer.*"
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/bb293e1bdf0c6f6d9069eeb7edc9d399.asciidoc b/docs/examples/bb293e1bdf0c6f6d9069eeb7edc9d399.asciidoc
new file mode 100644
index 000000000..29b3df548
--- /dev/null
+++ b/docs/examples/bb293e1bdf0c6f6d9069eeb7edc9d399.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/disable-users.asciidoc:45
+
+[source, python]
+----
+resp = client.security.disable_user(
+ username="jacknich",
+)
+print(resp)
+----
diff --git a/docs/examples/bb5a1319c496acc862c670cc7224e59a.asciidoc b/docs/examples/bb5a1319c496acc862c670cc7224e59a.asciidoc
new file mode 100644
index 000000000..672d06ae5
--- /dev/null
+++ b/docs/examples/bb5a1319c496acc862c670cc7224e59a.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/attachment.asciidoc:219
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="attachment",
+ description="Extract attachment information",
+ processors=[
+ {
+ "attachment": {
+ "field": "data",
+ "indexed_chars": 11,
+ "indexed_chars_field": "max_size",
+ "remove_binary": False
+ }
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="my_id",
+ pipeline="attachment",
+ document={
+ "data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
+ },
+)
+print(resp1)
+
+resp2 = client.get(
+ index="my-index-000001",
+ id="my_id",
+)
+print(resp2)
+----
diff --git a/docs/examples/bb64a7228a479f6aeeaccaf7560e11ee.asciidoc b/docs/examples/bb64a7228a479f6aeeaccaf7560e11ee.asciidoc
new file mode 100644
index 000000000..fec523b39
--- /dev/null
+++ b/docs/examples/bb64a7228a479f6aeeaccaf7560e11ee.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/examples.asciidoc:394
+
+[source, python]
+----
+resp = client.transform.put_transform(
+ transform_id="last-log-from-clientip",
+ source={
+ "index": [
+ "kibana_sample_data_logs"
+ ]
+ },
+ latest={
+ "unique_key": [
+ "clientip"
+ ],
+ "sort": "timestamp"
+ },
+ frequency="1m",
+ dest={
+ "index": "last-log-from-clientip"
+ },
+ sync={
+ "time": {
+ "field": "timestamp",
+ "delay": "60s"
+ }
+ },
+ retention_policy={
+ "time": {
+ "field": "timestamp",
+ "max_age": "30d"
+ }
+ },
+ settings={
+ "max_page_search_size": 500
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bb792e64a4c1f872296073b457aa03c8.asciidoc b/docs/examples/bb792e64a4c1f872296073b457aa03c8.asciidoc
new file mode 100644
index 000000000..5c156be06
--- /dev/null
+++ b/docs/examples/bb792e64a4c1f872296073b457aa03c8.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:366
+
+[source, python]
+----
+resp = client.snapshot.delete(
+ repository="my_repository",
+ snapshot="my_snapshot_2099.05.06",
+)
+print(resp)
+----
diff --git a/docs/examples/bb975b342de7e838ebf6a36aaa1a8749.asciidoc b/docs/examples/bb975b342de7e838ebf6a36aaa1a8749.asciidoc
index b35ddfed0..c1f14ef15 100644
--- a/docs/examples/bb975b342de7e838ebf6a36aaa1a8749.asciidoc
+++ b/docs/examples/bb975b342de7e838ebf6a36aaa1a8749.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/parent-join.asciidoc:477
[source, python]
@@ -6,11 +7,14 @@ resp = client.index(
index="my-index-000001",
id="3",
routing="1",
- refresh="true",
- body={
+ refresh=True,
+ document={
"text": "This is a vote",
- "my_join_field": {"name": "vote", "parent": "2"},
+ "my_join_field": {
+ "name": "vote",
+ "parent": "2"
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/bb9e268ec62d19ca2a6366cbb48fae68.asciidoc b/docs/examples/bb9e268ec62d19ca2a6366cbb48fae68.asciidoc
new file mode 100644
index 000000000..3c0f50533
--- /dev/null
+++ b/docs/examples/bb9e268ec62d19ca2a6366cbb48fae68.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/count.asciidoc:89
+
+[source, python]
+----
+resp = client.cat.count(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/bc4d308069af23929a49d856f6bc3008.asciidoc b/docs/examples/bc4d308069af23929a49d856f6bc3008.asciidoc
new file mode 100644
index 000000000..8db3a8763
--- /dev/null
+++ b/docs/examples/bc4d308069af23929a49d856f6bc3008.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geodistance-aggregation.asciidoc:122
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggs={
+ "rings": {
+ "geo_distance": {
+ "field": "location",
+ "origin": "POINT (4.894 52.3760)",
+ "unit": "km",
+ "distance_type": "plane",
+ "ranges": [
+ {
+ "to": 100
+ },
+ {
+ "from": 100,
+ "to": 300
+ },
+ {
+ "from": 300
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bcae0f00ae1e6f08fa395ca741fe84f9.asciidoc b/docs/examples/bcae0f00ae1e6f08fa395ca741fe84f9.asciidoc
new file mode 100644
index 000000000..a58da8614
--- /dev/null
+++ b/docs/examples/bcae0f00ae1e6f08fa395ca741fe84f9.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// search/rank-eval.asciidoc:397
+
+[source, python]
+----
+resp = client.rank_eval(
+ index="my-index-000001",
+ requests=[
+ {
+ "id": "JFK query",
+ "request": {
+ "query": {
+ "match_all": {}
+ }
+ },
+ "ratings": []
+ }
+ ],
+ metric={
+ "dcg": {
+ "k": 20,
+ "normalize": False
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bcb572658986d69ae17c28ddd7e4bfd8.asciidoc b/docs/examples/bcb572658986d69ae17c28ddd7e4bfd8.asciidoc
new file mode 100644
index 000000000..6725aea3d
--- /dev/null
+++ b/docs/examples/bcb572658986d69ae17c28ddd7e4bfd8.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/field-usage-stats.asciidoc:166
+
+[source, python]
+----
+resp = client.indices.field_usage_stats(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/bcbd4d4749126837723438ff4faeb0f6.asciidoc b/docs/examples/bcbd4d4749126837723438ff4faeb0f6.asciidoc
new file mode 100644
index 000000000..c51e41a78
--- /dev/null
+++ b/docs/examples/bcbd4d4749126837723438ff4faeb0f6.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:192
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ filter_path="aggregations",
+ size=0,
+ aggs={
+ "top_values": {
+ "terms": {
+ "field": "my-field",
+ "size": 10
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc b/docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc
new file mode 100644
index 000000000..0c0ab5ce9
--- /dev/null
+++ b/docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// quickstart/getting-started.asciidoc:227
+
+[source, python]
+----
+resp = client.search(
+ index="books",
+)
+print(resp)
+----
diff --git a/docs/examples/bcdfaa4487747249699a86a0dcd22f5e.asciidoc b/docs/examples/bcdfaa4487747249699a86a0dcd22f5e.asciidoc
new file mode 100644
index 000000000..31240e019
--- /dev/null
+++ b/docs/examples/bcdfaa4487747249699a86a0dcd22f5e.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/simulate-ingest.asciidoc:274
+
+[source, python]
+----
+resp = client.simulate.ingest(
+ body={
+ "docs": [
+ {
+ "_index": "my-index",
+ "_id": "123",
+ "_source": {
+ "foo": "bar"
+ }
+ },
+ {
+ "_index": "my-index",
+ "_id": "456",
+ "_source": {
+ "foo": "rab"
+ }
+ }
+ ],
+ "pipeline_substitutions": {
+ "my-pipeline": {
+ "processors": [
+ {
+ "uppercase": {
+ "field": "foo"
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bd0d30a7683037e1ebadd163514765d4.asciidoc b/docs/examples/bd0d30a7683037e1ebadd163514765d4.asciidoc
new file mode 100644
index 000000000..07c94ea03
--- /dev/null
+++ b/docs/examples/bd0d30a7683037e1ebadd163514765d4.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/configuring-active-directory-realm.asciidoc:192
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="basic_users",
+ roles=[
+ "user"
+ ],
+ rules={
+ "any": [
+ {
+ "field": {
+ "groups": "cn=users,dc=example,dc=com"
+ }
+ },
+ {
+ "field": {
+ "dn": "cn=John Doe,cn=contractors,dc=example,dc=com"
+ }
+ }
+ ]
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/bd1e55b8cb2ca9e496e223e717d76640.asciidoc b/docs/examples/bd1e55b8cb2ca9e496e223e717d76640.asciidoc
new file mode 100644
index 000000000..430b36184
--- /dev/null
+++ b/docs/examples/bd1e55b8cb2ca9e496e223e717d76640.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-polygon-query.asciidoc:93
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_polygon": {
+ "person.location": {
+ "points": [
+ "40, -70",
+ "30, -80",
+ "20, -90"
+ ]
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bd23c3a03907b1238dcb07ab9eecae7b.asciidoc b/docs/examples/bd23c3a03907b1238dcb07ab9eecae7b.asciidoc
index 7dce5caac..c26a90e71 100644
--- a/docs/examples/bd23c3a03907b1238dcb07ab9eecae7b.asciidoc
+++ b/docs/examples/bd23c3a03907b1238dcb07ab9eecae7b.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:361
[source, python]
@@ -7,4 +8,4 @@ resp = client.update_by_query(
scroll_size="100",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/bd298b11933605c641626750c981d70b.asciidoc b/docs/examples/bd298b11933605c641626750c981d70b.asciidoc
new file mode 100644
index 000000000..fab683dbe
--- /dev/null
+++ b/docs/examples/bd298b11933605c641626750c981d70b.asciidoc
@@ -0,0 +1,48 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/simulate-multi-component-templates.asciidoc:50
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="ct1",
+ template={
+ "settings": {
+ "index.number_of_shards": 2
+ }
+ },
+)
+print(resp)
+
+resp1 = client.cluster.put_component_template(
+ name="ct2",
+ template={
+ "settings": {
+ "index.number_of_replicas": 0
+ },
+ "mappings": {
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ }
+ }
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.indices.simulate_template(
+ index_patterns=[
+ "my*"
+ ],
+ template={
+ "settings": {
+ "index.number_of_shards": 3
+ }
+ },
+ composed_of=[
+ "ct1",
+ "ct2"
+ ],
+)
+print(resp2)
+----
diff --git a/docs/examples/bd2a387e8c21bf01a1039e81d7602921.asciidoc b/docs/examples/bd2a387e8c21bf01a1039e81d7602921.asciidoc
new file mode 100644
index 000000000..ea2ada08d
--- /dev/null
+++ b/docs/examples/bd2a387e8c21bf01a1039e81d7602921.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:788
+
+[source, python]
+----
+resp = client.put_script(
+ id="my-search-template",
+ script={
+ "lang": "mustache",
+ "source": {
+ "query": {
+ "multi_match": {
+ "query": "{{query_string}}",
+ "fields": "[{{#text_fields}}{{user_name}},{{/text_fields}}]"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bd3d710ec50a151453e141691163af72.asciidoc b/docs/examples/bd3d710ec50a151453e141691163af72.asciidoc
new file mode 100644
index 000000000..2c7c56029
--- /dev/null
+++ b/docs/examples/bd3d710ec50a151453e141691163af72.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/tasks.asciidoc:270
+
+[source, python]
+----
+resp = client.tasks.list(
+ group_by="parents",
+)
+print(resp)
+----
diff --git a/docs/examples/bd458073196a19ecdeb24a8016488c20.asciidoc b/docs/examples/bd458073196a19ecdeb24a8016488c20.asciidoc
new file mode 100644
index 000000000..de4ff9093
--- /dev/null
+++ b/docs/examples/bd458073196a19ecdeb24a8016488c20.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/delete-index-template.asciidoc:26
+
+[source, python]
+----
+resp = client.indices.delete_index_template(
+ name="my-index-template",
+)
+print(resp)
+----
diff --git a/docs/examples/bd57976bc93ca64b2d3e001df9f06c82.asciidoc b/docs/examples/bd57976bc93ca64b2d3e001df9f06c82.asciidoc
new file mode 100644
index 000000000..15a587aaa
--- /dev/null
+++ b/docs/examples/bd57976bc93ca64b2d3e001df9f06c82.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/resolve.asciidoc:101
+
+[source, python]
+----
+resp = client.indices.resolve_index(
+ name="f*,remoteCluster1:bar*",
+ expand_wildcards="all",
+)
+print(resp)
+----
diff --git a/docs/examples/bd5bd5d8b3d81241335fe1e5747080ac.asciidoc b/docs/examples/bd5bd5d8b3d81241335fe1e5747080ac.asciidoc
new file mode 100644
index 000000000..93a5c32dc
--- /dev/null
+++ b/docs/examples/bd5bd5d8b3d81241335fe1e5747080ac.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/error-handling.asciidoc:118
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="shrink-index",
+ policy={
+ "phases": {
+ "warm": {
+ "min_age": "5d",
+ "actions": {
+ "shrink": {
+ "number_of_shards": 1
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bd68666ca2e0be12f7624016317a62bc.asciidoc b/docs/examples/bd68666ca2e0be12f7624016317a62bc.asciidoc
new file mode 100644
index 000000000..dba5a5ef4
--- /dev/null
+++ b/docs/examples/bd68666ca2e0be12f7624016317a62bc.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/nodes-stats.asciidoc:2419
+
+[source, python]
+----
+resp = client.nodes.stats(
+ groups="_all",
+)
+print(resp)
+
+resp1 = client.nodes.stats(
+ metric="indices",
+ groups="foo,bar",
+)
+print(resp1)
+----
diff --git a/docs/examples/bd6f30e3caa3632260da42d9ff82c98c.asciidoc b/docs/examples/bd6f30e3caa3632260da42d9ff82c98c.asciidoc
new file mode 100644
index 000000000..b9da78352
--- /dev/null
+++ b/docs/examples/bd6f30e3caa3632260da42d9ff82c98c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-api-key-cache.asciidoc:57
+
+[source, python]
+----
+resp = client.security.clear_api_key_cache(
+ ids="*",
+)
+print(resp)
+----
diff --git a/docs/examples/bd7330af2609bdd8aa10958f5e640b93.asciidoc b/docs/examples/bd7330af2609bdd8aa10958f5e640b93.asciidoc
index 28d9b24a3..d3c967e19 100644
--- a/docs/examples/bd7330af2609bdd8aa10958f5e640b93.asciidoc
+++ b/docs/examples/bd7330af2609bdd8aa10958f5e640b93.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:649
[source, python]
@@ -5,8 +6,14 @@
resp = client.index(
index="my_queries2",
id="2",
- refresh="true",
- body={"query": {"match": {"my_field.suffix": "xyz"}}},
+ refresh=True,
+ document={
+ "query": {
+ "match": {
+ "my_field.suffix": "xyz"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/bd767ea03171fe71c73f58f16d5da92f.asciidoc b/docs/examples/bd767ea03171fe71c73f58f16d5da92f.asciidoc
new file mode 100644
index 000000000..854a0ffd5
--- /dev/null
+++ b/docs/examples/bd767ea03171fe71c73f58f16d5da92f.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/pathhierarchy-tokenizer.asciidoc:273
+
+[source, python]
+----
+resp = client.search(
+ index="file-path-test",
+ query={
+ "match": {
+ "file_path": "/User/bob/photos/2017/05"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bd7a1417fc27b5a801334ec44462b376.asciidoc b/docs/examples/bd7a1417fc27b5a801334ec44462b376.asciidoc
new file mode 100644
index 000000000..6ba29e06c
--- /dev/null
+++ b/docs/examples/bd7a1417fc27b5a801334ec44462b376.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/datafeeds.asciidoc:124
+
+[source, python]
+----
+resp = client.cat.ml_datafeeds(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/bd7fa2f122ab861cd00e0b9154d120b3.asciidoc b/docs/examples/bd7fa2f122ab861cd00e0b9154d120b3.asciidoc
new file mode 100644
index 000000000..6897746d2
--- /dev/null
+++ b/docs/examples/bd7fa2f122ab861cd00e0b9154d120b3.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/common-script-uses.asciidoc:29
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index",
+ mappings={
+ "properties": {
+ "@timestamp": {
+ "format": "strict_date_optional_time||epoch_second",
+ "type": "date"
+ },
+ "message": {
+ "type": "wildcard"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bdb30dd52d32f50994008f4f9c0da5f0.asciidoc b/docs/examples/bdb30dd52d32f50994008f4f9c0da5f0.asciidoc
index e72fb1ecc..d7b3c2505 100644
--- a/docs/examples/bdb30dd52d32f50994008f4f9c0da5f0.asciidoc
+++ b/docs/examples/bdb30dd52d32f50994008f4f9c0da5f0.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:565
[source, python]
@@ -7,4 +8,4 @@ resp = client.update_by_query_rethrottle(
requests_per_second="-1",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/bdb671866e2f0195f8dfbdb7f20bf591.asciidoc b/docs/examples/bdb671866e2f0195f8dfbdb7f20bf591.asciidoc
new file mode 100644
index 000000000..f398c9d7c
--- /dev/null
+++ b/docs/examples/bdb671866e2f0195f8dfbdb7f20bf591.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-semantic-text.asciidoc:34
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="sparse_embedding",
+ inference_id="my-elser-endpoint",
+ inference_config={
+ "service": "elser",
+ "service_settings": {
+ "num_allocations": 1,
+ "num_threads": 1
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bdc1afd2181154bb78797360f9dbb1a0.asciidoc b/docs/examples/bdc1afd2181154bb78797360f9dbb1a0.asciidoc
new file mode 100644
index 000000000..3754d13f6
--- /dev/null
+++ b/docs/examples/bdc1afd2181154bb78797360f9dbb1a0.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/ack-watch.asciidoc:134
+
+[source, python]
+----
+resp = client.watcher.execute_watch(
+ id="my_watch",
+ record_execution=True,
+)
+print(resp)
+
+resp1 = client.watcher.get_watch(
+ id="my_watch",
+)
+print(resp1)
+----
diff --git a/docs/examples/bdc68012c121062628d6d73468bf4866.asciidoc b/docs/examples/bdc68012c121062628d6d73468bf4866.asciidoc
new file mode 100644
index 000000000..4984defde
--- /dev/null
+++ b/docs/examples/bdc68012c121062628d6d73468bf4866.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/register-repository.asciidoc:215
+
+[source, python]
+----
+resp = client.snapshot.cleanup_repository(
+ name="my_repository",
+)
+print(resp)
+----
diff --git a/docs/examples/bde74dbbcef8ebf8541cae2c1711255f.asciidoc b/docs/examples/bde74dbbcef8ebf8541cae2c1711255f.asciidoc
new file mode 100644
index 000000000..1e4a1811f
--- /dev/null
+++ b/docs/examples/bde74dbbcef8ebf8541cae2c1711255f.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search-application/apis/get-search-application.asciidoc:88
+
+[source, python]
+----
+resp = client.search_application.get(
+ name="my-app",
+)
+print(resp)
+----
diff --git a/docs/examples/bdfb86cdfffb9d2ee6e3d399f00a57b0.asciidoc b/docs/examples/bdfb86cdfffb9d2ee6e3d399f00a57b0.asciidoc
new file mode 100644
index 000000000..7fd14836d
--- /dev/null
+++ b/docs/examples/bdfb86cdfffb9d2ee6e3d399f00a57b0.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/top-metrics-aggregation.asciidoc:499
+
+[source, python]
+----
+resp = client.search(
+ index="test*",
+ filter_path="aggregations",
+ aggs={
+ "ip": {
+ "terms": {
+ "field": "ip"
+ },
+ "aggs": {
+ "tm": {
+ "top_metrics": {
+ "metrics": {
+ "field": "m"
+ },
+ "sort": {
+ "s": "desc"
+ },
+ "size": 1
+ }
+ },
+ "having_tm": {
+ "bucket_selector": {
+ "buckets_path": {
+ "top_m": "tm[m]"
+ },
+ "script": "params.top_m < 1000"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/be285eef1d2df0dfcf876e2d4b361f1e.asciidoc b/docs/examples/be285eef1d2df0dfcf876e2d4b361f1e.asciidoc
new file mode 100644
index 000000000..05045dac5
--- /dev/null
+++ b/docs/examples/be285eef1d2df0dfcf876e2d4b361f1e.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/common-grams-tokenfilter.asciidoc:206
+
+[source, python]
+----
+resp = client.indices.create(
+ index="common_grams_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "index_grams": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "common_grams_query"
+ ]
+ }
+ },
+ "filter": {
+ "common_grams_query": {
+ "type": "common_grams",
+ "common_words": [
+ "a",
+ "is",
+ "the"
+ ],
+ "ignore_case": True,
+ "query_mode": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/be30ea12f605fd61acba689b68e00bbe.asciidoc b/docs/examples/be30ea12f605fd61acba689b68e00bbe.asciidoc
new file mode 100644
index 000000000..936d4c7a2
--- /dev/null
+++ b/docs/examples/be30ea12f605fd61acba689b68e00bbe.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc:67
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="hugging_face_embeddings",
+ processors=[
+ {
+ "inference": {
+ "model_id": "hugging_face_embeddings",
+ "input_output": {
+ "input_field": "content",
+ "output_field": "content_embedding"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/be3a6431d01846950dc1a39a7a6a1faa.asciidoc b/docs/examples/be3a6431d01846950dc1a39a7a6a1faa.asciidoc
index a1b8c7c87..aede29898 100644
--- a/docs/examples/be3a6431d01846950dc1a39a7a6a1faa.asciidoc
+++ b/docs/examples/be3a6431d01846950dc1a39a7a6a1faa.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:526
[source, python]
@@ -6,4 +7,4 @@ resp = client.tasks.get(
task_id="r1A2WoRbTwKZ516z6NEs5A:36619",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/be5b415d7f33d6f0397ac2f8b5c10521.asciidoc b/docs/examples/be5b415d7f33d6f0397ac2f8b5c10521.asciidoc
index 758f9e484..efc1ccbce 100644
--- a/docs/examples/be5b415d7f33d6f0397ac2f8b5c10521.asciidoc
+++ b/docs/examples/be5b415d7f33d6f0397ac2f8b5c10521.asciidoc
@@ -1,12 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:641
[source, python]
----
resp = client.update_by_query(
index="my-index-000001",
- refresh="true",
+ refresh=True,
slices="5",
- body={"script": {"source": "ctx._source['extra'] = 'test'"}},
+ script={
+ "source": "ctx._source['extra'] = 'test'"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/be5c5a9c25901737585e4fff9195da3c.asciidoc b/docs/examples/be5c5a9c25901737585e4fff9195da3c.asciidoc
index 4d3c42177..0959081b9 100644
--- a/docs/examples/be5c5a9c25901737585e4fff9195da3c.asciidoc
+++ b/docs/examples/be5c5a9c25901737585e4fff9195da3c.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/dense-vector.asciidoc:406
[source, python]
@@ -5,14 +6,18 @@
resp = client.search(
index="my-bit-vectors",
filter_path="hits.hits",
- body={
- "query": {
- "knn": {
- "query_vector": [127, -127, 0, 1, 42],
- "field": "my_vector",
- }
+ query={
+ "knn": {
+ "query_vector": [
+ 127,
+ -127,
+ 0,
+ 1,
+ 42
+ ],
+ "field": "my_vector"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/be5d62e7c8f63687c585305fbe70d7d0.asciidoc b/docs/examples/be5d62e7c8f63687c585305fbe70d7d0.asciidoc
new file mode 100644
index 000000000..592948130
--- /dev/null
+++ b/docs/examples/be5d62e7c8f63687c585305fbe70d7d0.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-aggregation.asciidoc:288
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_outlier": {
+ "percentiles": {
+ "field": "load_time",
+ "tdigest": {
+ "compression": 200
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/be5fef0640c3a650ee96f84e3376a1be.asciidoc b/docs/examples/be5fef0640c3a650ee96f84e3376a1be.asciidoc
index 199992402..d57c9b600 100644
--- a/docs/examples/be5fef0640c3a650ee96f84e3376a1be.asciidoc
+++ b/docs/examples/be5fef0640c3a650ee96f84e3376a1be.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:333
[source, python]
@@ -5,14 +6,14 @@
resp = client.update(
index="test",
id="1",
- body={
- "scripted_upsert": True,
- "script": {
- "source": "\n if ( ctx.op == 'create' ) {\n ctx._source.counter = params.count\n } else {\n ctx._source.counter += params.count\n }\n ",
- "params": {"count": 4},
- },
- "upsert": {},
+ scripted_upsert=True,
+ script={
+ "source": "\n if ( ctx.op == 'create' ) {\n ctx._source.counter = params.count\n } else {\n ctx._source.counter += params.count\n }\n ",
+ "params": {
+ "count": 4
+ }
},
+ upsert={},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/be6b0bfcdce1ef100af89f74da5d4748.asciidoc b/docs/examples/be6b0bfcdce1ef100af89f74da5d4748.asciidoc
index c917e5a53..e049ea57e 100644
--- a/docs/examples/be6b0bfcdce1ef100af89f74da5d4748.asciidoc
+++ b/docs/examples/be6b0bfcdce1ef100af89f74da5d4748.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/put-trained-model-definition-part.asciidoc:64
[source, python]
@@ -5,11 +6,9 @@
resp = client.ml.put_trained_model_definition_part(
model_id="elastic__distilbert-base-uncased-finetuned-conll03-english",
part="0",
- body={
- "definition": "...",
- "total_definition_length": 265632637,
- "total_parts": 64,
- },
+ definition="...",
+ total_definition_length=265632637,
+ total_parts=64,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/be9376b1e354ad9c6bdad83f6a0ce5ad.asciidoc b/docs/examples/be9376b1e354ad9c6bdad83f6a0ce5ad.asciidoc
new file mode 100644
index 000000000..a440d9205
--- /dev/null
+++ b/docs/examples/be9376b1e354ad9c6bdad83f6a0ce5ad.asciidoc
@@ -0,0 +1,61 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/examples.asciidoc:129
+
+[source, python]
+----
+resp = client.transform.preview_transform(
+ source={
+ "index": "kibana_sample_data_flights",
+ "query": {
+ "bool": {
+ "filter": [
+ {
+ "term": {
+ "Cancelled": False
+ }
+ }
+ ]
+ }
+ }
+ },
+ dest={
+ "index": "sample_flight_delays_by_carrier"
+ },
+ pivot={
+ "group_by": {
+ "carrier": {
+ "terms": {
+ "field": "Carrier"
+ }
+ }
+ },
+ "aggregations": {
+ "flights_count": {
+ "value_count": {
+ "field": "FlightNum"
+ }
+ },
+ "delay_mins_total": {
+ "sum": {
+ "field": "FlightDelayMin"
+ }
+ },
+ "flight_mins_total": {
+ "sum": {
+ "field": "FlightTimeMin"
+ }
+ },
+ "delay_time_percentage": {
+ "bucket_script": {
+ "buckets_path": {
+ "delay_time": "delay_mins_total.value",
+ "flight_time": "flight_mins_total.value"
+ },
+ "script": "(params.delay_time / params.flight_time) * 100"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/be9836fe55c5fada404a2adc1663d832.asciidoc b/docs/examples/be9836fe55c5fada404a2adc1663d832.asciidoc
index 308fff79c..8a151046b 100644
--- a/docs/examples/be9836fe55c5fada404a2adc1663d832.asciidoc
+++ b/docs/examples/be9836fe55c5fada404a2adc1663d832.asciidoc
@@ -1,22 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1437
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "runtime": {
- "http": {
- "type": "composite",
- "script": 'emit(grok("%{COMMONAPACHELOG}").extract(doc["message"].value))',
- "fields": {
- "clientip": {"type": "ip"},
- "verb": {"type": "keyword"},
- "response": {"type": "long"},
+ runtime={
+ "http": {
+ "type": "composite",
+ "script": "emit(grok(\"%{COMMONAPACHELOG}\").extract(doc[\"message\"].value))",
+ "fields": {
+ "clientip": {
+ "type": "ip"
},
+ "verb": {
+ "type": "keyword"
+ },
+ "response": {
+ "type": "long"
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/beaf43b274b0f32cf3cf48f59e5cb1f2.asciidoc b/docs/examples/beaf43b274b0f32cf3cf48f59e5cb1f2.asciidoc
new file mode 100644
index 000000000..3248655ee
--- /dev/null
+++ b/docs/examples/beaf43b274b0f32cf3cf48f59e5cb1f2.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/get-snapshot-api.asciidoc:745
+
+[source, python]
+----
+resp = client.snapshot.get(
+ repository="my_repository",
+ snapshot="snapshot_*",
+ sort="start_time",
+ from_sort_value="1577833200000",
+)
+print(resp)
+----
diff --git a/docs/examples/beb0b9ff4f68672273fcff1b7bae706b.asciidoc b/docs/examples/beb0b9ff4f68672273fcff1b7bae706b.asciidoc
index 82530fb39..916bf24f0 100644
--- a/docs/examples/beb0b9ff4f68672273fcff1b7bae706b.asciidoc
+++ b/docs/examples/beb0b9ff4f68672273fcff1b7bae706b.asciidoc
@@ -1,14 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:405
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {"user_identifier": {"type": "keyword"}}
+ mappings={
+ "properties": {
+ "user_identifier": {
+ "type": "keyword"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/beba2a9795c8a13653e1edf64eec4357.asciidoc b/docs/examples/beba2a9795c8a13653e1edf64eec4357.asciidoc
index aafc40145..9f5be6357 100644
--- a/docs/examples/beba2a9795c8a13653e1edf64eec4357.asciidoc
+++ b/docs/examples/beba2a9795c8a13653e1edf64eec4357.asciidoc
@@ -1,13 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/allocation/filtering.asciidoc:74
[source, python]
----
resp = client.indices.put_settings(
index="test",
- body={
+ settings={
"index.routing.allocation.require.size": "big",
- "index.routing.allocation.require.rack": "rack1",
+ "index.routing.allocation.require.rack": "rack1"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/bed14cc152522ca0726ac3746ebc31db.asciidoc b/docs/examples/bed14cc152522ca0726ac3746ebc31db.asciidoc
index d4de6b4ed..d81ecdd1a 100644
--- a/docs/examples/bed14cc152522ca0726ac3746ebc31db.asciidoc
+++ b/docs/examples/bed14cc152522ca0726ac3746ebc31db.asciidoc
@@ -1,20 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/unsigned_long.asciidoc:31
[source, python]
----
resp = client.bulk(
index="my_index",
- refresh="true",
- body=[
- {"index": {"_id": 1}},
- {"my_counter": 0},
- {"index": {"_id": 2}},
- {"my_counter": 9223372036854776000},
- {"index": {"_id": 3}},
- {"my_counter": 18446744073709552000},
- {"index": {"_id": 4}},
- {"my_counter": 18446744073709552000},
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "my_counter": 0
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "my_counter": 9223372036854776000
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "my_counter": 18446744073709552000
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "my_counter": 18446744073709552000
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/bf17440ac178d2ef5f5be643d033920b.asciidoc b/docs/examples/bf17440ac178d2ef5f5be643d033920b.asciidoc
new file mode 100644
index 000000000..af7cc44d9
--- /dev/null
+++ b/docs/examples/bf17440ac178d2ef5f5be643d033920b.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-elser.asciidoc:138
+
+[source, python]
+----
+resp = client.reindex(
+ wait_for_completion=False,
+ source={
+ "index": "test-data",
+ "size": 50
+ },
+ dest={
+ "index": "my-index",
+ "pipeline": "elser-v2-test"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bf1de9fa1b825fa875d27fa08821a6d1.asciidoc b/docs/examples/bf1de9fa1b825fa875d27fa08821a6d1.asciidoc
new file mode 100644
index 000000000..20dc314c2
--- /dev/null
+++ b/docs/examples/bf1de9fa1b825fa875d27fa08821a6d1.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-across-clusters.asciidoc:109
+
+[source, python]
+----
+resp = client.security.put_user(
+ username="remote_user",
+ password="",
+ roles=[
+ "remote1"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/bf2e6ea2bae621b9b2fee7003e891f86.asciidoc b/docs/examples/bf2e6ea2bae621b9b2fee7003e891f86.asciidoc
new file mode 100644
index 000000000..f5e739cdf
--- /dev/null
+++ b/docs/examples/bf2e6ea2bae621b9b2fee7003e891f86.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/recipes/stemming.asciidoc:58
+
+[source, python]
+----
+resp = client.search(
+ index="index",
+ query={
+ "simple_query_string": {
+ "fields": [
+ "body"
+ ],
+ "query": "ski"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bf3f520b47581d861e802730aaf2a519.asciidoc b/docs/examples/bf3f520b47581d861e802730aaf2a519.asciidoc
new file mode 100644
index 000000000..dfc5bc6f9
--- /dev/null
+++ b/docs/examples/bf3f520b47581d861e802730aaf2a519.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:33
+
+[source, python]
+----
+resp = client.indices.update_aliases(
+ actions=[
+ {
+ "add": {
+ "index": "logs-nginx.access-prod",
+ "alias": "logs"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/bf448c3889c18266e2e6d3af4f614da2.asciidoc b/docs/examples/bf448c3889c18266e2e6d3af4f614da2.asciidoc
new file mode 100644
index 000000000..37d732ea5
--- /dev/null
+++ b/docs/examples/bf448c3889c18266e2e6d3af4f614da2.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:336
+
+[source, python]
+----
+resp = client.index(
+ index=".ds-my-data-stream-2099-03-08-000003",
+ id="bfspvnIBr7VVZlfp2lqX",
+ if_seq_no="0",
+ if_primary_term="1",
+ document={
+ "@timestamp": "2099-03-08T11:06:07.000Z",
+ "user": {
+ "id": "8a4f500d"
+ },
+ "message": "Login successful"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bf639275d0818be04317ee5ab6075da6.asciidoc b/docs/examples/bf639275d0818be04317ee5ab6075da6.asciidoc
new file mode 100644
index 000000000..ef0d838c9
--- /dev/null
+++ b/docs/examples/bf639275d0818be04317ee5ab6075da6.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/has-parent-query.asciidoc:52
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "has_parent": {
+ "parent_type": "parent",
+ "query": {
+ "term": {
+ "tag": {
+ "value": "Elasticsearch"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bf8680d940c84e43a9483a25548dea57.asciidoc b/docs/examples/bf8680d940c84e43a9483a25548dea57.asciidoc
new file mode 100644
index 000000000..192c13711
--- /dev/null
+++ b/docs/examples/bf8680d940c84e43a9483a25548dea57.asciidoc
@@ -0,0 +1,62 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/search-analyzer.asciidoc:16
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "filter": {
+ "autocomplete_filter": {
+ "type": "edge_ngram",
+ "min_gram": 1,
+ "max_gram": 20
+ }
+ },
+ "analyzer": {
+ "autocomplete": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "autocomplete_filter"
+ ]
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "text": {
+ "type": "text",
+ "analyzer": "autocomplete",
+ "search_analyzer": "standard"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "text": "Quick Brown Fox"
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "text": {
+ "query": "Quick Br",
+ "operator": "and"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/bf9f13dc6c24cc225a72e32177e9ee02.asciidoc b/docs/examples/bf9f13dc6c24cc225a72e32177e9ee02.asciidoc
new file mode 100644
index 000000000..b557da1cb
--- /dev/null
+++ b/docs/examples/bf9f13dc6c24cc225a72e32177e9ee02.asciidoc
@@ -0,0 +1,88 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-distance-query.asciidoc:17
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my_locations",
+ mappings={
+ "properties": {
+ "pin": {
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my_locations",
+ id="1",
+ document={
+ "pin": {
+ "location": {
+ "lat": 40.12,
+ "lon": -71.34
+ }
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.indices.create(
+ index="my_geoshapes",
+ mappings={
+ "properties": {
+ "pin": {
+ "properties": {
+ "location": {
+ "type": "geo_shape"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp2)
+
+resp3 = client.index(
+ index="my_geoshapes",
+ id="1",
+ document={
+ "pin": {
+ "location": {
+ "type": "polygon",
+ "coordinates": [
+ [
+ [
+ 13,
+ 51.5
+ ],
+ [
+ 15,
+ 51.5
+ ],
+ [
+ 15,
+ 54
+ ],
+ [
+ 13,
+ 54
+ ],
+ [
+ 13,
+ 51.5
+ ]
+ ]
+ ]
+ }
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/bfb0db2a72f22c9c2046119777efbb43.asciidoc b/docs/examples/bfb0db2a72f22c9c2046119777efbb43.asciidoc
new file mode 100644
index 000000000..d40ad647c
--- /dev/null
+++ b/docs/examples/bfb0db2a72f22c9c2046119777efbb43.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-search.asciidoc:78
+
+[source, python]
+----
+resp = client.search(
+ index="elser-embeddings",
+ query={
+ "sparse_vector": {
+ "field": "content_embedding",
+ "inference_id": "elser_embeddings",
+ "query": "How to avoid muscle soreness after running?"
+ }
+ },
+ source=[
+ "id",
+ "content"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/bfb1aa83da8e3f414d50b5ed7894ed33.asciidoc b/docs/examples/bfb1aa83da8e3f414d50b5ed7894ed33.asciidoc
new file mode 100644
index 000000000..3230a5309
--- /dev/null
+++ b/docs/examples/bfb1aa83da8e3f414d50b5ed7894ed33.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:165
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ script_fields={
+ "my_doubled_field": {
+ "script": {
+ "source": "field('my_field').get(null) * params['multiplier']",
+ "params": {
+ "multiplier": 2
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bfb8a15cd05b43094ffbce8078bad3e1.asciidoc b/docs/examples/bfb8a15cd05b43094ffbce8078bad3e1.asciidoc
new file mode 100644
index 000000000..2b3be1a00
--- /dev/null
+++ b/docs/examples/bfb8a15cd05b43094ffbce8078bad3e1.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/get-snapshot-api.asciidoc:351
+
+[source, python]
+----
+resp = client.snapshot.get(
+ repository="my_repository",
+ snapshot="snapshot_2",
+)
+print(resp)
+----
diff --git a/docs/examples/bfd6fa3f44e6165f8999102f5a8e24d6.asciidoc b/docs/examples/bfd6fa3f44e6165f8999102f5a8e24d6.asciidoc
new file mode 100644
index 000000000..c283f338a
--- /dev/null
+++ b/docs/examples/bfd6fa3f44e6165f8999102f5a8e24d6.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/highlighting-multi-fields.asciidoc:41
+
+[source, python]
+----
+resp = client.search(
+ index="index1",
+ query={
+ "query_string": {
+ "query": "running with scissors",
+ "fields": [
+ "comment",
+ "comment.english"
+ ]
+ }
+ },
+ highlight={
+ "order": "score",
+ "fields": {
+ "comment": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/bfdad8a928ea30d7cf60d0a0a6bc6e2e.asciidoc b/docs/examples/bfdad8a928ea30d7cf60d0a0a6bc6e2e.asciidoc
index 7d843b759..1cca191c4 100644
--- a/docs/examples/bfdad8a928ea30d7cf60d0a0a6bc6e2e.asciidoc
+++ b/docs/examples/bfdad8a928ea30d7cf60d0a0a6bc6e2e.asciidoc
@@ -1,17 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
// docs/bulk.asciidoc:711
[source, python]
----
resp = client.bulk(
filter_path="items.*.error",
- body=[
- {"update": {"_id": "5", "_index": "index1"}},
- {"doc": {"my_field": "baz"}},
- {"update": {"_id": "6", "_index": "index1"}},
- {"doc": {"my_field": "baz"}},
- {"update": {"_id": "7", "_index": "index1"}},
- {"doc": {"my_field": "baz"}},
+ operations=[
+ {
+ "update": {
+ "_id": "5",
+ "_index": "index1"
+ }
+ },
+ {
+ "doc": {
+ "my_field": "baz"
+ }
+ },
+ {
+ "update": {
+ "_id": "6",
+ "_index": "index1"
+ }
+ },
+ {
+ "doc": {
+ "my_field": "baz"
+ }
+ },
+ {
+ "update": {
+ "_id": "7",
+ "_index": "index1"
+ }
+ },
+ {
+ "doc": {
+ "my_field": "baz"
+ }
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c00c9412609832ebceb9e786dd9542df.asciidoc b/docs/examples/c00c9412609832ebceb9e786dd9542df.asciidoc
new file mode 100644
index 000000000..ea55b13c7
--- /dev/null
+++ b/docs/examples/c00c9412609832ebceb9e786dd9542df.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-name-description-api.asciidoc:79
+
+[source, python]
+----
+resp = client.connector.update_name(
+ connector_id="my-connector",
+ name="Custom connector",
+ description="This is my customized connector",
+)
+print(resp)
+----
diff --git a/docs/examples/c012f42b26eb8dd9b197644c3ed954cf.asciidoc b/docs/examples/c012f42b26eb8dd9b197644c3ed954cf.asciidoc
index 5fecd1065..e6502a317 100644
--- a/docs/examples/c012f42b26eb8dd9b197644c3ed954cf.asciidoc
+++ b/docs/examples/c012f42b26eb8dd9b197644c3ed954cf.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:400
[source, python]
@@ -5,13 +6,16 @@
resp = client.index(
index="my-index-000001",
id="2",
- body={
+ document={
"name": {
"first": "Paul",
"last": "McCartney",
- "title": {"value": "Sir", "category": "order of chivalry"},
+ "title": {
+ "value": "Sir",
+ "category": "order of chivalry"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c02c2916b97b6fa7db82dbc7f0378310.asciidoc b/docs/examples/c02c2916b97b6fa7db82dbc7f0378310.asciidoc
new file mode 100644
index 000000000..bf854843c
--- /dev/null
+++ b/docs/examples/c02c2916b97b6fa7db82dbc7f0378310.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrievers-reranking/semantic-reranking.asciidoc:109
+
+[source, python]
+----
+resp = client.search(
+ retriever={
+ "text_similarity_reranker": {
+ "retriever": {
+ "standard": {
+ "query": {
+ "match": {
+ "text": "How often does the moon hide the sun?"
+ }
+ }
+ }
+ },
+ "field": "text",
+ "inference_id": "my-cohere-rerank-model",
+ "inference_text": "How often does the moon hide the sun?",
+ "rank_window_size": 100,
+ "min_score": 0.5
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c03ce952de42eae4b522cedc9fd3d14a.asciidoc b/docs/examples/c03ce952de42eae4b522cedc9fd3d14a.asciidoc
index 24e58d7a7..50418c081 100644
--- a/docs/examples/c03ce952de42eae4b522cedc9fd3d14a.asciidoc
+++ b/docs/examples/c03ce952de42eae4b522cedc9fd3d14a.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:270
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0), (100.2 0.2, 100.8 0.2, 100.8 0.8, 100.2 0.8, 100.2 0.2))"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c065a200c00e2005d88ec2f0c10c908a.asciidoc b/docs/examples/c065a200c00e2005d88ec2f0c10c908a.asciidoc
new file mode 100644
index 000000000..e273f3730
--- /dev/null
+++ b/docs/examples/c065a200c00e2005d88ec2f0c10c908a.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/shingle-tokenfilter.asciidoc:31
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "shingle"
+ ],
+ text="quick brown fox jumps",
+)
+print(resp)
+----
diff --git a/docs/examples/c067182d385f59ce5952fb9a716fbf05.asciidoc b/docs/examples/c067182d385f59ce5952fb9a716fbf05.asciidoc
new file mode 100644
index 000000000..4a33d82c0
--- /dev/null
+++ b/docs/examples/c067182d385f59ce5952fb9a716fbf05.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/post-calendar-event.asciidoc:63
+
+[source, python]
+----
+resp = client.ml.post_calendar_events(
+ calendar_id="planned-outages",
+ events=[
+ {
+ "description": "event 1",
+ "start_time": 1513641600000,
+ "end_time": 1513728000000
+ },
+ {
+ "description": "event 2",
+ "start_time": 1513814400000,
+ "end_time": 1513900800000
+ },
+ {
+ "description": "event 3",
+ "start_time": 1514160000000,
+ "end_time": 1514246400000
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/c06b96352e15f0161705fee0b5925776.asciidoc b/docs/examples/c06b96352e15f0161705fee0b5925776.asciidoc
deleted file mode 100644
index 9e45248fd..000000000
--- a/docs/examples/c06b96352e15f0161705fee0b5925776.asciidoc
+++ /dev/null
@@ -1,6 +0,0 @@
-// query-dsl/nested-query.asciidoc:442
-
-[source, python]
-----
-
-----
\ No newline at end of file
diff --git a/docs/examples/c088ce5291ae28650b6091cdec489398.asciidoc b/docs/examples/c088ce5291ae28650b6091cdec489398.asciidoc
new file mode 100644
index 000000000..283484b2e
--- /dev/null
+++ b/docs/examples/c088ce5291ae28650b6091cdec489398.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// search/point-in-time-api.asciidoc:49
+
+[source, python]
+----
+resp = client.search(
+ size=100,
+ query={
+ "match": {
+ "title": "elasticsearch"
+ }
+ },
+ pit={
+ "id": "46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==",
+ "keep_alive": "1m"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c0a4b0c1c6eff14da8b152ceb19c1c31.asciidoc b/docs/examples/c0a4b0c1c6eff14da8b152ceb19c1c31.asciidoc
index 54b93218d..56e13872d 100644
--- a/docs/examples/c0a4b0c1c6eff14da8b152ceb19c1c31.asciidoc
+++ b/docs/examples/c0a4b0c1c6eff14da8b152ceb19c1c31.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// setup/restart-cluster.asciidoc:93
[source, python]
@@ -5,6 +6,6 @@
resp = client.cat.health()
print(resp)
-resp = client.cat.nodes()
-print(resp)
-----
\ No newline at end of file
+resp1 = client.cat.nodes()
+print(resp1)
+----
diff --git a/docs/examples/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc b/docs/examples/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc
index bf68f4e31..f01af85e1 100644
--- a/docs/examples/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc
+++ b/docs/examples/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc
@@ -1,9 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/term-query.asciidoc:28
[source, python]
----
resp = client.search(
- body={"query": {"term": {"user.id": {"value": "kimchy", "boost": 1}}}},
+ query={
+ "term": {
+ "user.id": {
+ "value": "kimchy",
+ "boost": 1
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c0ddfb2e6315f5bcf0d3ef414b5bbed3.asciidoc b/docs/examples/c0ddfb2e6315f5bcf0d3ef414b5bbed3.asciidoc
new file mode 100644
index 000000000..d005a58f0
--- /dev/null
+++ b/docs/examples/c0ddfb2e6315f5bcf0d3ef414b5bbed3.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-configuration-api.asciidoc:335
+
+[source, python]
+----
+resp = client.connector.update_configuration(
+ connector_id="my-spo-connector",
+ values={
+ "secret_value": "foo-bar"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c0ebaa33e750b87555dc352073f692e8.asciidoc b/docs/examples/c0ebaa33e750b87555dc352073f692e8.asciidoc
index aeae5bbd5..8d65ebc46 100644
--- a/docs/examples/c0ebaa33e750b87555dc352073f692e8.asciidoc
+++ b/docs/examples/c0ebaa33e750b87555dc352073f692e8.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// indices/update-settings.asciidoc:181
[source, python]
@@ -7,20 +8,23 @@ resp = client.indices.close(
)
print(resp)
-resp = client.indices.put_settings(
+resp1 = client.indices.put_settings(
index="my-index-000001",
- body={
+ settings={
"analysis": {
"analyzer": {
- "content": {"type": "custom", "tokenizer": "whitespace"}
+ "content": {
+ "type": "custom",
+ "tokenizer": "whitespace"
+ }
}
}
},
)
-print(resp)
+print(resp1)
-resp = client.indices.open(
+resp2 = client.indices.open(
index="my-index-000001",
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/c0ff8b3db994c4736f7579dde18097d2.asciidoc b/docs/examples/c0ff8b3db994c4736f7579dde18097d2.asciidoc
index a49449e16..aaccc1288 100644
--- a/docs/examples/c0ff8b3db994c4736f7579dde18097d2.asciidoc
+++ b/docs/examples/c0ff8b3db994c4736f7579dde18097d2.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:297
[source, python]
@@ -5,8 +6,8 @@
resp = client.get_source(
index="my-index-000001",
id="1",
- _source_includes="*.id",
- _source_excludes="entities",
+ source_includes="*.id",
+ source_excludes="entities",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c10a486a28cbc5b2f15c3474ae31a431.asciidoc b/docs/examples/c10a486a28cbc5b2f15c3474ae31a431.asciidoc
new file mode 100644
index 000000000..b2e43a93d
--- /dev/null
+++ b/docs/examples/c10a486a28cbc5b2f15c3474ae31a431.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:187
+
+[source, python]
+----
+resp = client.slm.put_lifecycle(
+ policy_id="nightly-snapshots",
+ schedule="0 30 1 * * ?",
+ name="",
+ repository="my_repository",
+ config={
+ "indices": "*",
+ "include_global_state": True
+ },
+ retention={
+ "expire_after": "30d",
+ "min_count": 5,
+ "max_count": 50
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c11c4d6b30e882871bf0074f407149bd.asciidoc b/docs/examples/c11c4d6b30e882871bf0074f407149bd.asciidoc
new file mode 100644
index 000000000..a4ddf9675
--- /dev/null
+++ b/docs/examples/c11c4d6b30e882871bf0074f407149bd.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/parent-id-query.asciidoc:47
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "text": "This is a parent document.",
+ "my-join-field": "my-parent"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c12d6e962f083c728f9397932f05202e.asciidoc b/docs/examples/c12d6e962f083c728f9397932f05202e.asciidoc
new file mode 100644
index 000000000..b3e1432ec
--- /dev/null
+++ b/docs/examples/c12d6e962f083c728f9397932f05202e.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/list-connector-sync-jobs-api.asciidoc:71
+
+[source, python]
+----
+resp = client.perform_request(
+ "GET",
+ "/_connector/_sync_job",
+ params={
+ "connector_id": "connector-1"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c1409f591a01589638d9b00436ce42c0.asciidoc b/docs/examples/c1409f591a01589638d9b00436ce42c0.asciidoc
new file mode 100644
index 000000000..34d8ac063
--- /dev/null
+++ b/docs/examples/c1409f591a01589638d9b00436ce42c0.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-cache.asciidoc:61
+
+[source, python]
+----
+resp = client.security.clear_cached_realms(
+ realms="default_file",
+ usernames="rdeniro,alpacino",
+)
+print(resp)
+----
diff --git a/docs/examples/c147de68fd6da032ad4a3c1bf626f5d6.asciidoc b/docs/examples/c147de68fd6da032ad4a3c1bf626f5d6.asciidoc
new file mode 100644
index 000000000..0c6394b4a
--- /dev/null
+++ b/docs/examples/c147de68fd6da032ad4a3c1bf626f5d6.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:410
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ highlight={
+ "fields": {
+ "comment": {
+ "type": "plain"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c155d2670ff82b135c7dcec0fc8a3f23.asciidoc b/docs/examples/c155d2670ff82b135c7dcec0fc8a3f23.asciidoc
new file mode 100644
index 000000000..17d15847b
--- /dev/null
+++ b/docs/examples/c155d2670ff82b135c7dcec0fc8a3f23.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1378
+
+[source, python]
+----
+resp = client.eql.delete(
+ id="FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
+)
+print(resp)
+----
diff --git a/docs/examples/c18100d62ed31bc9e05f62900156e6a8.asciidoc b/docs/examples/c18100d62ed31bc9e05f62900156e6a8.asciidoc
new file mode 100644
index 000000000..0be644e92
--- /dev/null
+++ b/docs/examples/c18100d62ed31bc9e05f62900156e6a8.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/list-connectors-api.asciidoc:92
+
+[source, python]
+----
+resp = client.connector.list(
+ index_name="search-google-drive",
+)
+print(resp)
+----
diff --git a/docs/examples/c186ecf6f799ddff7add1abdecea5821.asciidoc b/docs/examples/c186ecf6f799ddff7add1abdecea5821.asciidoc
new file mode 100644
index 000000000..6a9a3035a
--- /dev/null
+++ b/docs/examples/c186ecf6f799ddff7add1abdecea5821.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/fields.asciidoc:214
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "full_name": {
+ "type": "text",
+ "store": True
+ },
+ "title": {
+ "type": "text",
+ "store": True
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "full_name": "Alice Ball",
+ "title": "Professor"
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ script_fields={
+ "name_with_title": {
+ "script": {
+ "lang": "painless",
+ "source": "params._fields['title'].value + ' ' + params._fields['full_name'].value"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/c187b52646cedeebe0716327add65642.asciidoc b/docs/examples/c187b52646cedeebe0716327add65642.asciidoc
new file mode 100644
index 000000000..876d69159
--- /dev/null
+++ b/docs/examples/c187b52646cedeebe0716327add65642.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/apis/get-async-sql-search-api.asciidoc:12
+
+[source, python]
+----
+resp = client.sql.get_async(
+ id="FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=",
+ format="json",
+)
+print(resp)
+----
diff --git a/docs/examples/c1a39c2628ada04c3ddd61a303b65d44.asciidoc b/docs/examples/c1a39c2628ada04c3ddd61a303b65d44.asciidoc
new file mode 100644
index 000000000..1e3c16fcf
--- /dev/null
+++ b/docs/examples/c1a39c2628ada04c3ddd61a303b65d44.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// vectors/vector-functions.asciidoc:200
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "script_score": {
+ "query": {
+ "bool": {
+ "filter": {
+ "term": {
+ "status": "published"
+ }
+ }
+ }
+ },
+ "script": {
+ "source": "(24 - hamming(params.queryVector, 'my_byte_dense_vector')) / 24",
+ "params": {
+ "queryVector": [
+ 4,
+ 3,
+ 0
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc b/docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc
index eb3843b34..f90fa7796 100644
--- a/docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc
+++ b/docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc
@@ -1,11 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/term-query.asciidoc:137
[source, python]
----
resp = client.search(
index="my-index-000001",
- pretty="true",
- body={"query": {"term": {"full_text": "Quick Brown Foxes!"}}},
+ pretty=True,
+ query={
+ "term": {
+ "full_text": "Quick Brown Foxes!"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c1ac9e53b04f7acee4b4933969d6b574.asciidoc b/docs/examples/c1ac9e53b04f7acee4b4933969d6b574.asciidoc
new file mode 100644
index 000000000..2f923d81d
--- /dev/null
+++ b/docs/examples/c1ac9e53b04f7acee4b4933969d6b574.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/preview-transform.asciidoc:290
+
+[source, python]
+----
+resp = client.transform.preview_transform(
+ source={
+ "index": "kibana_sample_data_ecommerce"
+ },
+ pivot={
+ "group_by": {
+ "customer_id": {
+ "terms": {
+ "field": "customer_id",
+ "missing_bucket": True
+ }
+ }
+ },
+ "aggregations": {
+ "max_price": {
+ "max": {
+ "field": "taxful_total_price"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c1ad9ff64728a5bfeeb485e60ec694a1.asciidoc b/docs/examples/c1ad9ff64728a5bfeeb485e60ec694a1.asciidoc
new file mode 100644
index 000000000..14f229c73
--- /dev/null
+++ b/docs/examples/c1ad9ff64728a5bfeeb485e60ec694a1.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// search/rank-eval.asciidoc:453
+
+[source, python]
+----
+resp = client.rank_eval(
+ index="my-index-000001",
+ requests=[
+ {
+ "id": "JFK query",
+ "request": {
+ "query": {
+ "match_all": {}
+ }
+ },
+ "ratings": []
+ }
+ ],
+ metric={
+ "expected_reciprocal_rank": {
+ "maximum_relevance": 3,
+ "k": 20
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c1bb395546102279296534522061829f.asciidoc b/docs/examples/c1bb395546102279296534522061829f.asciidoc
index 18dc89f1b..2df09de38 100644
--- a/docs/examples/c1bb395546102279296534522061829f.asciidoc
+++ b/docs/examples/c1bb395546102279296534522061829f.asciidoc
@@ -1,22 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-point.asciidoc:229
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"point": {"type": "geo_point"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "point": {
+ "type": "geo_point"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"point": [{"lat": -90, "lon": -80}, {"lat": 10, "lon": 30}]},
+ document={
+ "point": [
+ {
+ "lat": -90,
+ "lon": -80
+ },
+ {
+ "lat": 10,
+ "lon": 30
+ }
+ ]
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/c1efc5cfcb3c29711bfe118f1baa28b0.asciidoc b/docs/examples/c1efc5cfcb3c29711bfe118f1baa28b0.asciidoc
new file mode 100644
index 000000000..03fe2414f
--- /dev/null
+++ b/docs/examples/c1efc5cfcb3c29711bfe118f1baa28b0.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/keyword-analyzer.asciidoc:71
+
+[source, python]
+----
+resp = client.indices.create(
+ index="keyword_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "rebuilt_keyword": {
+ "tokenizer": "keyword",
+ "filter": []
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c208a06212dc0cf6ac413d4f2c154296.asciidoc b/docs/examples/c208a06212dc0cf6ac413d4f2c154296.asciidoc
new file mode 100644
index 000000000..6c5826271
--- /dev/null
+++ b/docs/examples/c208a06212dc0cf6ac413d4f2c154296.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/flush.asciidoc:131
+
+[source, python]
+----
+resp = client.indices.flush(
+ index="my-index-000001,my-index-000002",
+)
+print(resp)
+----
diff --git a/docs/examples/c208de54369379e8d78ab201be18b6be.asciidoc b/docs/examples/c208de54369379e8d78ab201be18b6be.asciidoc
index 87557d76b..d5e9ab8aa 100644
--- a/docs/examples/c208de54369379e8d78ab201be18b6be.asciidoc
+++ b/docs/examples/c208de54369379e8d78ab201be18b6be.asciidoc
@@ -1,30 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:234
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "longs_as_strings": {
- "match_mapping_type": "string",
- "match": "long_*",
- "unmatch": "*_text",
- "mapping": {"type": "long"},
+ mappings={
+ "dynamic_templates": [
+ {
+ "longs_as_strings": {
+ "match_mapping_type": "string",
+ "match": "long_*",
+ "unmatch": "*_text",
+ "mapping": {
+ "type": "long"
}
}
- ]
- }
+ }
+ ]
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"long_num": "5", "long_text": "foo"},
+ document={
+ "long_num": "5",
+ "long_text": "foo"
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/c21aaedb5752a83489476fa3b5e2e9ff.asciidoc b/docs/examples/c21aaedb5752a83489476fa3b5e2e9ff.asciidoc
new file mode 100644
index 000000000..fc31b2398
--- /dev/null
+++ b/docs/examples/c21aaedb5752a83489476fa3b5e2e9ff.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// query-rules/apis/put-query-rule.asciidoc:110
+
+[source, python]
+----
+resp = client.query_rules.put_rule(
+ ruleset_id="my-ruleset",
+ rule_id="my-rule1",
+ type="pinned",
+ criteria=[
+ {
+ "type": "contains",
+ "metadata": "user_query",
+ "values": [
+ "pugs",
+ "puggles"
+ ]
+ },
+ {
+ "type": "exact",
+ "metadata": "user_country",
+ "values": [
+ "us"
+ ]
+ }
+ ],
+ actions={
+ "ids": [
+ "id1",
+ "id2"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c21eb4bc30087188241cbba6b6b89999.asciidoc b/docs/examples/c21eb4bc30087188241cbba6b6b89999.asciidoc
new file mode 100644
index 000000000..f2ad14f33
--- /dev/null
+++ b/docs/examples/c21eb4bc30087188241cbba6b6b89999.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-service-type-api.asciidoc:77
+
+[source, python]
+----
+resp = client.connector.update_service_type(
+ connector_id="my-connector",
+ service_type="sharepoint_online",
+)
+print(resp)
+----
diff --git a/docs/examples/c23e32775340d7bc6f46820313014d8a.asciidoc b/docs/examples/c23e32775340d7bc6f46820313014d8a.asciidoc
new file mode 100644
index 000000000..b7197b25f
--- /dev/null
+++ b/docs/examples/c23e32775340d7bc6f46820313014d8a.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:520
+
+[source, python]
+----
+resp = client.index(
+ index="my_test_scores_2",
+ pipeline="my_test_scores_pipeline",
+ document={
+ "student": "kimchy",
+ "grad_year": "2099",
+ "math_score": 1200,
+ "verbal_score": 800
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c267e90b7873a7c8c8af06f01e958e69.asciidoc b/docs/examples/c267e90b7873a7c8c8af06f01e958e69.asciidoc
new file mode 100644
index 000000000..7a671bba1
--- /dev/null
+++ b/docs/examples/c267e90b7873a7c8c8af06f01e958e69.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/bi-directional-disaster-recovery.asciidoc:185
+
+[source, python]
+----
+resp = client.search(
+ index="logs*",
+ size="0",
+)
+print(resp)
+----
diff --git a/docs/examples/c27b7d9836aa4ea756f59e9c42911721.asciidoc b/docs/examples/c27b7d9836aa4ea756f59e9c42911721.asciidoc
new file mode 100644
index 000000000..090491b43
--- /dev/null
+++ b/docs/examples/c27b7d9836aa4ea756f59e9c42911721.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/scroll-api.asciidoc:29
+
+[source, python]
+----
+resp = client.scroll(
+ scroll_id="DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==",
+)
+print(resp)
+----
diff --git a/docs/examples/c28f0b0dd3246cb91d6facb3295a61d7.asciidoc b/docs/examples/c28f0b0dd3246cb91d6facb3295a61d7.asciidoc
new file mode 100644
index 000000000..5955acbed
--- /dev/null
+++ b/docs/examples/c28f0b0dd3246cb91d6facb3295a61d7.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/restore-from-snapshot.asciidoc:409
+
+[source, python]
+----
+resp = client.indices.close(
+ index="kibana_sample_data_flights,.ds-my-data-stream-2022.06.17-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/c2c21e2824fbf6b7198ede30419da82b.asciidoc b/docs/examples/c2c21e2824fbf6b7198ede30419da82b.asciidoc
new file mode 100644
index 000000000..9cc582462
--- /dev/null
+++ b/docs/examples/c2c21e2824fbf6b7198ede30419da82b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:527
+
+[source, python]
+----
+resp = client.clear_scroll(
+ scroll_id="_all",
+)
+print(resp)
+----
diff --git a/docs/examples/c2d7c36daac8608d2515c549b2c82436.asciidoc b/docs/examples/c2d7c36daac8608d2515c549b2c82436.asciidoc
new file mode 100644
index 000000000..f9420a966
--- /dev/null
+++ b/docs/examples/c2d7c36daac8608d2515c549b2c82436.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:491
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "tile": {
+ "geotile_grid": {
+ "field": "location",
+ "precision": 22,
+ "bounds": {
+ "top_left": "POINT (4.9 52.4)",
+ "bottom_right": "POINT (5.0 52.3)"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c318fde926842722825a51e5c9c326a9.asciidoc b/docs/examples/c318fde926842722825a51e5c9c326a9.asciidoc
new file mode 100644
index 000000000..df7259c36
--- /dev/null
+++ b/docs/examples/c318fde926842722825a51e5c9c326a9.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/trim-tokenfilter.asciidoc:34
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="keyword",
+ text=" fox ",
+)
+print(resp)
+----
diff --git a/docs/examples/c38c882c642dd412e8fa4c3eed49d12f.asciidoc b/docs/examples/c38c882c642dd412e8fa4c3eed49d12f.asciidoc
index 5c4f35df8..c08062c1d 100644
--- a/docs/examples/c38c882c642dd412e8fa4c3eed49d12f.asciidoc
+++ b/docs/examples/c38c882c642dd412e8fa4c3eed49d12f.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/search-as-you-type.asciidoc:147
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={"query": {"match_phrase_prefix": {"my_field": "brown f"}}},
+ query={
+ "match_phrase_prefix": {
+ "my_field": "brown f"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c4272ad0309ffbcbe9ce96bf9fb4352a.asciidoc b/docs/examples/c4272ad0309ffbcbe9ce96bf9fb4352a.asciidoc
new file mode 100644
index 000000000..42d7f3655
--- /dev/null
+++ b/docs/examples/c4272ad0309ffbcbe9ce96bf9fb4352a.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/context-suggest.asciidoc:140
+
+[source, python]
+----
+resp = client.search(
+ index="place",
+ pretty=True,
+ suggest={
+ "place_suggestion": {
+ "prefix": "tim",
+ "completion": {
+ "field": "suggest",
+ "size": 10,
+ "contexts": {
+ "place_type": [
+ "cafe",
+ "restaurants"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c42bc6e74afc3d43cd032ec2bfd77385.asciidoc b/docs/examples/c42bc6e74afc3d43cd032ec2bfd77385.asciidoc
new file mode 100644
index 000000000..890a4788c
--- /dev/null
+++ b/docs/examples/c42bc6e74afc3d43cd032ec2bfd77385.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/word-delimiter-tokenfilter.asciidoc:58
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="keyword",
+ filter=[
+ "word_delimiter"
+ ],
+ text="Neil's-Super-Duper-XL500--42+AutoCoder",
+)
+print(resp)
+----
diff --git a/docs/examples/c4607ca79b2bcde39305d6f4f21cad37.asciidoc b/docs/examples/c4607ca79b2bcde39305d6f4f21cad37.asciidoc
new file mode 100644
index 000000000..9e77a3417
--- /dev/null
+++ b/docs/examples/c4607ca79b2bcde39305d6f4f21cad37.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-rest.asciidoc:223
+
+[source, python]
+----
+resp = client.esql.query(
+ locale="fr-FR",
+ query="\n ROW birth_date_string = \"2023-01-15T00:00:00.000Z\"\n | EVAL birth_date = date_parse(birth_date_string)\n | EVAL month_of_birth = DATE_FORMAT(\"MMMM\",birth_date)\n | LIMIT 5\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/c464ed2001d66a1446f37659dc9efc2a.asciidoc b/docs/examples/c464ed2001d66a1446f37659dc9efc2a.asciidoc
new file mode 100644
index 000000000..729229ba3
--- /dev/null
+++ b/docs/examples/c464ed2001d66a1446f37659dc9efc2a.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/daterange-aggregation.asciidoc:19
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "range": {
+ "date_range": {
+ "field": "date",
+ "format": "MM-yyyy",
+ "ranges": [
+ {
+ "to": "now-10M/M"
+ },
+ {
+ "from": "now-10M/M"
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c47f030216a3c89f92f31787fc4d5df5.asciidoc b/docs/examples/c47f030216a3c89f92f31787fc4d5df5.asciidoc
new file mode 100644
index 000000000..9aa8729a4
--- /dev/null
+++ b/docs/examples/c47f030216a3c89f92f31787fc4d5df5.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/plugins.asciidoc:51
+
+[source, python]
+----
+resp = client.cat.plugins(
+ v=True,
+ s="component",
+ h="name,component,version,description",
+)
+print(resp)
+----
diff --git a/docs/examples/c48b8bcd6f41e0d12b58e854e09ea893.asciidoc b/docs/examples/c48b8bcd6f41e0d12b58e854e09ea893.asciidoc
index fceda6c20..e9a12ae96 100644
--- a/docs/examples/c48b8bcd6f41e0d12b58e854e09ea893.asciidoc
+++ b/docs/examples/c48b8bcd6f41e0d12b58e854e09ea893.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:361
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "MULTIPOLYGON (((1002.0 200.0, 1003.0 200.0, 1003.0 300.0, 1002.0 300.0, 102.0 200.0)), ((1000.0 100.0, 1001.0 100.0, 1001.0 100.0, 1000.0 100.0, 1000.0 100.0), (1000.2 100.2, 1000.8 100.2, 1000.8 100.8, 1000.2 100.8, 1000.2 100.2)))"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c4a1d03dcfb82913d0724a42b0a89f20.asciidoc b/docs/examples/c4a1d03dcfb82913d0724a42b0a89f20.asciidoc
new file mode 100644
index 000000000..671dab80f
--- /dev/null
+++ b/docs/examples/c4a1d03dcfb82913d0724a42b0a89f20.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/clearcache.asciidoc:152
+
+[source, python]
+----
+resp = client.indices.clear_cache()
+print(resp)
+----
diff --git a/docs/examples/c4b727723b57052b6504bb74fe09abc6.asciidoc b/docs/examples/c4b727723b57052b6504bb74fe09abc6.asciidoc
new file mode 100644
index 000000000..6f9e84063
--- /dev/null
+++ b/docs/examples/c4b727723b57052b6504bb74fe09abc6.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template.asciidoc:12
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="template_1",
+ index_patterns=[
+ "template*"
+ ],
+ priority=1,
+ template={
+ "settings": {
+ "number_of_shards": 2
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c4c1a87414741a678f6cb91804daf095.asciidoc b/docs/examples/c4c1a87414741a678f6cb91804daf095.asciidoc
new file mode 100644
index 000000000..059a22f3c
--- /dev/null
+++ b/docs/examples/c4c1a87414741a678f6cb91804daf095.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/rank-feature-query.asciidoc:348
+
+[source, python]
+----
+resp = client.search(
+ index="test",
+ query={
+ "rank_feature": {
+ "field": "pagerank",
+ "linear": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c4fadbb7f61e5f83ab3fc9cd4b82b5e5.asciidoc b/docs/examples/c4fadbb7f61e5f83ab3fc9cd4b82b5e5.asciidoc
new file mode 100644
index 000000000..2e729b4d0
--- /dev/null
+++ b/docs/examples/c4fadbb7f61e5f83ab3fc9cd4b82b5e5.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:246
+
+[source, python]
+----
+resp = client.snapshot.restore(
+ repository="my_repository",
+ snapshot="my_snapshot_2099.05.06",
+ feature_states=[
+ "geoip"
+ ],
+ include_global_state=False,
+ indices="-*",
+)
+print(resp)
+----
diff --git a/docs/examples/c526fca1609b4c3c1d12dfd218d69a50.asciidoc b/docs/examples/c526fca1609b4c3c1d12dfd218d69a50.asciidoc
index bcfd83dcf..1134d03e1 100644
--- a/docs/examples/c526fca1609b4c3c1d12dfd218d69a50.asciidoc
+++ b/docs/examples/c526fca1609b4c3c1d12dfd218d69a50.asciidoc
@@ -1,12 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:377
[source, python]
----
resp = client.reindex(
- body={
- "source": {"index": "my-index-000001"},
- "dest": {"index": "my-new-index-000001"},
+ source={
+ "index": "my-index-000001"
+ },
+ dest={
+ "index": "my-new-index-000001"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c54597143ac86540726f6422fd98b22e.asciidoc b/docs/examples/c54597143ac86540726f6422fd98b22e.asciidoc
new file mode 100644
index 000000000..62e88c770
--- /dev/null
+++ b/docs/examples/c54597143ac86540726f6422fd98b22e.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/update-settings.asciidoc:50
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_security/settings",
+ headers={"Content-Type": "application/json"},
+ body={
+ "security": {
+ "index.auto_expand_replicas": "0-all"
+ },
+ "security-tokens": {
+ "index.auto_expand_replicas": "0-all"
+ },
+ "security-profile": {
+ "index.auto_expand_replicas": "0-all"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c554a1791f29bbbcddda84c64deaba6f.asciidoc b/docs/examples/c554a1791f29bbbcddda84c64deaba6f.asciidoc
new file mode 100644
index 000000000..e8090e26b
--- /dev/null
+++ b/docs/examples/c554a1791f29bbbcddda84c64deaba6f.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:229
+
+[source, python]
+----
+resp = client.sql.query(
+ format="txt",
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=5,
+)
+print(resp)
+----
diff --git a/docs/examples/c580092fd3d36c32b09d63921708a67b.asciidoc b/docs/examples/c580092fd3d36c32b09d63921708a67b.asciidoc
new file mode 100644
index 000000000..cd2aca947
--- /dev/null
+++ b/docs/examples/c580092fd3d36c32b09d63921708a67b.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/dis-max-query.asciidoc:18
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "dis_max": {
+ "queries": [
+ {
+ "term": {
+ "title": "Quick pets"
+ }
+ },
+ {
+ "term": {
+ "body": "Quick pets"
+ }
+ }
+ ],
+ "tie_breaker": 0.7
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c5802e9f3f4068fcecb6937b867b270d.asciidoc b/docs/examples/c5802e9f3f4068fcecb6937b867b270d.asciidoc
index c9ece83fd..c4ffbca73 100644
--- a/docs/examples/c5802e9f3f4068fcecb6937b867b270d.asciidoc
+++ b/docs/examples/c5802e9f3f4068fcecb6937b867b270d.asciidoc
@@ -1,15 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:400
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "genres": {
- "terms": {"field": "genre", "order": {"_count": "asc"}}
+ aggs={
+ "genres": {
+ "terms": {
+ "field": "genre",
+ "order": {
+ "_count": "asc"
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c580990a70028bb49cca8a6bde86bbf6.asciidoc b/docs/examples/c580990a70028bb49cca8a6bde86bbf6.asciidoc
new file mode 100644
index 000000000..3d3044f4a
--- /dev/null
+++ b/docs/examples/c580990a70028bb49cca8a6bde86bbf6.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/bulk-update-api-keys.asciidoc:236
+
+[source, python]
+----
+resp = client.security.bulk_update_api_keys(
+ body={
+ "ids": [
+ "VuaCfGcBCdbkQm-e5aOx",
+ "H3_AhoIBA9hmeQJdg7ij"
+ ],
+ "role_descriptors": {}
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c5ba7c4badb5ef5ca32740106e4aa6b6.asciidoc b/docs/examples/c5ba7c4badb5ef5ca32740106e4aa6b6.asciidoc
new file mode 100644
index 000000000..fa3ef8edf
--- /dev/null
+++ b/docs/examples/c5ba7c4badb5ef5ca32740106e4aa6b6.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/termvectors.asciidoc:36
+
+[source, python]
+----
+resp = client.termvectors(
+ index="my-index-000001",
+ id="1",
+ fields="message",
+)
+print(resp)
+----
diff --git a/docs/examples/c5bc577ff92f889225b0d2617adcb48c.asciidoc b/docs/examples/c5bc577ff92f889225b0d2617adcb48c.asciidoc
index 7133092f3..fc92b8bc8 100644
--- a/docs/examples/c5bc577ff92f889225b0d2617adcb48c.asciidoc
+++ b/docs/examples/c5bc577ff92f889225b0d2617adcb48c.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// setup/sysconfig/file-descriptors.asciidoc:29
[source, python]
@@ -7,4 +8,4 @@ resp = client.nodes.stats(
filter_path="**.max_file_descriptors",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c5cc19e48549fbc5327a9d46874bbeee.asciidoc b/docs/examples/c5cc19e48549fbc5327a9d46874bbeee.asciidoc
new file mode 100644
index 000000000..89f74cf5e
--- /dev/null
+++ b/docs/examples/c5cc19e48549fbc5327a9d46874bbeee.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:321
+
+[source, python]
+----
+resp = client.search(
+ index="quantized-image-index",
+ knn={
+ "field": "image-vector",
+ "query_vector": [
+ 0.1,
+ -2
+ ],
+ "k": 10,
+ "num_candidates": 100
+ },
+ fields=[
+ "title"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/c5ed7d83ade97a417aef28b9e2871e5d.asciidoc b/docs/examples/c5ed7d83ade97a417aef28b9e2871e5d.asciidoc
new file mode 100644
index 000000000..a4d7c3543
--- /dev/null
+++ b/docs/examples/c5ed7d83ade97a417aef28b9e2871e5d.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/common-log-format-example.asciidoc:189
+
+[source, python]
+----
+resp = client.search(
+ index="my-data-stream",
+ filter_path="hits.hits._source",
+)
+print(resp)
+----
diff --git a/docs/examples/c6151a0788a10a7f40da684d72c3255c.asciidoc b/docs/examples/c6151a0788a10a7f40da684d72c3255c.asciidoc
index d7f02cb5e..3e7126ca8 100644
--- a/docs/examples/c6151a0788a10a7f40da684d72c3255c.asciidoc
+++ b/docs/examples/c6151a0788a10a7f40da684d72c3255c.asciidoc
@@ -1,39 +1,62 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/flattened.asciidoc:225
[source, python]
----
resp = client.bulk(
index="my-index-000001",
- refresh="true",
- body=[
- {"index": {}},
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
{
"title": "Something really urgent",
"labels": {
"priority": "urgent",
- "release": ["v1.2.5", "v1.3.0"],
- "timestamp": {"created": 1541458026, "closed": 1541457010},
- },
+ "release": [
+ "v1.2.5",
+ "v1.3.0"
+ ],
+ "timestamp": {
+ "created": 1541458026,
+ "closed": 1541457010
+ }
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"title": "Somewhat less urgent",
"labels": {
"priority": "high",
- "release": ["v1.3.0"],
- "timestamp": {"created": 1541458026, "closed": 1541457010},
- },
+ "release": [
+ "v1.3.0"
+ ],
+ "timestamp": {
+ "created": 1541458026,
+ "closed": 1541457010
+ }
+ }
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"title": "Not urgent",
"labels": {
"priority": "low",
- "release": ["v1.2.0"],
- "timestamp": {"created": 1541458026, "closed": 1541457010},
- },
- },
+ "release": [
+ "v1.2.0"
+ ],
+ "timestamp": {
+ "created": 1541458026,
+ "closed": 1541457010
+ }
+ }
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c630a1f891aa9aa651f9982b832a42e1.asciidoc b/docs/examples/c630a1f891aa9aa651f9982b832a42e1.asciidoc
new file mode 100644
index 000000000..e30b5a617
--- /dev/null
+++ b/docs/examples/c630a1f891aa9aa651f9982b832a42e1.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:923
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "drop": {
+ "description": "Drop documents that contain 'network.name' of 'Guest'",
+ "if": "ctx.network?.name != null && ctx.network.name.contains('Guest')"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/c6339d09f85000a6432304b0ec63b8f6.asciidoc b/docs/examples/c6339d09f85000a6432304b0ec63b8f6.asciidoc
new file mode 100644
index 000000000..50b57646c
--- /dev/null
+++ b/docs/examples/c6339d09f85000a6432304b0ec63b8f6.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-component-template.asciidoc:226
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="template_1",
+ template={
+ "settings": {
+ "number_of_shards": 1
+ }
+ },
+ version=123,
+)
+print(resp)
+----
diff --git a/docs/examples/c639036b87d02fb864e27c4ca29ef833.asciidoc b/docs/examples/c639036b87d02fb864e27c4ca29ef833.asciidoc
new file mode 100644
index 000000000..09f94b964
--- /dev/null
+++ b/docs/examples/c639036b87d02fb864e27c4ca29ef833.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/diversified-sampler-aggregation.asciidoc:99
+
+[source, python]
+----
+resp = client.search(
+ index="stackoverflow",
+ size="0",
+ query={
+ "query_string": {
+ "query": "tags:kibana"
+ }
+ },
+ runtime_mappings={
+ "tags.hash": {
+ "type": "long",
+ "script": "emit(doc['tags'].hashCode())"
+ }
+ },
+ aggs={
+ "my_unbiased_sample": {
+ "diversified_sampler": {
+ "shard_size": 200,
+ "max_docs_per_value": 3,
+ "field": "tags.hash"
+ },
+ "aggs": {
+ "keywords": {
+ "significant_terms": {
+ "field": "tags",
+ "exclude": [
+ "kibana"
+ ]
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c64b61bedb21b9def8fce5092e677af9.asciidoc b/docs/examples/c64b61bedb21b9def8fce5092e677af9.asciidoc
index 30c0c079b..d7ae6d555 100644
--- a/docs/examples/c64b61bedb21b9def8fce5092e677af9.asciidoc
+++ b/docs/examples/c64b61bedb21b9def8fce5092e677af9.asciidoc
@@ -1,20 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// search/suggesters.asciidoc:46
[source, python]
----
resp = client.search(
- body={
- "suggest": {
- "my-suggest-1": {
- "text": "tring out Elasticsearch",
- "term": {"field": "message"},
- },
- "my-suggest-2": {
- "text": "kmichy",
- "term": {"field": "user.id"},
- },
+ suggest={
+ "my-suggest-1": {
+ "text": "tring out Elasticsearch",
+ "term": {
+ "field": "message"
+ }
+ },
+ "my-suggest-2": {
+ "text": "kmichy",
+ "term": {
+ "field": "user.id"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c654b09be981be12fc7be0ba33f8652b.asciidoc b/docs/examples/c654b09be981be12fc7be0ba33f8652b.asciidoc
index 1f96f2840..1bba42cae 100644
--- a/docs/examples/c654b09be981be12fc7be0ba33f8652b.asciidoc
+++ b/docs/examples/c654b09be981be12fc7be0ba33f8652b.asciidoc
@@ -1,24 +1,71 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:313
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "multilinestring",
"coordinates": [
- [[1002, 200], [1003, 200], [1003, 300], [1002, 300]],
- [[1000, 100], [1001, 100], [1001, 100], [1000, 100]],
[
- [1000.2, 100.2],
- [1000.8, 100.2],
- [1000.8, 100.8],
- [1000.2, 100.8],
+ [
+ 1002,
+ 200
+ ],
+ [
+ 1003,
+ 200
+ ],
+ [
+ 1003,
+ 300
+ ],
+ [
+ 1002,
+ 300
+ ]
],
- ],
+ [
+ [
+ 1000,
+ 100
+ ],
+ [
+ 1001,
+ 100
+ ],
+ [
+ 1001,
+ 100
+ ],
+ [
+ 1000,
+ 100
+ ]
+ ],
+ [
+ [
+ 1000.2,
+ 100.2
+ ],
+ [
+ 1000.8,
+ 100.2
+ ],
+ [
+ 1000.8,
+ 100.8
+ ],
+ [
+ 1000.2,
+ 100.8
+ ]
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c65b00a285f510dcd2865aa3539b4e03.asciidoc b/docs/examples/c65b00a285f510dcd2865aa3539b4e03.asciidoc
new file mode 100644
index 000000000..23e572ea8
--- /dev/null
+++ b/docs/examples/c65b00a285f510dcd2865aa3539b4e03.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/apis/get-transform.asciidoc:100
+
+[source, python]
+----
+resp = client.transform.get_transform(
+ size="10",
+)
+print(resp)
+----
diff --git a/docs/examples/c66dab0b114fa3e228e1c0e0e5a99b60.asciidoc b/docs/examples/c66dab0b114fa3e228e1c0e0e5a99b60.asciidoc
new file mode 100644
index 000000000..ebe3fbd57
--- /dev/null
+++ b/docs/examples/c66dab0b114fa3e228e1c0e0e5a99b60.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:247
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ fields=[
+ "user.first"
+ ],
+ source=False,
+)
+print(resp)
+----
diff --git a/docs/examples/c67b0f00c2e690303c0e5af2f51e0fea.asciidoc b/docs/examples/c67b0f00c2e690303c0e5af2f51e0fea.asciidoc
index ba43f19d4..15e29b183 100644
--- a/docs/examples/c67b0f00c2e690303c0e5af2f51e0fea.asciidoc
+++ b/docs/examples/c67b0f00c2e690303c0e5af2f51e0fea.asciidoc
@@ -1,18 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// search/suggesters.asciidoc:7
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "query": {"match": {"message": "tring out Elasticsearch"}},
- "suggest": {
- "my-suggestion": {
- "text": "tring out Elasticsearch",
- "term": {"field": "message"},
+ query={
+ "match": {
+ "message": "tring out Elasticsearch"
+ }
+ },
+ suggest={
+ "my-suggestion": {
+ "text": "tring out Elasticsearch",
+ "term": {
+ "field": "message"
}
- },
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c6abe91b5527870face2b826f37ba1da.asciidoc b/docs/examples/c6abe91b5527870face2b826f37ba1da.asciidoc
new file mode 100644
index 000000000..707ca689a
--- /dev/null
+++ b/docs/examples/c6abe91b5527870face2b826f37ba1da.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:438
+
+[source, python]
+----
+resp = client.search(
+ index="image-index",
+ query={
+ "match": {
+ "title": {
+ "query": "mountain lake",
+ "boost": 0.9
+ }
+ }
+ },
+ knn={
+ "field": "image-vector",
+ "query_vector": [
+ 54,
+ 10,
+ -2
+ ],
+ "k": 5,
+ "num_candidates": 50,
+ "boost": 0.1
+ },
+ size=10,
+)
+print(resp)
+----
diff --git a/docs/examples/c6b365c7da97d7e50f36820a7d36f548.asciidoc b/docs/examples/c6b365c7da97d7e50f36820a7d36f548.asciidoc
new file mode 100644
index 000000000..5e2a7d7cd
--- /dev/null
+++ b/docs/examples/c6b365c7da97d7e50f36820a7d36f548.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/disk/decrease-data-node-disk-usage.asciidoc:127
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my_index,my_other_index",
+ settings={
+ "index.number_of_replicas": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c6b5c695a9b757b5e7325345b206bde5.asciidoc b/docs/examples/c6b5c695a9b757b5e7325345b206bde5.asciidoc
new file mode 100644
index 000000000..6d84b16b7
--- /dev/null
+++ b/docs/examples/c6b5c695a9b757b5e7325345b206bde5.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/delete-pipeline.asciidoc:82
+
+[source, python]
+----
+resp = client.ingest.delete_pipeline(
+ id="pipeline-*",
+)
+print(resp)
+----
diff --git a/docs/examples/c6b8713bd49661d69d6b868f5b991d17.asciidoc b/docs/examples/c6b8713bd49661d69d6b868f5b991d17.asciidoc
new file mode 100644
index 000000000..ca1e0a6f0
--- /dev/null
+++ b/docs/examples/c6b8713bd49661d69d6b868f5b991d17.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/terms-set-query.asciidoc:85
+
+[source, python]
+----
+resp = client.index(
+ index="job-candidates",
+ id="1",
+ refresh=True,
+ document={
+ "name": "Jane Smith",
+ "programming_languages": [
+ "c++",
+ "java"
+ ],
+ "required_matches": 2
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c6bdd5c7de79d6d9ac8e33a397b511e8.asciidoc b/docs/examples/c6bdd5c7de79d6d9ac8e33a397b511e8.asciidoc
index e265ac1fd..95bf11903 100644
--- a/docs/examples/c6bdd5c7de79d6d9ac8e33a397b511e8.asciidoc
+++ b/docs/examples/c6bdd5c7de79d6d9ac8e33a397b511e8.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:321
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"user_id": {"type": "long"}}}},
+ mappings={
+ "properties": {
+ "user_id": {
+ "type": "long"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c6d39d22188dc7bbfdad811a94cbcc2b.asciidoc b/docs/examples/c6d39d22188dc7bbfdad811a94cbcc2b.asciidoc
new file mode 100644
index 000000000..3afb71acf
--- /dev/null
+++ b/docs/examples/c6d39d22188dc7bbfdad811a94cbcc2b.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/classic-tokenizer.asciidoc:25
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="classic",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/c6d5e3b6ff9c665ec5344a4bfa7add80.asciidoc b/docs/examples/c6d5e3b6ff9c665ec5344a4bfa7add80.asciidoc
new file mode 100644
index 000000000..80ecc8c11
--- /dev/null
+++ b/docs/examples/c6d5e3b6ff9c665ec5344a4bfa7add80.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/network/tracers.asciidoc:106
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "transport.tracer.include": "*",
+ "transport.tracer.exclude": "internal:coordination/fault_detection/*"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c6f07c53eda4db77305bb14751b3263f.asciidoc b/docs/examples/c6f07c53eda4db77305bb14751b3263f.asciidoc
new file mode 100644
index 000000000..e36838da8
--- /dev/null
+++ b/docs/examples/c6f07c53eda4db77305bb14751b3263f.asciidoc
@@ -0,0 +1,50 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/repository-azure.asciidoc:199
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_backup1",
+ repository={
+ "type": "azure"
+ },
+)
+print(resp)
+
+resp1 = client.snapshot.create_repository(
+ name="my_backup2",
+ repository={
+ "type": "azure",
+ "settings": {
+ "container": "backup-container",
+ "base_path": "backups",
+ "chunk_size": "32MB",
+ "compress": True
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.snapshot.create_repository(
+ name="my_backup3",
+ repository={
+ "type": "azure",
+ "settings": {
+ "client": "secondary"
+ }
+ },
+)
+print(resp2)
+
+resp3 = client.snapshot.create_repository(
+ name="my_backup4",
+ repository={
+ "type": "azure",
+ "settings": {
+ "client": "secondary",
+ "location_mode": "primary_only"
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/c733f20641b20e124f26198534755d6d.asciidoc b/docs/examples/c733f20641b20e124f26198534755d6d.asciidoc
new file mode 100644
index 000000000..d8e2d70df
--- /dev/null
+++ b/docs/examples/c733f20641b20e124f26198534755d6d.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations.asciidoc:149
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ aggs={
+ "my-first-agg-name": {
+ "terms": {
+ "field": "my-field"
+ }
+ },
+ "my-second-agg-name": {
+ "avg": {
+ "field": "my-other-field"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c765ce78f3605c0e70d213f22aac8a53.asciidoc b/docs/examples/c765ce78f3605c0e70d213f22aac8a53.asciidoc
new file mode 100644
index 000000000..8164e0fb0
--- /dev/null
+++ b/docs/examples/c765ce78f3605c0e70d213f22aac8a53.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/apis/put-autoscaling-policy.asciidoc:67
+
+[source, python]
+----
+resp = client.autoscaling.put_autoscaling_policy(
+ name="my_autoscaling_policy",
+ policy={
+ "roles": [
+ "data_hot"
+ ],
+ "deciders": {
+ "fixed": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c76cb6a080959b0d87afd780cf814be2.asciidoc b/docs/examples/c76cb6a080959b0d87afd780cf814be2.asciidoc
new file mode 100644
index 000000000..459c00328
--- /dev/null
+++ b/docs/examples/c76cb6a080959b0d87afd780cf814be2.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/match-bool-prefix-query.asciidoc:28
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "bool": {
+ "should": [
+ {
+ "term": {
+ "message": "quick"
+ }
+ },
+ {
+ "term": {
+ "message": "brown"
+ }
+ },
+ {
+ "prefix": {
+ "message": "f"
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c79b284fa7a5d7421c6daae62bc697f9.asciidoc b/docs/examples/c79b284fa7a5d7421c6daae62bc697f9.asciidoc
new file mode 100644
index 000000000..35bdfc0d8
--- /dev/null
+++ b/docs/examples/c79b284fa7a5d7421c6daae62bc697f9.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/uni-directional-disaster-recovery.asciidoc:163
+
+[source, python]
+----
+resp = client.indices.delete(
+ index="kibana_sample_data_ecommerce",
+)
+print(resp)
+----
diff --git a/docs/examples/c79e8ee86b332302b25c5c1f5f4f89d7.asciidoc b/docs/examples/c79e8ee86b332302b25c5c1f5f4f89d7.asciidoc
new file mode 100644
index 000000000..0cdd32cfd
--- /dev/null
+++ b/docs/examples/c79e8ee86b332302b25c5c1f5f4f89d7.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/document-level-security.asciidoc:67
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="dept_role",
+ indices=[
+ {
+ "names": [
+ "*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "query": {
+ "term": {
+ "department_id": 12
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/c8210f23c10d0642f24c1e43faa4deda.asciidoc b/docs/examples/c8210f23c10d0642f24c1e43faa4deda.asciidoc
new file mode 100644
index 000000000..b03672085
--- /dev/null
+++ b/docs/examples/c8210f23c10d0642f24c1e43faa4deda.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-a-data-stream.asciidoc:144
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="my-mappings",
+ template={
+ "mappings": {
+ "properties": {
+ "@timestamp": {
+ "type": "date",
+ "format": "date_optional_time||epoch_millis"
+ },
+ "message": {
+ "type": "wildcard"
+ }
+ }
+ }
+ },
+ meta={
+ "description": "Mappings for @timestamp and message fields",
+ "my-custom-meta-field": "More arbitrary metadata"
+ },
+)
+print(resp)
+
+resp1 = client.cluster.put_component_template(
+ name="my-settings",
+ template={
+ "settings": {
+ "index.lifecycle.name": "my-lifecycle-policy"
+ }
+ },
+ meta={
+ "description": "Settings for ILM",
+ "my-custom-meta-field": "More arbitrary metadata"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/c87038b96ab06d9a741a130f94de4f02.asciidoc b/docs/examples/c87038b96ab06d9a741a130f94de4f02.asciidoc
index e0fd70333..aae4b0770 100644
--- a/docs/examples/c87038b96ab06d9a741a130f94de4f02.asciidoc
+++ b/docs/examples/c87038b96ab06d9a741a130f94de4f02.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete.asciidoc:138
[source, python]
@@ -8,4 +9,4 @@ resp = client.delete(
timeout="5m",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c873f9cd093e26515148f052e28c7805.asciidoc b/docs/examples/c873f9cd093e26515148f052e28c7805.asciidoc
new file mode 100644
index 000000000..3c8efb1f1
--- /dev/null
+++ b/docs/examples/c873f9cd093e26515148f052e28c7805.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-snapshot.asciidoc:242
+
+[source, python]
+----
+resp = client.ml.get_model_snapshots(
+ job_id="high_sum_total_sales",
+ start="1575402236000",
+)
+print(resp)
+----
diff --git a/docs/examples/c8bbf362f06a0d8dab33ec0d99743343.asciidoc b/docs/examples/c8bbf362f06a0d8dab33ec0d99743343.asciidoc
new file mode 100644
index 000000000..fd0538dcd
--- /dev/null
+++ b/docs/examples/c8bbf362f06a0d8dab33ec0d99743343.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/classic-tokenfilter.asciidoc:21
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="classic",
+ filter=[
+ "classic"
+ ],
+ text="The 2 Q.U.I.C.K. Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp)
+----
diff --git a/docs/examples/c8e2109b19d50467ab83a40006462e9f.asciidoc b/docs/examples/c8e2109b19d50467ab83a40006462e9f.asciidoc
new file mode 100644
index 000000000..3a0678550
--- /dev/null
+++ b/docs/examples/c8e2109b19d50467ab83a40006462e9f.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/enrich/execute-enrich-policy.asciidoc:39
+
+[source, python]
+----
+resp = client.enrich.execute_policy(
+ name="my-policy",
+ wait_for_completion=False,
+)
+print(resp)
+----
diff --git a/docs/examples/c92b761c18d8e1c3df75c04a21503e16.asciidoc b/docs/examples/c92b761c18d8e1c3df75c04a21503e16.asciidoc
new file mode 100644
index 000000000..516335984
--- /dev/null
+++ b/docs/examples/c92b761c18d8e1c3df75c04a21503e16.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:360
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="logs-my_app-settings",
+ template={
+ "settings": {
+ "index.default_pipeline": "logs-my_app-default",
+ "index.lifecycle.name": "logs"
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.put_index_template(
+ name="logs-my_app-template",
+ index_patterns=[
+ "logs-my_app-*"
+ ],
+ data_stream={},
+ priority=500,
+ composed_of=[
+ "logs-my_app-settings",
+ "logs-my_app-mappings"
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/c9373ff5ed6b026173428fbb92ca2d9f.asciidoc b/docs/examples/c9373ff5ed6b026173428fbb92ca2d9f.asciidoc
new file mode 100644
index 000000000..8f1d14d52
--- /dev/null
+++ b/docs/examples/c9373ff5ed6b026173428fbb92ca2d9f.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-reindex.asciidoc:31
+
+[source, python]
+----
+resp = client.reindex(
+ wait_for_completion=False,
+ source={
+ "index": "test-data",
+ "size": 50
+ },
+ dest={
+ "index": "elser-embeddings",
+ "pipeline": "elser_embeddings"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c956bf1f0829a5f0357c0494ed8b6ca3.asciidoc b/docs/examples/c956bf1f0829a5f0357c0494ed8b6ca3.asciidoc
new file mode 100644
index 000000000..24b3619a6
--- /dev/null
+++ b/docs/examples/c956bf1f0829a5f0357c0494ed8b6ca3.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-template-api.asciidoc:37
+
+[source, python]
+----
+resp = client.search_template(
+ index="my-index",
+ id="my-search-template",
+ params={
+ "query_string": "hello world",
+ "from": 0,
+ "size": 10
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c95d5317525c2ff625e6971c277247af.asciidoc b/docs/examples/c95d5317525c2ff625e6971c277247af.asciidoc
new file mode 100644
index 000000000..cadd25e0f
--- /dev/null
+++ b/docs/examples/c95d5317525c2ff625e6971c277247af.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/keyword-tokenizer.asciidoc:61
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="keyword",
+ filter=[
+ "lowercase"
+ ],
+ text="john.SMITH@example.COM",
+)
+print(resp)
+----
diff --git a/docs/examples/c96669604d0e66a097ddf3093b025ccd.asciidoc b/docs/examples/c96669604d0e66a097ddf3093b025ccd.asciidoc
new file mode 100644
index 000000000..f88b069a9
--- /dev/null
+++ b/docs/examples/c96669604d0e66a097ddf3093b025ccd.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations.asciidoc:126
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ size=0,
+ aggs={
+ "my-agg-name": {
+ "terms": {
+ "field": "my-field"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c96e5740b79f703c5b77e3ddc9fdf3a0.asciidoc b/docs/examples/c96e5740b79f703c5b77e3ddc9fdf3a0.asciidoc
new file mode 100644
index 000000000..cf0c7231e
--- /dev/null
+++ b/docs/examples/c96e5740b79f703c5b77e3ddc9fdf3a0.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-a-data-stream.asciidoc:210
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="my-index-template",
+ index_patterns=[
+ "my-data-stream*"
+ ],
+ data_stream={},
+ composed_of=[
+ "my-mappings",
+ "my-settings"
+ ],
+ priority=500,
+ meta={
+ "description": "Template for my time series data",
+ "my-custom-meta-field": "More arbitrary metadata"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c97fd95ebdcf56cc973582e37f732ed2.asciidoc b/docs/examples/c97fd95ebdcf56cc973582e37f732ed2.asciidoc
new file mode 100644
index 000000000..75fc57939
--- /dev/null
+++ b/docs/examples/c97fd95ebdcf56cc973582e37f732ed2.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/enrich/get-enrich-policy.asciidoc:176
+
+[source, python]
+----
+resp = client.enrich.get_policy()
+print(resp)
+----
diff --git a/docs/examples/c9a6ab0a56bb0177f158277185f68302.asciidoc b/docs/examples/c9a6ab0a56bb0177f158277185f68302.asciidoc
new file mode 100644
index 000000000..71dadf77e
--- /dev/null
+++ b/docs/examples/c9a6ab0a56bb0177f158277185f68302.asciidoc
@@ -0,0 +1,58 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/subobjects.asciidoc:20
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "metrics": {
+ "type": "object",
+ "subobjects": False,
+ "properties": {
+ "time": {
+ "type": "long"
+ },
+ "time.min": {
+ "type": "long"
+ },
+ "time.max": {
+ "type": "long"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="metric_1",
+ document={
+ "metrics.time": 100,
+ "metrics.time.min": 10,
+ "metrics.time.max": 900
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="my-index-000001",
+ id="metric_2",
+ document={
+ "metrics": {
+ "time": 100,
+ "time.min": 10,
+ "time.max": 900
+ }
+ },
+)
+print(resp2)
+
+resp3 = client.indices.get_mapping(
+ index="my-index-000001",
+)
+print(resp3)
+----
diff --git a/docs/examples/c9afa715021f2e6450e72ac73271960c.asciidoc b/docs/examples/c9afa715021f2e6450e72ac73271960c.asciidoc
new file mode 100644
index 000000000..e718dc9e1
--- /dev/null
+++ b/docs/examples/c9afa715021f2e6450e72ac73271960c.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/parent-aggregation.asciidoc:39
+
+[source, python]
+----
+resp = client.index(
+ index="parent_example",
+ id="1",
+ document={
+ "join": {
+ "name": "question"
+ },
+ "body": "I have Windows 2003 server and i bought a new Windows 2008 server...",
+ "title": "Whats the best way to file transfer my site from server to a newer one?",
+ "tags": [
+ "windows-server-2003",
+ "windows-server-2008",
+ "file-transfer"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/c9b6cbe93c8bd23e3f658c3af4e70092.asciidoc b/docs/examples/c9b6cbe93c8bd23e3f658c3af4e70092.asciidoc
new file mode 100644
index 000000000..39c14bd61
--- /dev/null
+++ b/docs/examples/c9b6cbe93c8bd23e3f658c3af4e70092.asciidoc
@@ -0,0 +1,71 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/edgengram-tokenizer.asciidoc:264
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "autocomplete": {
+ "tokenizer": "autocomplete",
+ "filter": [
+ "lowercase"
+ ]
+ },
+ "autocomplete_search": {
+ "tokenizer": "lowercase"
+ }
+ },
+ "tokenizer": {
+ "autocomplete": {
+ "type": "edge_ngram",
+ "min_gram": 2,
+ "max_gram": 10,
+ "token_chars": [
+ "letter"
+ ]
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "title": {
+ "type": "text",
+ "analyzer": "autocomplete",
+ "search_analyzer": "autocomplete_search"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "title": "Quick Foxes"
+ },
+)
+print(resp1)
+
+resp2 = client.indices.refresh(
+ index="my-index-000001",
+)
+print(resp2)
+
+resp3 = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "title": {
+ "query": "Quick Fo",
+ "operator": "and"
+ }
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/c9c396b94bb88098477e2b08b55a12ee.asciidoc b/docs/examples/c9c396b94bb88098477e2b08b55a12ee.asciidoc
index f205a86e4..0bfaabd41 100644
--- a/docs/examples/c9c396b94bb88098477e2b08b55a12ee.asciidoc
+++ b/docs/examples/c9c396b94bb88098477e2b08b55a12ee.asciidoc
@@ -1,42 +1,54 @@
+// This file is autogenerated, DO NOT EDIT
// docs/bulk.asciidoc:764
[source, python]
----
resp = client.indices.create(
index="my-index",
- body={
- "mappings": {
- "dynamic_templates": [
- {"geo_point": {"mapping": {"type": "geo_point"}}}
- ]
- }
+ mappings={
+ "dynamic_templates": [
+ {
+ "geo_point": {
+ "mapping": {
+ "type": "geo_point"
+ }
+ }
+ }
+ ]
},
)
print(resp)
-resp = client.bulk(
- body=[
+resp1 = client.bulk(
+ operations=[
{
"index": {
"_index": "my_index",
"_id": "1",
- "dynamic_templates": {"work_location": "geo_point"},
+ "dynamic_templates": {
+ "work_location": "geo_point"
+ }
}
},
{
"field": "value1",
"work_location": "41.12,-71.34",
- "raw_location": "41.12,-71.34",
+ "raw_location": "41.12,-71.34"
},
{
"create": {
"_index": "my_index",
"_id": "2",
- "dynamic_templates": {"home_location": "geo_point"},
+ "dynamic_templates": {
+ "home_location": "geo_point"
+ }
}
},
- {"field": "value2", "home_location": "41.12,-71.34"},
+ {
+ "field": "value2",
+ "home_location": "41.12,-71.34"
+ }
],
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/c9ce07a7d3d8a317f08535bdd3aa69a3.asciidoc b/docs/examples/c9ce07a7d3d8a317f08535bdd3aa69a3.asciidoc
index c2ef22100..3716ae2e5 100644
--- a/docs/examples/c9ce07a7d3d8a317f08535bdd3aa69a3.asciidoc
+++ b/docs/examples/c9ce07a7d3d8a317f08535bdd3aa69a3.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:218
[source, python]
@@ -5,13 +6,13 @@
resp = client.update(
index="test",
id="1",
- body={
- "script": {
- "source": "if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'noop' }",
- "lang": "painless",
- "params": {"tag": "green"},
+ script={
+ "source": "if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'noop' }",
+ "lang": "painless",
+ "params": {
+ "tag": "green"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/c9d9a1d751f20f6197c825cb4378fe9f.asciidoc b/docs/examples/c9d9a1d751f20f6197c825cb4378fe9f.asciidoc
index 97b1c40a4..b976f3a2d 100644
--- a/docs/examples/c9d9a1d751f20f6197c825cb4378fe9f.asciidoc
+++ b/docs/examples/c9d9a1d751f20f6197c825cb4378fe9f.asciidoc
@@ -1,11 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/terms-query.asciidoc:21
[source, python]
----
resp = client.search(
- body={
- "query": {"terms": {"user.id": ["kimchy", "elkbee"], "boost": 1}}
+ query={
+ "terms": {
+ "user.id": [
+ "kimchy",
+ "elkbee"
+ ],
+ "boost": 1
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ca06db2aa4747910278f96315f7be94b.asciidoc b/docs/examples/ca06db2aa4747910278f96315f7be94b.asciidoc
new file mode 100644
index 000000000..9ff944dba
--- /dev/null
+++ b/docs/examples/ca06db2aa4747910278f96315f7be94b.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-bounding-box-query.asciidoc:356
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_bounding_box": {
+ "pin.location": {
+ "top": 40.73,
+ "left": -74.1,
+ "bottom": 40.01,
+ "right": -71.12
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ca08e511e5907d258081b10a1a9f0072.asciidoc b/docs/examples/ca08e511e5907d258081b10a1a9f0072.asciidoc
new file mode 100644
index 000000000..f5886e964
--- /dev/null
+++ b/docs/examples/ca08e511e5907d258081b10a1a9f0072.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:454
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="new-data-stream-template",
+ index_patterns=[
+ "new-data-stream*"
+ ],
+ data_stream={},
+ priority=500,
+ template={
+ "mappings": {
+ "properties": {
+ "@timestamp": {
+ "type": "date_nanos"
+ }
+ }
+ },
+ "settings": {
+ "sort.field": [
+ "@timestamp"
+ ],
+ "sort.order": [
+ "desc"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ca1cc4bcef22fdf9153833bfe6a55294.asciidoc b/docs/examples/ca1cc4bcef22fdf9153833bfe6a55294.asciidoc
new file mode 100644
index 000000000..b6f956f0f
--- /dev/null
+++ b/docs/examples/ca1cc4bcef22fdf9153833bfe6a55294.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:367
+
+[source, python]
+----
+resp = client.bulk(
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_index": ".ds-my-data-stream-2099.03.08-000003",
+ "_id": "bfspvnIBr7VVZlfp2lqX",
+ "if_seq_no": 0,
+ "if_primary_term": 1
+ }
+ },
+ {
+ "@timestamp": "2099-03-08T11:06:07.000Z",
+ "user": {
+ "id": "8a4f500d"
+ },
+ "message": "Login successful"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/ca3bcd6278510ebced5f74484033cb36.asciidoc b/docs/examples/ca3bcd6278510ebced5f74484033cb36.asciidoc
new file mode 100644
index 000000000..b28f8a28a
--- /dev/null
+++ b/docs/examples/ca3bcd6278510ebced5f74484033cb36.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/apis/get-script-languages-api.asciidoc:11
+
+[source, python]
+----
+resp = client.get_script_languages()
+print(resp)
+----
diff --git a/docs/examples/ca5ae0eb7709f3807bc6239cd4bd9141.asciidoc b/docs/examples/ca5ae0eb7709f3807bc6239cd4bd9141.asciidoc
new file mode 100644
index 000000000..d9c529956
--- /dev/null
+++ b/docs/examples/ca5ae0eb7709f3807bc6239cd4bd9141.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:240
+
+[source, python]
+----
+resp = client.security.get_api_key()
+print(resp)
+----
diff --git a/docs/examples/ca5dda98e977125d40a7fe1e178e213f.asciidoc b/docs/examples/ca5dda98e977125d40a7fe1e178e213f.asciidoc
new file mode 100644
index 000000000..2d19bb671
--- /dev/null
+++ b/docs/examples/ca5dda98e977125d40a7fe1e178e213f.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/sparse-vector-query.asciidoc:129
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "sparse_vector": {
+ "field": "ml.tokens",
+ "inference_id": "my-elser-model",
+ "query": "How is the weather in Jamaica?"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ca98afbd6a90f63e02f62239d225313b.asciidoc b/docs/examples/ca98afbd6a90f63e02f62239d225313b.asciidoc
new file mode 100644
index 000000000..44fc24e51
--- /dev/null
+++ b/docs/examples/ca98afbd6a90f63e02f62239d225313b.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/dangling-index-import.asciidoc:59
+
+[source, python]
+----
+resp = client.dangling_indices.import_dangling_index(
+ index_uuid="zmM4e0JtBkeUjiHD-MihPQ",
+ accept_data_loss=True,
+)
+print(resp)
+----
diff --git a/docs/examples/caaafef1a76c2bec677704c2dc233218.asciidoc b/docs/examples/caaafef1a76c2bec677704c2dc233218.asciidoc
new file mode 100644
index 000000000..79cb3d0fa
--- /dev/null
+++ b/docs/examples/caaafef1a76c2bec677704c2dc233218.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/simulate-index.asciidoc:33
+
+[source, python]
+----
+resp = client.indices.simulate_index_template(
+ name="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/caab99520d3fe41f6154d74a7f696057.asciidoc b/docs/examples/caab99520d3fe41f6154d74a7f696057.asciidoc
index a790b85fd..5ee574efc 100644
--- a/docs/examples/caab99520d3fe41f6154d74a7f696057.asciidoc
+++ b/docs/examples/caab99520d3fe41f6154d74a7f696057.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// indices/delete-index.asciidoc:10
[source, python]
@@ -6,4 +7,4 @@ resp = client.indices.delete(
index="my-index-000001",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cac74a85c6b352a6e23d8673abae126f.asciidoc b/docs/examples/cac74a85c6b352a6e23d8673abae126f.asciidoc
new file mode 100644
index 000000000..fd2e370ec
--- /dev/null
+++ b/docs/examples/cac74a85c6b352a6e23d8673abae126f.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/frequent-item-sets-aggregation.asciidoc:257
+
+[source, python]
+----
+resp = client.async_search.submit(
+ index="kibana_sample_data_ecommerce",
+ size=0,
+ aggs={
+ "my_agg": {
+ "frequent_item_sets": {
+ "minimum_set_size": 3,
+ "fields": [
+ {
+ "field": "category.keyword"
+ },
+ {
+ "field": "geoip.city_name"
+ }
+ ],
+ "size": 3,
+ "filter": {
+ "term": {
+ "geoip.continent_name": "Europe"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cafed0e2c2b1d1574eb4a5ecd514a97a.asciidoc b/docs/examples/cafed0e2c2b1d1574eb4a5ecd514a97a.asciidoc
new file mode 100644
index 000000000..ca255c59b
--- /dev/null
+++ b/docs/examples/cafed0e2c2b1d1574eb4a5ecd514a97a.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/split-index.asciidoc:10
+
+[source, python]
+----
+resp = client.indices.split(
+ index="my-index-000001",
+ target="split-my-index-000001",
+ settings={
+ "index.number_of_shards": 2
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cb0c3223fd45148497df73adfba2e9ce.asciidoc b/docs/examples/cb0c3223fd45148497df73adfba2e9ce.asciidoc
index 07509c129..96a7054cf 100644
--- a/docs/examples/cb0c3223fd45148497df73adfba2e9ce.asciidoc
+++ b/docs/examples/cb0c3223fd45148497df73adfba2e9ce.asciidoc
@@ -1,15 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:668
[source, python]
----
resp = client.reindex(
- body={
- "source": {
- "index": "my-index-000001",
- "query": {"term": {"user.id": "kimchy"}},
- },
- "dest": {"index": "my-new-index-000001"},
+ source={
+ "index": "my-index-000001",
+ "query": {
+ "term": {
+ "user.id": "kimchy"
+ }
+ }
+ },
+ dest={
+ "index": "my-new-index-000001"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cb16f1ff85399ddaa418834be580c9de.asciidoc b/docs/examples/cb16f1ff85399ddaa418834be580c9de.asciidoc
new file mode 100644
index 000000000..947324a06
--- /dev/null
+++ b/docs/examples/cb16f1ff85399ddaa418834be580c9de.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:136
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="slm-admin",
+ cluster=[
+ "manage_slm",
+ "cluster:admin/snapshot/*"
+ ],
+ indices=[
+ {
+ "names": [
+ ".slm-history-*"
+ ],
+ "privileges": [
+ "all"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/cb1d2a787bbe88974cfc5f132556a51c.asciidoc b/docs/examples/cb1d2a787bbe88974cfc5f132556a51c.asciidoc
new file mode 100644
index 000000000..29f7390f2
--- /dev/null
+++ b/docs/examples/cb1d2a787bbe88974cfc5f132556a51c.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:421
+
+[source, python]
+----
+resp = client.indices.delete_data_stream(
+ name="*",
+ expand_wildcards="all",
+)
+print(resp)
+----
diff --git a/docs/examples/cb2f70601cb004b9ece9b0b43a9dc21a.asciidoc b/docs/examples/cb2f70601cb004b9ece9b0b43a9dc21a.asciidoc
index 208221877..881808964 100644
--- a/docs/examples/cb2f70601cb004b9ece9b0b43a9dc21a.asciidoc
+++ b/docs/examples/cb2f70601cb004b9ece9b0b43a9dc21a.asciidoc
@@ -1,10 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
// modules/indices/request_cache.asciidoc:47
[source, python]
----
resp = client.indices.clear_cache(
- index=["my-index-000001", "my-index-000002"],
- request="true",
+ index="my-index-000001,my-index-000002",
+ request=True,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cb3c483816b6ea150ff6c559fa144d32.asciidoc b/docs/examples/cb3c483816b6ea150ff6c559fa144d32.asciidoc
new file mode 100644
index 000000000..2a6c0681f
--- /dev/null
+++ b/docs/examples/cb3c483816b6ea150ff6c559fa144d32.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/ilm-tutorial.asciidoc:75
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="timeseries_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_primary_shard_size": "50GB",
+ "max_age": "30d"
+ }
+ }
+ },
+ "delete": {
+ "min_age": "90d",
+ "actions": {
+ "delete": {}
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cb4388b72d41c431ec9ca8255b2f65fb.asciidoc b/docs/examples/cb4388b72d41c431ec9ca8255b2f65fb.asciidoc
new file mode 100644
index 000000000..56a49f770
--- /dev/null
+++ b/docs/examples/cb4388b72d41c431ec9ca8255b2f65fb.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/shape-query.asciidoc:27
+
+[source, python]
+----
+resp = client.indices.create(
+ index="example",
+ mappings={
+ "properties": {
+ "geometry": {
+ "type": "shape"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="example",
+ id="1",
+ refresh="wait_for",
+ document={
+ "name": "Lucky Landing",
+ "geometry": {
+ "type": "point",
+ "coordinates": [
+ 1355.400544,
+ 5255.530286
+ ]
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/cb71332115c92cfb89375abd30b8bbbb.asciidoc b/docs/examples/cb71332115c92cfb89375abd30b8bbbb.asciidoc
new file mode 100644
index 000000000..1070f618e
--- /dev/null
+++ b/docs/examples/cb71332115c92cfb89375abd30b8bbbb.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat.asciidoc:36
+
+[source, python]
+----
+resp = client.cat.master(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/cb71c6ecfb8b19725c374572444e5d32.asciidoc b/docs/examples/cb71c6ecfb8b19725c374572444e5d32.asciidoc
index d835a6603..5c2213fc5 100644
--- a/docs/examples/cb71c6ecfb8b19725c374572444e5d32.asciidoc
+++ b/docs/examples/cb71c6ecfb8b19725c374572444e5d32.asciidoc
@@ -1,15 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:366
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "aggs": {
- "avg_start": {"avg": {"field": "measures.start"}},
- "avg_end": {"avg": {"field": "measures.end"}},
+ aggs={
+ "avg_start": {
+ "avg": {
+ "field": "measures.start"
+ }
+ },
+ "avg_end": {
+ "avg": {
+ "field": "measures.end"
+ }
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cba3462a307e2483c14e3e198f6960e3.asciidoc b/docs/examples/cba3462a307e2483c14e3e198f6960e3.asciidoc
new file mode 100644
index 000000000..d135a1805
--- /dev/null
+++ b/docs/examples/cba3462a307e2483c14e3e198f6960e3.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/apis/put-lifecycle.asciidoc:60
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "_meta": {
+ "description": "used for nginx log",
+ "project": {
+ "name": "myProject",
+ "department": "myDepartment"
+ }
+ },
+ "phases": {
+ "warm": {
+ "min_age": "10d",
+ "actions": {
+ "forcemerge": {
+ "max_num_segments": 1
+ }
+ }
+ },
+ "delete": {
+ "min_age": "30d",
+ "actions": {
+ "delete": {}
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cbc2b5595890f87165aab1a741b1d22c.asciidoc b/docs/examples/cbc2b5595890f87165aab1a741b1d22c.asciidoc
new file mode 100644
index 000000000..df4168d99
--- /dev/null
+++ b/docs/examples/cbc2b5595890f87165aab1a741b1d22c.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/downsampling-manual.asciidoc:224
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-timestamp-pipeline",
+ description="Shifts the @timestamp to the last 15 minutes",
+ processors=[
+ {
+ "set": {
+ "field": "ingest_time",
+ "value": "{{_ingest.timestamp}}"
+ }
+ },
+ {
+ "script": {
+ "lang": "painless",
+ "source": "\n def delta = ChronoUnit.SECONDS.between(\n ZonedDateTime.parse(\"2022-06-21T15:49:00Z\"),\n ZonedDateTime.parse(ctx[\"ingest_time\"])\n );\n ctx[\"@timestamp\"] = ZonedDateTime.parse(ctx[\"@timestamp\"]).plus(delta,ChronoUnit.SECONDS).toString();\n "
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/cbfd6f23f8283e64ec3157c65bb722c4.asciidoc b/docs/examples/cbfd6f23f8283e64ec3157c65bb722c4.asciidoc
new file mode 100644
index 000000000..b962ea061
--- /dev/null
+++ b/docs/examples/cbfd6f23f8283e64ec3157c65bb722c4.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat.asciidoc:212
+
+[source, python]
+----
+resp = client.cat.templates(
+ v=True,
+ s="order:desc,index_patterns",
+)
+print(resp)
+----
diff --git a/docs/examples/cc0cca5556ec6224c7134c233734beed.asciidoc b/docs/examples/cc0cca5556ec6224c7134c233734beed.asciidoc
index 51d084ee1..1b5a77d31 100644
--- a/docs/examples/cc0cca5556ec6224c7134c233734beed.asciidoc
+++ b/docs/examples/cc0cca5556ec6224c7134c233734beed.asciidoc
@@ -1,7 +1,8 @@
-// modules/cluster/remote-clusters-migration.asciidoc:165
+// This file is autogenerated, DO NOT EDIT
+// ccr/getting-started.asciidoc:132
[source, python]
----
resp = client.cluster.remote_info()
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cc28a3dafcd5056f2a3ec07f6fda5091.asciidoc b/docs/examples/cc28a3dafcd5056f2a3ec07f6fda5091.asciidoc
index 59a62f1b6..46ea8456b 100644
--- a/docs/examples/cc28a3dafcd5056f2a3ec07f6fda5091.asciidoc
+++ b/docs/examples/cc28a3dafcd5056f2a3ec07f6fda5091.asciidoc
@@ -1,20 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:287
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "runtime_mappings": {
- "day_of_week": {
- "type": "keyword",
- "script": {
- "source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
- },
+ runtime_mappings={
+ "day_of_week": {
+ "type": "keyword",
+ "script": {
+ "source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
}
- },
- "aggs": {"day_of_week": {"terms": {"field": "day_of_week"}}},
+ }
+ },
+ aggs={
+ "day_of_week": {
+ "terms": {
+ "field": "day_of_week"
+ }
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cc56be758d5d75febbd975786187c861.asciidoc b/docs/examples/cc56be758d5d75febbd975786187c861.asciidoc
new file mode 100644
index 000000000..3af0ff287
--- /dev/null
+++ b/docs/examples/cc56be758d5d75febbd975786187c861.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-service-token.asciidoc:97
+
+[source, python]
+----
+resp = client.security.create_service_token(
+ namespace="elastic",
+ service="fleet-server",
+)
+print(resp)
+----
diff --git a/docs/examples/cc5eefcc2102aae7e87b0c87b4af10b8.asciidoc b/docs/examples/cc5eefcc2102aae7e87b0c87b4af10b8.asciidoc
new file mode 100644
index 000000000..d9b7e66b8
--- /dev/null
+++ b/docs/examples/cc5eefcc2102aae7e87b0c87b4af10b8.asciidoc
@@ -0,0 +1,51 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/multivalued-fields.asciidoc:50
+
+[source, python]
+----
+resp = client.indices.create(
+ index="mv",
+ mappings={
+ "properties": {
+ "b": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="mv",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "a": 1,
+ "b": [
+ "foo",
+ "foo",
+ "bar"
+ ]
+ },
+ {
+ "index": {}
+ },
+ {
+ "a": 2,
+ "b": [
+ "bar",
+ "bar"
+ ]
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.esql.query(
+ query="FROM mv | LIMIT 2",
+)
+print(resp2)
+----
diff --git a/docs/examples/cc7f1c74ede6810e2c9db19256d6b653.asciidoc b/docs/examples/cc7f1c74ede6810e2c9db19256d6b653.asciidoc
new file mode 100644
index 000000000..a2b91b331
--- /dev/null
+++ b/docs/examples/cc7f1c74ede6810e2c9db19256d6b653.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/common-script-uses.asciidoc:193
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "match": {
+ "http.response": "304"
+ }
+ },
+ fields=[
+ "http.response"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/cc90639f2e65bd89cb73296cac6135cf.asciidoc b/docs/examples/cc90639f2e65bd89cb73296cac6135cf.asciidoc
index f8c8da8cd..58814beee 100644
--- a/docs/examples/cc90639f2e65bd89cb73296cac6135cf.asciidoc
+++ b/docs/examples/cc90639f2e65bd89cb73296cac6135cf.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/delete-trained-models.asciidoc:54
[source, python]
@@ -6,4 +7,4 @@ resp = client.ml.delete_trained_model(
model_id="regression-job-one-1574775307356",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cc9dac8db7a1482e2fbe3235197c3de1.asciidoc b/docs/examples/cc9dac8db7a1482e2fbe3235197c3de1.asciidoc
new file mode 100644
index 000000000..6ea9a977e
--- /dev/null
+++ b/docs/examples/cc9dac8db7a1482e2fbe3235197c3de1.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/restore-snapshot-api.asciidoc:242
+
+[source, python]
+----
+resp = client.snapshot.restore(
+ repository="my_repository",
+ snapshot="snapshot_2",
+ wait_for_completion=True,
+ indices="index_1,index_2",
+ ignore_unavailable=True,
+ include_global_state=False,
+ rename_pattern="index_(.+)",
+ rename_replacement="restored_index_$1",
+ include_aliases=False,
+)
+print(resp)
+----
diff --git a/docs/examples/ccec66fb20d5ede6c691e0890cfe402a.asciidoc b/docs/examples/ccec66fb20d5ede6c691e0890cfe402a.asciidoc
new file mode 100644
index 000000000..1dc1475d9
--- /dev/null
+++ b/docs/examples/ccec66fb20d5ede6c691e0890cfe402a.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/delete-job.asciidoc:85
+
+[source, python]
+----
+resp = client.ml.delete_job(
+ job_id="total-requests",
+ wait_for_completion=False,
+)
+print(resp)
+----
diff --git a/docs/examples/ccf84c1e5e5602a9e841cb8f7e3bb29f.asciidoc b/docs/examples/ccf84c1e5e5602a9e841cb8f7e3bb29f.asciidoc
new file mode 100644
index 000000000..005efc123
--- /dev/null
+++ b/docs/examples/ccf84c1e5e5602a9e841cb8f7e3bb29f.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/standard-analyzer.asciidoc:284
+
+[source, python]
+----
+resp = client.indices.create(
+ index="standard_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "rebuilt_standard": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cd16538654e0f834ff19fe6cf329c398.asciidoc b/docs/examples/cd16538654e0f834ff19fe6cf329c398.asciidoc
new file mode 100644
index 000000000..2d5a460fa
--- /dev/null
+++ b/docs/examples/cd16538654e0f834ff19fe6cf329c398.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-mapping.asciidoc:65
+
+[source, python]
+----
+resp = client.indices.create(
+ index="hugging-face-embeddings",
+ mappings={
+ "properties": {
+ "content_embedding": {
+ "type": "dense_vector",
+ "dims": 768,
+ "element_type": "float"
+ },
+ "content": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cd373a6eb1ef4748616500b26fab3006.asciidoc b/docs/examples/cd373a6eb1ef4748616500b26fab3006.asciidoc
new file mode 100644
index 000000000..4c58be4f3
--- /dev/null
+++ b/docs/examples/cd373a6eb1ef4748616500b26fab3006.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// search/async-search.asciidoc:15
+
+[source, python]
+----
+resp = client.async_search.submit(
+ index="sales*",
+ size="0",
+ sort=[
+ {
+ "date": {
+ "order": "asc"
+ }
+ }
+ ],
+ aggs={
+ "sale_date": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1d"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cd38c601ab293a6ec0e2df71d0c96b58.asciidoc b/docs/examples/cd38c601ab293a6ec0e2df71d0c96b58.asciidoc
new file mode 100644
index 000000000..4f4c3fcf1
--- /dev/null
+++ b/docs/examples/cd38c601ab293a6ec0e2df71d0c96b58.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template.asciidoc:344
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="template_with_2_shards",
+ template={
+ "settings": {
+ "index.number_of_shards": 2
+ }
+ },
+)
+print(resp)
+
+resp1 = client.cluster.put_component_template(
+ name="template_with_3_shards",
+ template={
+ "settings": {
+ "index.number_of_shards": 3
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.indices.put_index_template(
+ name="template_1",
+ index_patterns=[
+ "t*"
+ ],
+ composed_of=[
+ "template_with_2_shards",
+ "template_with_3_shards"
+ ],
+)
+print(resp2)
+----
diff --git a/docs/examples/cd67ad2c09fafef2d441c3502d0bb3d7.asciidoc b/docs/examples/cd67ad2c09fafef2d441c3502d0bb3d7.asciidoc
new file mode 100644
index 000000000..fc5ff0439
--- /dev/null
+++ b/docs/examples/cd67ad2c09fafef2d441c3502d0bb3d7.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/apis/put-lifecycle.asciidoc:78
+
+[source, python]
+----
+resp = client.indices.put_data_lifecycle(
+ name="my-data-stream",
+ data_retention="7d",
+)
+print(resp)
+----
diff --git a/docs/examples/cd6eee201a233b989ac1f2794fa6d640.asciidoc b/docs/examples/cd6eee201a233b989ac1f2794fa6d640.asciidoc
new file mode 100644
index 000000000..602e5f253
--- /dev/null
+++ b/docs/examples/cd6eee201a233b989ac1f2794fa6d640.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1107
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ filter_path="-hits.events._source",
+ runtime_mappings={
+ "day_of_week": {
+ "type": "keyword",
+ "script": "emit(doc['@timestamp'].value.dayOfWeekEnum.toString())"
+ }
+ },
+ query="\n process where process.name == \"regsvr32.exe\"\n ",
+ fields=[
+ "@timestamp",
+ "day_of_week"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/cd6fa7f63c93bb04824acd3a7d1f8de3.asciidoc b/docs/examples/cd6fa7f63c93bb04824acd3a7d1f8de3.asciidoc
new file mode 100644
index 000000000..11c63f65b
--- /dev/null
+++ b/docs/examples/cd6fa7f63c93bb04824acd3a7d1f8de3.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-not-query.asciidoc:13
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_not": {
+ "include": {
+ "span_term": {
+ "field1": "hoya"
+ }
+ },
+ "exclude": {
+ "span_near": {
+ "clauses": [
+ {
+ "span_term": {
+ "field1": "la"
+ }
+ },
+ {
+ "span_term": {
+ "field1": "hoya"
+ }
+ }
+ ],
+ "slop": 0,
+ "in_order": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cd7da0c3769682f546cc1888e569382e.asciidoc b/docs/examples/cd7da0c3769682f546cc1888e569382e.asciidoc
new file mode 100644
index 000000000..b117cb26f
--- /dev/null
+++ b/docs/examples/cd7da0c3769682f546cc1888e569382e.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:764
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "match_phrase": {
+ "message": "number 1"
+ }
+ },
+ highlight={
+ "fields": {
+ "message": {
+ "type": "plain",
+ "fragment_size": 15,
+ "number_of_fragments": 3,
+ "fragmenter": "span"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cd8006165ac64f1ef99af48e5a35a25b.asciidoc b/docs/examples/cd8006165ac64f1ef99af48e5a35a25b.asciidoc
new file mode 100644
index 000000000..75d163ad4
--- /dev/null
+++ b/docs/examples/cd8006165ac64f1ef99af48e5a35a25b.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-app-privileges.asciidoc:58
+
+[source, python]
+----
+resp = client.security.get_privileges(
+ application="myapp",
+ name="read",
+)
+print(resp)
+----
diff --git a/docs/examples/cd93919e13f656ad2e6629f45c579b93.asciidoc b/docs/examples/cd93919e13f656ad2e6629f45c579b93.asciidoc
new file mode 100644
index 000000000..c922da32f
--- /dev/null
+++ b/docs/examples/cd93919e13f656ad2e6629f45c579b93.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/shard-stores.asciidoc:114
+
+[source, python]
+----
+resp = client.indices.shard_stores(
+ index="test",
+)
+print(resp)
+----
diff --git a/docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc b/docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc
index be77e9072..e3e4189d0 100644
--- a/docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc
+++ b/docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc
@@ -1,11 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/term-query.asciidoc:170
[source, python]
----
resp = client.search(
index="my-index-000001",
- pretty="true",
- body={"query": {"match": {"full_text": "Quick Brown Foxes!"}}},
+ pretty=True,
+ query={
+ "match": {
+ "full_text": "Quick Brown Foxes!"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cdb68b3f565df7c85e52a55864b37d40.asciidoc b/docs/examples/cdb68b3f565df7c85e52a55864b37d40.asciidoc
index b811f6e7b..3009eb74b 100644
--- a/docs/examples/cdb68b3f565df7c85e52a55864b37d40.asciidoc
+++ b/docs/examples/cdb68b3f565df7c85e52a55864b37d40.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:358
[source, python]
----
resp = client.indices.create(
index="my-new-index-000001",
- body={"mappings": {"properties": {"user_id": {"type": "keyword"}}}},
+ mappings={
+ "properties": {
+ "user_id": {
+ "type": "keyword"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cdc04e6d3d37f036c7045ee4a582ef06.asciidoc b/docs/examples/cdc04e6d3d37f036c7045ee4a582ef06.asciidoc
index b2842633a..5d54bde0d 100644
--- a/docs/examples/cdc04e6d3d37f036c7045ee4a582ef06.asciidoc
+++ b/docs/examples/cdc04e6d3d37f036c7045ee4a582ef06.asciidoc
@@ -1,30 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:610
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "strings_as_keywords": {
- "match_mapping_type": "string",
- "mapping": {
- "type": "text",
- "norms": False,
- "fields": {
- "keyword": {
- "type": "keyword",
- "ignore_above": 256,
- }
- },
- },
+ mappings={
+ "dynamic_templates": [
+ {
+ "strings_as_keywords": {
+ "match_mapping_type": "string",
+ "mapping": {
+ "type": "text",
+ "norms": False,
+ "fields": {
+ "keyword": {
+ "type": "keyword",
+ "ignore_above": 256
+ }
+ }
}
}
- ]
- }
+ }
+ ]
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cdc38c98320a0df705ec8d173c725375.asciidoc b/docs/examples/cdc38c98320a0df705ec8d173c725375.asciidoc
new file mode 100644
index 000000000..049e06ee6
--- /dev/null
+++ b/docs/examples/cdc38c98320a0df705ec8d173c725375.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-grid-query.asciidoc:287
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ size=0,
+ aggs={
+ "grouped": {
+ "geohex_grid": {
+ "field": "location",
+ "precision": 1
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cdce7bc083dfb36e6f1d465a5c9d5049.asciidoc b/docs/examples/cdce7bc083dfb36e6f1d465a5c9d5049.asciidoc
new file mode 100644
index 000000000..710a66fea
--- /dev/null
+++ b/docs/examples/cdce7bc083dfb36e6f1d465a5c9d5049.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/list-connector-sync-jobs-api.asciidoc:49
+
+[source, python]
+----
+resp = client.perform_request(
+ "GET",
+ "/_connector/_sync_job",
+)
+print(resp)
+----
diff --git a/docs/examples/cdd29b01e730b3996de68a2788050021.asciidoc b/docs/examples/cdd29b01e730b3996de68a2788050021.asciidoc
new file mode 100644
index 000000000..0e2c7e21c
--- /dev/null
+++ b/docs/examples/cdd29b01e730b3996de68a2788050021.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/enrich/delete-enrich-policy.asciidoc:36
+
+[source, python]
+----
+resp = client.enrich.delete_policy(
+ name="my-policy",
+)
+print(resp)
+----
diff --git a/docs/examples/cdd7127681254f4d614cc075f9e6fbcf.asciidoc b/docs/examples/cdd7127681254f4d614cc075f9e6fbcf.asciidoc
index 94d17542f..164ea547c 100644
--- a/docs/examples/cdd7127681254f4d614cc075f9e6fbcf.asciidoc
+++ b/docs/examples/cdd7127681254f4d614cc075f9e6fbcf.asciidoc
@@ -1,10 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:427
[source, python]
----
resp = client.delete_by_query(
index="my-index-000001",
- body={"query": {"term": {"user.id": "kimchy"}}, "max_docs": 1},
+ query={
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
+ max_docs=1,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cde19d110a58317610033ea3dcb0eb80.asciidoc b/docs/examples/cde19d110a58317610033ea3dcb0eb80.asciidoc
new file mode 100644
index 000000000..5ec34b398
--- /dev/null
+++ b/docs/examples/cde19d110a58317610033ea3dcb0eb80.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:737
+
+[source, python]
+----
+resp = client.render_search_template(
+ source="\n {\n \"query\": {\n \"match\": {\n {{#query_message}}\n {{#query_string}}\n \"message\": \"Hello {{#first_name_section}}{{first_name}}{{/first_name_section}} {{#last_name_section}}{{last_name}}{{/last_name_section}}\"\n {{/query_string}}\n {{/query_message}}\n }\n }\n }\n ",
+ params={
+ "query_message": {
+ "query_string": {
+ "first_name_section": {
+ "first_name": "John"
+ },
+ "last_name_section": {
+ "last_name": "kimchy"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cde4104a29dfe942d55863cdd8718627.asciidoc b/docs/examples/cde4104a29dfe942d55863cdd8718627.asciidoc
new file mode 100644
index 000000000..839bb42dd
--- /dev/null
+++ b/docs/examples/cde4104a29dfe942d55863cdd8718627.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// slm/apis/slm-get-status.asciidoc:42
+
+[source, python]
+----
+resp = client.slm.get_status()
+print(resp)
+----
diff --git a/docs/examples/cdf400299acd1c7b1b7bb42e284e3d08.asciidoc b/docs/examples/cdf400299acd1c7b1b7bb42e284e3d08.asciidoc
index 6d3e7c961..a7e4c711d 100644
--- a/docs/examples/cdf400299acd1c7b1b7bb42e284e3d08.asciidoc
+++ b/docs/examples/cdf400299acd1c7b1b7bb42e284e3d08.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:135
[source, python]
@@ -5,13 +6,13 @@
resp = client.update(
index="test",
id="1",
- body={
- "script": {
- "source": "ctx._source.tags.add(params.tag)",
- "lang": "painless",
- "params": {"tag": "blue"},
+ script={
+ "source": "ctx._source.tags.add(params.tag)",
+ "lang": "painless",
+ "params": {
+ "tag": "blue"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cdfd4fef983c1c0fe8d7417f67d01eae.asciidoc b/docs/examples/cdfd4fef983c1c0fe8d7417f67d01eae.asciidoc
new file mode 100644
index 000000000..d61b8b76f
--- /dev/null
+++ b/docs/examples/cdfd4fef983c1c0fe8d7417f67d01eae.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:153
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ settings={
+ "index.number_of_replicas": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ce0a1aba713b0448b0c6a504af7b3a08.asciidoc b/docs/examples/ce0a1aba713b0448b0c6a504af7b3a08.asciidoc
new file mode 100644
index 000000000..365f0bc40
--- /dev/null
+++ b/docs/examples/ce0a1aba713b0448b0c6a504af7b3a08.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:339
+
+[source, python]
+----
+resp = client.slm.get_stats()
+print(resp)
+----
diff --git a/docs/examples/ce0c3d7330727f7673cf68fc9a1cfb86.asciidoc b/docs/examples/ce0c3d7330727f7673cf68fc9a1cfb86.asciidoc
new file mode 100644
index 000000000..c0642da1f
--- /dev/null
+++ b/docs/examples/ce0c3d7330727f7673cf68fc9a1cfb86.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/clearcache.asciidoc:11
+
+[source, python]
+----
+resp = client.indices.clear_cache(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc b/docs/examples/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc
new file mode 100644
index 000000000..bb8f5780c
--- /dev/null
+++ b/docs/examples/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/create-connector-api.asciidoc:111
+
+[source, python]
+----
+resp = client.connector.put(
+ connector_id="my-connector",
+ index_name="search-google-drive",
+ name="My Connector",
+ description="My Connector to sync data to Elastic index from Google Drive",
+ service_type="google_drive",
+ language="english",
+)
+print(resp)
+----
diff --git a/docs/examples/ce247fc08371e1b30cb52195e521c076.asciidoc b/docs/examples/ce247fc08371e1b30cb52195e521c076.asciidoc
new file mode 100644
index 000000000..22047fd1b
--- /dev/null
+++ b/docs/examples/ce247fc08371e1b30cb52195e521c076.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-bounding-box-query.asciidoc:219
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_bounding_box": {
+ "pin.location": {
+ "top_left": [
+ -74.1,
+ 40.73
+ ],
+ "bottom_right": [
+ -71.12,
+ 40.01
+ ]
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ce2c2e8f5a2e4daf051b6e10122e5aae.asciidoc b/docs/examples/ce2c2e8f5a2e4daf051b6e10122e5aae.asciidoc
deleted file mode 100644
index c6efa3aa3..000000000
--- a/docs/examples/ce2c2e8f5a2e4daf051b6e10122e5aae.asciidoc
+++ /dev/null
@@ -1,18 +0,0 @@
-// mapping/types/dense-vector.asciidoc:490
-
-[source, python]
-----
-resp = client.indices.put_mapping(
- index="my-index-000001",
- body={
- "properties": {
- "text_embedding": {
- "type": "dense_vector",
- "dims": 384,
- "index_options": {"type": "int4_hnsw"},
- }
- }
- },
-)
-print(resp)
-----
\ No newline at end of file
diff --git a/docs/examples/ce3c391c2b1915cfc44a2917bca71d19.asciidoc b/docs/examples/ce3c391c2b1915cfc44a2917bca71d19.asciidoc
new file mode 100644
index 000000000..b1166bc60
--- /dev/null
+++ b/docs/examples/ce3c391c2b1915cfc44a2917bca71d19.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/put-dfanalytics.asciidoc:644
+
+[source, python]
+----
+resp = client.ml.put_data_frame_analytics(
+ id="loganalytics",
+ description="Outlier detection on log data",
+ source={
+ "index": "logdata"
+ },
+ dest={
+ "index": "logdata_out"
+ },
+ analysis={
+ "outlier_detection": {
+ "compute_feature_influence": True,
+ "outlier_fraction": 0.05,
+ "standardization_enabled": True
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ce725697f93b3eebb3a266314568565a.asciidoc b/docs/examples/ce725697f93b3eebb3a266314568565a.asciidoc
new file mode 100644
index 000000000..ace3ea0e6
--- /dev/null
+++ b/docs/examples/ce725697f93b3eebb3a266314568565a.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/fingerprint-analyzer.asciidoc:159
+
+[source, python]
+----
+resp = client.indices.create(
+ index="fingerprint_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "rebuilt_fingerprint": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "asciifolding",
+ "fingerprint"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ce8471d31e5d60309e142feb040fd2f8.asciidoc b/docs/examples/ce8471d31e5d60309e142feb040fd2f8.asciidoc
new file mode 100644
index 000000000..99b1f9058
--- /dev/null
+++ b/docs/examples/ce8471d31e5d60309e142feb040fd2f8.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/query-watches.asciidoc:67
+
+[source, python]
+----
+resp = client.watcher.query_watches()
+print(resp)
+----
diff --git a/docs/examples/ce899fcf55da72fc32e623d1ad88b301.asciidoc b/docs/examples/ce899fcf55da72fc32e623d1ad88b301.asciidoc
new file mode 100644
index 000000000..e5c311612
--- /dev/null
+++ b/docs/examples/ce899fcf55da72fc32e623d1ad88b301.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/ignore-missing-component-templates.asciidoc:72
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="logs-foo_component2",
+ template={
+ "mappings": {
+ "properties": {
+ "host.ip": {
+ "type": "ip"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ce8eebfb810335803630abe83278bee7.asciidoc b/docs/examples/ce8eebfb810335803630abe83278bee7.asciidoc
new file mode 100644
index 000000000..7ca152642
--- /dev/null
+++ b/docs/examples/ce8eebfb810335803630abe83278bee7.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:247
+
+[source, python]
+----
+resp = client.security.get_api_key(
+ active_only=True,
+)
+print(resp)
+----
diff --git a/docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc b/docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc
new file mode 100644
index 000000000..5f65dc494
--- /dev/null
+++ b/docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-elser.asciidoc:73
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="sparse_embedding",
+ inference_id="my-elser-model",
+ inference_config={
+ "service": "elser",
+ "service_settings": {
+ "num_allocations": 1,
+ "num_threads": 1
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cee491dd0a8d10ed0cb11a2faa0c99f0.asciidoc b/docs/examples/cee491dd0a8d10ed0cb11a2faa0c99f0.asciidoc
index 785bf070d..c500aef2f 100644
--- a/docs/examples/cee491dd0a8d10ed0cb11a2faa0c99f0.asciidoc
+++ b/docs/examples/cee491dd0a8d10ed0cb11a2faa0c99f0.asciidoc
@@ -1,19 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/infer-trained-model.asciidoc:1078
[source, python]
----
resp = client.ml.infer_trained_model(
model_id="model2",
- body={
- "docs": [
- {
- "text_field": "The Amazon rainforest covers most of the Amazon basin in South America"
+ docs=[
+ {
+ "text_field": "The Amazon rainforest covers most of the Amazon basin in South America"
+ }
+ ],
+ inference_config={
+ "ner": {
+ "tokenization": {
+ "bert": {
+ "truncate": "first"
+ }
}
- ],
- "inference_config": {
- "ner": {"tokenization": {"bert": {"truncate": "first"}}}
- },
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/cee591c1fc70d4f180c623a3a6d07755.asciidoc b/docs/examples/cee591c1fc70d4f180c623a3a6d07755.asciidoc
new file mode 100644
index 000000000..5b7dabd86
--- /dev/null
+++ b/docs/examples/cee591c1fc70d4f180c623a3a6d07755.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-tokens.asciidoc:72
+
+[source, python]
+----
+resp = client.security.get_token(
+ grant_type="client_credentials",
+)
+print(resp)
+----
diff --git a/docs/examples/cf23f18761df33f08bc6f6d1875496fd.asciidoc b/docs/examples/cf23f18761df33f08bc6f6d1875496fd.asciidoc
new file mode 100644
index 000000000..559350421
--- /dev/null
+++ b/docs/examples/cf23f18761df33f08bc6f6d1875496fd.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/size-your-shards.asciidoc:397
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my-index-000001",
+ settings={
+ "index": {
+ "routing.allocation.total_shards_per_node": 5
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cf47cd4a39cd62a3ecad919e54a67bca.asciidoc b/docs/examples/cf47cd4a39cd62a3ecad919e54a67bca.asciidoc
new file mode 100644
index 000000000..c4bd84e31
--- /dev/null
+++ b/docs/examples/cf47cd4a39cd62a3ecad919e54a67bca.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/ignored-field.asciidoc:36
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "term": {
+ "_ignored": "@timestamp"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cf5dab4334783ca9b8942eab68fb7174.asciidoc b/docs/examples/cf5dab4334783ca9b8942eab68fb7174.asciidoc
new file mode 100644
index 000000000..6bb5b6621
--- /dev/null
+++ b/docs/examples/cf5dab4334783ca9b8942eab68fb7174.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/nested-aggregation.asciidoc:114
+
+[source, python]
+----
+resp = client.search(
+ index="products",
+ size="0",
+ query={
+ "match": {
+ "name": "led tv"
+ }
+ },
+ aggs={
+ "resellers": {
+ "nested": {
+ "path": "resellers"
+ },
+ "aggs": {
+ "filter_reseller": {
+ "filter": {
+ "bool": {
+ "filter": [
+ {
+ "term": {
+ "resellers.reseller": "companyB"
+ }
+ }
+ ]
+ }
+ },
+ "aggs": {
+ "min_price": {
+ "min": {
+ "field": "resellers.price"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cf75a880c749a2f2010a8ec3f348e5c3.asciidoc b/docs/examples/cf75a880c749a2f2010a8ec3f348e5c3.asciidoc
new file mode 100644
index 000000000..b8e9ad445
--- /dev/null
+++ b/docs/examples/cf75a880c749a2f2010a8ec3f348e5c3.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1391
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ keep_on_completion=True,
+ wait_for_completion_timeout="2s",
+ query="\n process where process.name == \"cmd.exe\"\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/cf8ca470156698dbf47fdc822d0a714f.asciidoc b/docs/examples/cf8ca470156698dbf47fdc822d0a714f.asciidoc
new file mode 100644
index 000000000..1210a1941
--- /dev/null
+++ b/docs/examples/cf8ca470156698dbf47fdc822d0a714f.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/get-desired-nodes.asciidoc:64
+
+[source, python]
+----
+resp = client.perform_request(
+ "GET",
+ "/_internal/desired_nodes/_latest",
+)
+print(resp)
+----
diff --git a/docs/examples/cf9f51d719a2e90ffe36ed6fe56a4a69.asciidoc b/docs/examples/cf9f51d719a2e90ffe36ed6fe56a4a69.asciidoc
new file mode 100644
index 000000000..b255f59ea
--- /dev/null
+++ b/docs/examples/cf9f51d719a2e90ffe36ed6fe56a4a69.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/remote-clusters-privileges-cert.asciidoc:83
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="remote-replication",
+ cluster=[
+ "manage_ccr"
+ ],
+ indices=[
+ {
+ "names": [
+ "follower-index-name"
+ ],
+ "privileges": [
+ "monitor",
+ "read",
+ "write",
+ "manage_follow_index"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/cfad3631be0634ee49c424f9ccec62d9.asciidoc b/docs/examples/cfad3631be0634ee49c424f9ccec62d9.asciidoc
new file mode 100644
index 000000000..dba931e60
--- /dev/null
+++ b/docs/examples/cfad3631be0634ee49c424f9ccec62d9.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-api-keys.asciidoc:168
+
+[source, python]
+----
+resp = client.security.invalidate_api_key(
+ owner=True,
+)
+print(resp)
+----
diff --git a/docs/examples/cfd4b34f35e531a20739a3b308d57134.asciidoc b/docs/examples/cfd4b34f35e531a20739a3b308d57134.asciidoc
new file mode 100644
index 000000000..6845b4d8e
--- /dev/null
+++ b/docs/examples/cfd4b34f35e531a20739a3b308d57134.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-rollover.asciidoc:199
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_docs": 100000000
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/cffce059425d3d21e7f9571500d63524.asciidoc b/docs/examples/cffce059425d3d21e7f9571500d63524.asciidoc
new file mode 100644
index 000000000..8f33f2bdc
--- /dev/null
+++ b/docs/examples/cffce059425d3d21e7f9571500d63524.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/delete-roles.asciidoc:40
+
+[source, python]
+----
+resp = client.security.delete_role(
+ name="my_admin_role",
+)
+print(resp)
+----
diff --git a/docs/examples/d003ee256d24aa6000bd9dbf1d608dc5.asciidoc b/docs/examples/d003ee256d24aa6000bd9dbf1d608dc5.asciidoc
new file mode 100644
index 000000000..b9840ef11
--- /dev/null
+++ b/docs/examples/d003ee256d24aa6000bd9dbf1d608dc5.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-elser.asciidoc:78
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="elser-v2-test",
+ processors=[
+ {
+ "inference": {
+ "model_id": ".elser_model_2",
+ "input_output": [
+ {
+ "input_field": "content",
+ "output_field": "content_embedding"
+ }
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d003f9110e5a474230abe11f36da9297.asciidoc b/docs/examples/d003f9110e5a474230abe11f36da9297.asciidoc
new file mode 100644
index 000000000..dc2540244
--- /dev/null
+++ b/docs/examples/d003f9110e5a474230abe11f36da9297.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/redact.asciidoc:49
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "description": "Hide my IP",
+ "processors": [
+ {
+ "redact": {
+ "field": "message",
+ "patterns": [
+ "%{IP:client}"
+ ]
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_source": {
+ "message": "55.3.244.1 GET /index.html 15824 0.043"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d01a590fa9ea8a0cb34ed8dda502296c.asciidoc b/docs/examples/d01a590fa9ea8a0cb34ed8dda502296c.asciidoc
new file mode 100644
index 000000000..2aa1436ea
--- /dev/null
+++ b/docs/examples/d01a590fa9ea8a0cb34ed8dda502296c.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// migration/transient-settings-migration-guide.asciidoc:38
+
+[source, python]
+----
+resp = client.cluster.get_settings(
+ flat_settings=True,
+ filter_path="transient",
+)
+print(resp)
+----
diff --git a/docs/examples/d01d309b0257d6fbca6d0941adeb3256.asciidoc b/docs/examples/d01d309b0257d6fbca6d0941adeb3256.asciidoc
new file mode 100644
index 000000000..971c4b3e6
--- /dev/null
+++ b/docs/examples/d01d309b0257d6fbca6d0941adeb3256.asciidoc
@@ -0,0 +1,50 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/simulate-index.asciidoc:145
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="ct1",
+ template={
+ "settings": {
+ "index.number_of_shards": 2
+ }
+ },
+)
+print(resp)
+
+resp1 = client.cluster.put_component_template(
+ name="ct2",
+ template={
+ "settings": {
+ "index.number_of_replicas": 0
+ },
+ "mappings": {
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ }
+ }
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.indices.put_index_template(
+ name="final-template",
+ index_patterns=[
+ "my-index-*"
+ ],
+ composed_of=[
+ "ct1",
+ "ct2"
+ ],
+ priority=5,
+)
+print(resp2)
+
+resp3 = client.indices.simulate_index_template(
+ name="my-index-000001",
+)
+print(resp3)
+----
diff --git a/docs/examples/d03139a851888db53f8b7affd85eb495.asciidoc b/docs/examples/d03139a851888db53f8b7affd85eb495.asciidoc
new file mode 100644
index 000000000..15826f686
--- /dev/null
+++ b/docs/examples/d03139a851888db53f8b7affd85eb495.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/check-in-connector-api.asciidoc:68
+
+[source, python]
+----
+resp = client.connector.check_in(
+ connector_id="my-connector",
+)
+print(resp)
+----
diff --git a/docs/examples/d0378fe5e3aad05a2fd2e6e81213374f.asciidoc b/docs/examples/d0378fe5e3aad05a2fd2e6e81213374f.asciidoc
new file mode 100644
index 000000000..472ca8a75
--- /dev/null
+++ b/docs/examples/d0378fe5e3aad05a2fd2e6e81213374f.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:331
+
+[source, python]
+----
+resp = client.indices.create(
+ index="bulgarian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "bulgarian_stop": {
+ "type": "stop",
+ "stopwords": "_bulgarian_"
+ },
+ "bulgarian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "пример"
+ ]
+ },
+ "bulgarian_stemmer": {
+ "type": "stemmer",
+ "language": "bulgarian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_bulgarian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "bulgarian_stop",
+ "bulgarian_keywords",
+ "bulgarian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d03b0e2f0f3f5ac8d53287c445007a89.asciidoc b/docs/examples/d03b0e2f0f3f5ac8d53287c445007a89.asciidoc
new file mode 100644
index 000000000..b442b817c
--- /dev/null
+++ b/docs/examples/d03b0e2f0f3f5ac8d53287c445007a89.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/similarity.asciidoc:32
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "default_field": {
+ "type": "text"
+ },
+ "boolean_sim_field": {
+ "type": "text",
+ "similarity": "boolean"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc b/docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc
new file mode 100644
index 000000000..442757e57
--- /dev/null
+++ b/docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc
@@ -0,0 +1,66 @@
+// This file is autogenerated, DO NOT EDIT
+// quickstart/getting-started.asciidoc:103
+
+[source, python]
+----
+resp = client.bulk(
+ operations=[
+ {
+ "index": {
+ "_index": "books"
+ }
+ },
+ {
+ "name": "Revelation Space",
+ "author": "Alastair Reynolds",
+ "release_date": "2000-03-15",
+ "page_count": 585
+ },
+ {
+ "index": {
+ "_index": "books"
+ }
+ },
+ {
+ "name": "1984",
+ "author": "George Orwell",
+ "release_date": "1985-06-01",
+ "page_count": 328
+ },
+ {
+ "index": {
+ "_index": "books"
+ }
+ },
+ {
+ "name": "Fahrenheit 451",
+ "author": "Ray Bradbury",
+ "release_date": "1953-10-15",
+ "page_count": 227
+ },
+ {
+ "index": {
+ "_index": "books"
+ }
+ },
+ {
+ "name": "Brave New World",
+ "author": "Aldous Huxley",
+ "release_date": "1932-06-01",
+ "page_count": 268
+ },
+ {
+ "index": {
+ "_index": "books"
+ }
+ },
+ {
+ "name": "The Handmaids Tale",
+ "author": "Margaret Atwood",
+ "release_date": "1985-06-01",
+ "page_count": 311
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d050c6fa7d806457a5f32d30b07e9521.asciidoc b/docs/examples/d050c6fa7d806457a5f32d30b07e9521.asciidoc
new file mode 100644
index 000000000..6ba667a84
--- /dev/null
+++ b/docs/examples/d050c6fa7d806457a5f32d30b07e9521.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:504
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "dot_expander": {
+ "description": "Expand 'my-object-field.my-property'",
+ "field": "my-object-field.my-property"
+ }
+ },
+ {
+ "set": {
+ "description": "Set 'my-object-field.my-property' to 10",
+ "field": "my-object-field.my-property",
+ "value": 10
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d0546f047359b85a7e98207dc8de896a.asciidoc b/docs/examples/d0546f047359b85a7e98207dc8de896a.asciidoc
new file mode 100644
index 000000000..340ec3f54
--- /dev/null
+++ b/docs/examples/d0546f047359b85a7e98207dc8de896a.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/coerce.asciidoc:60
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "index.mapping.coerce": False
+ },
+ mappings={
+ "properties": {
+ "number_one": {
+ "type": "integer",
+ "coerce": True
+ },
+ "number_two": {
+ "type": "integer"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "number_one": "10"
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="my-index-000001",
+ id="2",
+ document={
+ "number_two": "10"
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/d05b2a37106fce0ebbd41e2fd6bd26c2.asciidoc b/docs/examples/d05b2a37106fce0ebbd41e2fd6bd26c2.asciidoc
new file mode 100644
index 000000000..af8f272f6
--- /dev/null
+++ b/docs/examples/d05b2a37106fce0ebbd41e2fd6bd26c2.asciidoc
@@ -0,0 +1,83 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/min-aggregation.asciidoc:126
+
+[source, python]
+----
+resp = client.indices.create(
+ index="metrics_index",
+ mappings={
+ "properties": {
+ "latency_histo": {
+ "type": "histogram"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="metrics_index",
+ id="1",
+ refresh=True,
+ document={
+ "network.name": "net-1",
+ "latency_histo": {
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 3,
+ 7,
+ 23,
+ 12,
+ 6
+ ]
+ }
+ },
+)
+print(resp1)
+
+resp2 = client.index(
+ index="metrics_index",
+ id="2",
+ refresh=True,
+ document={
+ "network.name": "net-2",
+ "latency_histo": {
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 8,
+ 17,
+ 8,
+ 7,
+ 6
+ ]
+ }
+ },
+)
+print(resp2)
+
+resp3 = client.search(
+ index="metrics_index",
+ size="0",
+ filter_path="aggregations",
+ aggs={
+ "min_latency": {
+ "min": {
+ "field": "latency_histo"
+ }
+ }
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/d06a649bc38aa9a6433b64efa78d8cb5.asciidoc b/docs/examples/d06a649bc38aa9a6433b64efa78d8cb5.asciidoc
new file mode 100644
index 000000000..e40299bdd
--- /dev/null
+++ b/docs/examples/d06a649bc38aa9a6433b64efa78d8cb5.asciidoc
@@ -0,0 +1,62 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/common-script-uses.asciidoc:52
+
+[source, python]
+----
+resp = client.bulk(
+ index="my-index",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:30:17-05:00",
+ "message": "40.135.0.0 - - [30/Apr/2020:14:30:17 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:30:53-05:00",
+ "message": "232.0.0.0 - - [30/Apr/2020:14:30:53 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:31:12-05:00",
+ "message": "26.1.0.0 - - [30/Apr/2020:14:31:12 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:31:19-05:00",
+ "message": "247.37.0.0 - - [30/Apr/2020:14:31:19 -0500] \"GET /french/splash_inet.html HTTP/1.0\" 200 3781"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:31:22-05:00",
+ "message": "247.37.0.0 - - [30/Apr/2020:14:31:22 -0500] \"GET /images/hm_nbg.jpg HTTP/1.0\" 304 0"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:31:27-05:00",
+ "message": "252.0.0.0 - - [30/Apr/2020:14:31:27 -0500] \"GET /images/hm_bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "index": {}
+ },
+ {
+ "timestamp": "2020-04-30T14:31:28-05:00",
+ "message": "not a valid apache log"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d095b422d9803c02b62c01adffc85376.asciidoc b/docs/examples/d095b422d9803c02b62c01adffc85376.asciidoc
new file mode 100644
index 000000000..c56dbd0a0
--- /dev/null
+++ b/docs/examples/d095b422d9803c02b62c01adffc85376.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/get-job.asciidoc:88
+
+[source, python]
+----
+resp = client.rollup.get_jobs(
+ id="sensor",
+)
+print(resp)
+----
diff --git a/docs/examples/d0dee031197214b59ff9ac7540527d2c.asciidoc b/docs/examples/d0dee031197214b59ff9ac7540527d2c.asciidoc
new file mode 100644
index 000000000..de9ce5d5c
--- /dev/null
+++ b/docs/examples/d0dee031197214b59ff9ac7540527d2c.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/movfn-aggregation.asciidoc:43
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "the_movfn": {
+ "moving_fn": {
+ "buckets_path": "the_sum",
+ "window": 10,
+ "script": "MovingFunctions.unweightedAvg(values)"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d0fad375f6e074e9067ed93d3faa07bd.asciidoc b/docs/examples/d0fad375f6e074e9067ed93d3faa07bd.asciidoc
new file mode 100644
index 000000000..3e0d8e103
--- /dev/null
+++ b/docs/examples/d0fad375f6e074e9067ed93d3faa07bd.asciidoc
@@ -0,0 +1,103 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/cartesian-bounds-aggregation.asciidoc:12
+
+[source, python]
+----
+resp = client.indices.create(
+ index="museums",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "point"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="museums",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "location": "POINT (491.2350 5237.4081)",
+ "city": "Amsterdam",
+ "name": "NEMO Science Museum"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "location": "POINT (490.1618 5236.9219)",
+ "city": "Amsterdam",
+ "name": "Museum Het Rembrandthuis"
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "location": "POINT (491.4722 5237.1667)",
+ "city": "Amsterdam",
+ "name": "Nederlands Scheepvaartmuseum"
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "location": "POINT (440.5200 5122.2900)",
+ "city": "Antwerp",
+ "name": "Letterenhuis"
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "location": "POINT (233.6389 4886.1111)",
+ "city": "Paris",
+ "name": "Musée du Louvre"
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "location": "POINT (232.7000 4886.0000)",
+ "city": "Paris",
+ "name": "Musée d'Orsay"
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="museums",
+ size="0",
+ query={
+ "match": {
+ "name": "musée"
+ }
+ },
+ aggs={
+ "viewport": {
+ "cartesian_bounds": {
+ "field": "location"
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/d0fde00ef381e61b8a9e99f18cb5970a.asciidoc b/docs/examples/d0fde00ef381e61b8a9e99f18cb5970a.asciidoc
new file mode 100644
index 000000000..bfbfbdf58
--- /dev/null
+++ b/docs/examples/d0fde00ef381e61b8a9e99f18cb5970a.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/simple-query-string-query.asciidoc:181
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "simple_query_string": {
+ "query": "foo | bar + baz*",
+ "flags": "OR|AND|PREFIX"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d11ea753a5d86f7e630fd69a069948b1.asciidoc b/docs/examples/d11ea753a5d86f7e630fd69a069948b1.asciidoc
new file mode 100644
index 000000000..6e303dcf8
--- /dev/null
+++ b/docs/examples/d11ea753a5d86f7e630fd69a069948b1.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:168
+
+[source, python]
+----
+resp = client.sql.query(
+ format="json",
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=5,
+)
+print(resp)
+----
diff --git a/docs/examples/d1299b9ae1e621d2fdd0b8644c142ace.asciidoc b/docs/examples/d1299b9ae1e621d2fdd0b8644c142ace.asciidoc
new file mode 100644
index 000000000..8ae98b59c
--- /dev/null
+++ b/docs/examples/d1299b9ae1e621d2fdd0b8644c142ace.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/categorize-text-aggregation.asciidoc:334
+
+[source, python]
+----
+resp = client.search(
+ index="log-messages",
+ filter_path="aggregations",
+ aggs={
+ "daily": {
+ "date_histogram": {
+ "field": "time",
+ "fixed_interval": "1d"
+ },
+ "aggs": {
+ "categories": {
+ "categorize_text": {
+ "field": "message",
+ "categorization_filters": [
+ "\\w+\\_\\d{3}"
+ ]
+ },
+ "aggs": {
+ "hit": {
+ "top_hits": {
+ "size": 1,
+ "sort": [
+ "time"
+ ],
+ "_source": "message"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d12df43ffcdcd937bae9b26fb475e239.asciidoc b/docs/examples/d12df43ffcdcd937bae9b26fb475e239.asciidoc
new file mode 100644
index 000000000..f50c7f138
--- /dev/null
+++ b/docs/examples/d12df43ffcdcd937bae9b26fb475e239.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/uaxurlemail-tokenizer.asciidoc:14
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="uax_url_email",
+ text="Email me at john.smith@global-international.com",
+)
+print(resp)
+----
diff --git a/docs/examples/d133b5d82238f7d4778c341cbe0bc969.asciidoc b/docs/examples/d133b5d82238f7d4778c341cbe0bc969.asciidoc
new file mode 100644
index 000000000..5d821b207
--- /dev/null
+++ b/docs/examples/d133b5d82238f7d4778c341cbe0bc969.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/multi-termvectors.asciidoc:141
+
+[source, python]
+----
+resp = client.mtermvectors(
+ docs=[
+ {
+ "_index": "my-index-000001",
+ "doc": {
+ "message": "test test test"
+ }
+ },
+ {
+ "_index": "my-index-000001",
+ "doc": {
+ "message": "Another test ..."
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d13c7cdfc976e0c7b70737cd6a7becb8.asciidoc b/docs/examples/d13c7cdfc976e0c7b70737cd6a7becb8.asciidoc
new file mode 100644
index 000000000..ad1980427
--- /dev/null
+++ b/docs/examples/d13c7cdfc976e0c7b70737cd6a7becb8.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/rate-aggregation.asciidoc:411
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ runtime_mappings={
+ "price.adjusted": {
+ "type": "double",
+ "script": {
+ "source": "emit(doc['price'].value * params.adjustment)",
+ "params": {
+ "adjustment": 0.9
+ }
+ }
+ }
+ },
+ aggs={
+ "by_date": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "avg_price": {
+ "rate": {
+ "field": "price.adjusted"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d14fe5838fc02224f4b5ade2626d6026.asciidoc b/docs/examples/d14fe5838fc02224f4b5ade2626d6026.asciidoc
new file mode 100644
index 000000000..cb72ce548
--- /dev/null
+++ b/docs/examples/d14fe5838fc02224f4b5ade2626d6026.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/apis/explain.asciidoc:100
+
+[source, python]
+----
+resp = client.ilm.explain_lifecycle(
+ index="my-index-000001",
+ human=True,
+)
+print(resp)
+----
diff --git a/docs/examples/d1a285aa244ec461d68f13e7078a33c0.asciidoc b/docs/examples/d1a285aa244ec461d68f13e7078a33c0.asciidoc
new file mode 100644
index 000000000..ee97186fe
--- /dev/null
+++ b/docs/examples/d1a285aa244ec461d68f13e7078a33c0.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1407
+
+[source, python]
+----
+resp = client.indices.create(
+ index="persian_example",
+ settings={
+ "analysis": {
+ "char_filter": {
+ "zero_width_spaces": {
+ "type": "mapping",
+ "mappings": [
+ "\\u200C=>\\u0020"
+ ]
+ }
+ },
+ "filter": {
+ "persian_stop": {
+ "type": "stop",
+ "stopwords": "_persian_"
+ }
+ },
+ "analyzer": {
+ "rebuilt_persian": {
+ "tokenizer": "standard",
+ "char_filter": [
+ "zero_width_spaces"
+ ],
+ "filter": [
+ "lowercase",
+ "decimal_digit",
+ "arabic_normalization",
+ "persian_normalization",
+ "persian_stop"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d1b53bc9794e8609bd6f2245624bf977.asciidoc b/docs/examples/d1b53bc9794e8609bd6f2245624bf977.asciidoc
new file mode 100644
index 000000000..f7b027a88
--- /dev/null
+++ b/docs/examples/d1b53bc9794e8609bd6f2245624bf977.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/estimate-model-memory.asciidoc:54
+
+[source, python]
+----
+resp = client.ml.estimate_model_memory(
+ analysis_config={
+ "bucket_span": "5m",
+ "detectors": [
+ {
+ "function": "sum",
+ "field_name": "bytes",
+ "by_field_name": "status",
+ "partition_field_name": "app"
+ }
+ ],
+ "influencers": [
+ "source_ip",
+ "dest_ip"
+ ]
+ },
+ overall_cardinality={
+ "status": 10,
+ "app": 50
+ },
+ max_bucket_cardinality={
+ "source_ip": 300,
+ "dest_ip": 30
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d1ce66957f8bd84bf01c4bfaee3ba0c3.asciidoc b/docs/examples/d1ce66957f8bd84bf01c4bfaee3ba0c3.asciidoc
new file mode 100644
index 000000000..9e2de5d70
--- /dev/null
+++ b/docs/examples/d1ce66957f8bd84bf01c4bfaee3ba0c3.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:974
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ filter_path="hits.events._source.@timestamp,hits.events._source.process.pid",
+ query="\n process where process.name == \"regsvr32.exe\"\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/d1d8b6e642db1a7c70dbbf0fe6d8e92d.asciidoc b/docs/examples/d1d8b6e642db1a7c70dbbf0fe6d8e92d.asciidoc
new file mode 100644
index 000000000..22b7b5a16
--- /dev/null
+++ b/docs/examples/d1d8b6e642db1a7c70dbbf0fe6d8e92d.asciidoc
@@ -0,0 +1,55 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/sparse-vector-query.asciidoc:190
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ retriever={
+ "rrf": {
+ "retrievers": [
+ {
+ "standard": {
+ "query": {
+ "multi_match": {
+ "query": "How is the weather in Jamaica?",
+ "fields": [
+ "title",
+ "description"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "standard": {
+ "query": {
+ "sparse_vector": {
+ "field": "ml.inference.title_expanded.predicted_value",
+ "inference_id": "my-elser-model",
+ "query": "How is the weather in Jamaica?",
+ "boost": 1
+ }
+ }
+ }
+ },
+ {
+ "standard": {
+ "query": {
+ "sparse_vector": {
+ "field": "ml.inference.description_expanded.predicted_value",
+ "inference_id": "my-elser-model",
+ "query": "How is the weather in Jamaica?",
+ "boost": 1
+ }
+ }
+ }
+ }
+ ],
+ "window_size": 10,
+ "rank_constant": 20
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d1e0fee64389e7c8d4c092030626b61f.asciidoc b/docs/examples/d1e0fee64389e7c8d4c092030626b61f.asciidoc
new file mode 100644
index 000000000..f7602e3f4
--- /dev/null
+++ b/docs/examples/d1e0fee64389e7c8d4c092030626b61f.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:209
+
+[source, python]
+----
+resp = client.security.get_api_key(
+ name="my-*",
+)
+print(resp)
+----
diff --git a/docs/examples/d1ecce3632ae338b5e329b0e5ff3bed7.asciidoc b/docs/examples/d1ecce3632ae338b5e329b0e5ff3bed7.asciidoc
index df90393ec..512fdf02f 100644
--- a/docs/examples/d1ecce3632ae338b5e329b0e5ff3bed7.asciidoc
+++ b/docs/examples/d1ecce3632ae338b5e329b0e5ff3bed7.asciidoc
@@ -1,20 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/parent-join.asciidoc:382
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "my_join_field": {
- "type": "join",
- "relations": {"question": "answer"},
- "eager_global_ordinals": False,
- }
+ mappings={
+ "properties": {
+ "my_join_field": {
+ "type": "join",
+ "relations": {
+ "question": "answer"
+ },
+ "eager_global_ordinals": False
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d1fde25de1980b7e84fa878289fd0bcb.asciidoc b/docs/examples/d1fde25de1980b7e84fa878289fd0bcb.asciidoc
index eff030f5d..38483671b 100644
--- a/docs/examples/d1fde25de1980b7e84fa878289fd0bcb.asciidoc
+++ b/docs/examples/d1fde25de1980b7e84fa878289fd0bcb.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:654
[source, python]
@@ -9,4 +10,4 @@ resp = client.search(
filter_path="hits.total",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d23452f333b77bf5b463310e2a665560.asciidoc b/docs/examples/d23452f333b77bf5b463310e2a665560.asciidoc
new file mode 100644
index 000000000..f714f028f
--- /dev/null
+++ b/docs/examples/d23452f333b77bf5b463310e2a665560.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/run-as-privilege.asciidoc:51
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="my_director",
+ refresh=True,
+ cluster=[
+ "manage"
+ ],
+ indices=[
+ {
+ "names": [
+ "index1",
+ "index2"
+ ],
+ "privileges": [
+ "manage"
+ ]
+ }
+ ],
+ run_as=[
+ "jacknich",
+ "rdeniro"
+ ],
+ metadata={
+ "version": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d260225cf97e068ead2a8a6bb5aefd90.asciidoc b/docs/examples/d260225cf97e068ead2a8a6bb5aefd90.asciidoc
new file mode 100644
index 000000000..7aaf95c43
--- /dev/null
+++ b/docs/examples/d260225cf97e068ead2a8a6bb5aefd90.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1550
+
+[source, python]
+----
+resp = client.indices.create(
+ index="russian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "russian_stop": {
+ "type": "stop",
+ "stopwords": "_russian_"
+ },
+ "russian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "пример"
+ ]
+ },
+ "russian_stemmer": {
+ "type": "stemmer",
+ "language": "russian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_russian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "russian_stop",
+ "russian_keywords",
+ "russian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d268aec16bb1eb909b634e856175094c.asciidoc b/docs/examples/d268aec16bb1eb909b634e856175094c.asciidoc
new file mode 100644
index 000000000..a9c95b5c1
--- /dev/null
+++ b/docs/examples/d268aec16bb1eb909b634e856175094c.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/stop-analyzer.asciidoc:133
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_stop_analyzer": {
+ "type": "stop",
+ "stopwords": [
+ "the",
+ "over"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_stop_analyzer",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp1)
+----
diff --git a/docs/examples/d2f52c106685bd8eab47e11d644d7a70.asciidoc b/docs/examples/d2f52c106685bd8eab47e11d644d7a70.asciidoc
index ed8d1fed2..6611833ef 100644
--- a/docs/examples/d2f52c106685bd8eab47e11d644d7a70.asciidoc
+++ b/docs/examples/d2f52c106685bd8eab47e11d644d7a70.asciidoc
@@ -1,37 +1,52 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/date.asciidoc:41
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"date": {"type": "date"}}}},
+ mappings={
+ "properties": {
+ "date": {
+ "type": "date"
+ }
+ }
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"date": "2015-01-01"},
+ document={
+ "date": "2015-01-01"
+ },
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="my-index-000001",
id="2",
- body={"date": "2015-01-01T12:10:30Z"},
+ document={
+ "date": "2015-01-01T12:10:30Z"
+ },
)
-print(resp)
+print(resp2)
-resp = client.index(
+resp3 = client.index(
index="my-index-000001",
id="3",
- body={"date": 1420070400001},
+ document={
+ "date": 1420070400001
+ },
)
-print(resp)
+print(resp3)
-resp = client.search(
+resp4 = client.search(
index="my-index-000001",
- body={"sort": {"date": "asc"}},
+ sort={
+ "date": "asc"
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp4)
+----
diff --git a/docs/examples/d2f6040c058a9555dfa62bb42d896a8f.asciidoc b/docs/examples/d2f6040c058a9555dfa62bb42d896a8f.asciidoc
index f80b945aa..0d870f685 100644
--- a/docs/examples/d2f6040c058a9555dfa62bb42d896a8f.asciidoc
+++ b/docs/examples/d2f6040c058a9555dfa62bb42d896a8f.asciidoc
@@ -1,17 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:513
[source, python]
----
resp = client.search(
index="my_queries1",
- body={
- "query": {
- "percolate": {
- "field": "query",
- "document": {"my_field": "abcd"},
+ query={
+ "percolate": {
+ "field": "query",
+ "document": {
+ "my_field": "abcd"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d2f6fb271e97fde8685d7744e6718cc7.asciidoc b/docs/examples/d2f6fb271e97fde8685d7744e6718cc7.asciidoc
new file mode 100644
index 000000000..345a85822
--- /dev/null
+++ b/docs/examples/d2f6fb271e97fde8685d7744e6718cc7.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/delimited-payload-tokenfilter.asciidoc:234
+
+[source, python]
+----
+resp = client.index(
+ index="text_payloads",
+ id="1",
+ document={
+ "text": "the|0 brown|3 fox|4 is|0 quick|10"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d305110a8cabfbebd1e38d85559d1023.asciidoc b/docs/examples/d305110a8cabfbebd1e38d85559d1023.asciidoc
new file mode 100644
index 000000000..315430307
--- /dev/null
+++ b/docs/examples/d305110a8cabfbebd1e38d85559d1023.asciidoc
@@ -0,0 +1,67 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:436
+
+[source, python]
+----
+resp = client.indices.create(
+ index="cjk_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "english_stop": {
+ "type": "stop",
+ "stopwords": [
+ "a",
+ "and",
+ "are",
+ "as",
+ "at",
+ "be",
+ "but",
+ "by",
+ "for",
+ "if",
+ "in",
+ "into",
+ "is",
+ "it",
+ "no",
+ "not",
+ "of",
+ "on",
+ "or",
+ "s",
+ "such",
+ "t",
+ "that",
+ "the",
+ "their",
+ "then",
+ "there",
+ "these",
+ "they",
+ "this",
+ "to",
+ "was",
+ "will",
+ "with",
+ "www"
+ ]
+ }
+ },
+ "analyzer": {
+ "rebuilt_cjk": {
+ "tokenizer": "standard",
+ "filter": [
+ "cjk_width",
+ "lowercase",
+ "cjk_bigram",
+ "english_stop"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d3263afc69b6f969b9bbd8738cd07b97.asciidoc b/docs/examples/d3263afc69b6f969b9bbd8738cd07b97.asciidoc
new file mode 100644
index 000000000..d0717b7b6
--- /dev/null
+++ b/docs/examples/d3263afc69b6f969b9bbd8738cd07b97.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/post-pause-follow.asciidoc:67
+
+[source, python]
+----
+resp = client.ccr.pause_follow(
+ index="follower_index",
+)
+print(resp)
+----
diff --git a/docs/examples/d34946f59b6f938b141a37cb0b729308.asciidoc b/docs/examples/d34946f59b6f938b141a37cb0b729308.asciidoc
new file mode 100644
index 000000000..d0b5798ac
--- /dev/null
+++ b/docs/examples/d34946f59b6f938b141a37cb0b729308.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/geo-match-enrich-policy-type-ex.asciidoc:58
+
+[source, python]
+----
+resp = client.enrich.put_policy(
+ name="postal_policy",
+ geo_match={
+ "indices": "postal_codes",
+ "match_field": "location",
+ "enrich_fields": [
+ "location",
+ "postal_code"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d35a4d78a8b70c9e4d636efb0a92be9d.asciidoc b/docs/examples/d35a4d78a8b70c9e4d636efb0a92be9d.asciidoc
new file mode 100644
index 000000000..a350c24c4
--- /dev/null
+++ b/docs/examples/d35a4d78a8b70c9e4d636efb0a92be9d.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/multi-terms-aggregation.asciidoc:61
+
+[source, python]
+----
+resp = client.search(
+ index="products",
+ aggs={
+ "genres_and_products": {
+ "multi_terms": {
+ "terms": [
+ {
+ "field": "genre"
+ },
+ {
+ "field": "product"
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d35c8cf7a98b3f112e1de8797ec6689d.asciidoc b/docs/examples/d35c8cf7a98b3f112e1de8797ec6689d.asciidoc
new file mode 100644
index 000000000..4edb74f87
--- /dev/null
+++ b/docs/examples/d35c8cf7a98b3f112e1de8797ec6689d.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/oidc-prepare-authentication-api.asciidoc:128
+
+[source, python]
+----
+resp = client.security.oidc_prepare_authentication(
+ body={
+ "iss": "http://127.0.0.1:8080",
+ "login_hint": "this_is_an_opaque_string"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d37b065a94b3ff65a2a8a204fc3b097c.asciidoc b/docs/examples/d37b065a94b3ff65a2a8a204fc3b097c.asciidoc
new file mode 100644
index 000000000..0801b2812
--- /dev/null
+++ b/docs/examples/d37b065a94b3ff65a2a8a204fc3b097c.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1324
+
+[source, python]
+----
+resp = client.eql.get_status(
+ id="FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
+)
+print(resp)
+----
diff --git a/docs/examples/d37b0bda2bd24ab310e6b26708c7c6fb.asciidoc b/docs/examples/d37b0bda2bd24ab310e6b26708c7c6fb.asciidoc
new file mode 100644
index 000000000..e403bd641
--- /dev/null
+++ b/docs/examples/d37b0bda2bd24ab310e6b26708c7c6fb.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/movfn-aggregation.asciidoc:144
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "the_movavg": {
+ "moving_fn": {
+ "buckets_path": "the_sum",
+ "window": 10,
+ "script": "return values.length > 0 ? values[0] : Double.NaN"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d3a558ef226e9dccc1c7c61e1167547f.asciidoc b/docs/examples/d3a558ef226e9dccc1c7c61e1167547f.asciidoc
new file mode 100644
index 000000000..0ed88bba1
--- /dev/null
+++ b/docs/examples/d3a558ef226e9dccc1c7c61e1167547f.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/geoip.asciidoc:186
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="geoip",
+ description="Add geoip info",
+ processors=[
+ {
+ "geoip": {
+ "field": "ip"
+ }
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="my_id",
+ pipeline="geoip",
+ document={
+ "ip": "80.231.5.0"
+ },
+)
+print(resp1)
+
+resp2 = client.get(
+ index="my-index-000001",
+ id="my_id",
+)
+print(resp2)
+----
diff --git a/docs/examples/d3a5b70d493e0bd77b3f2b586341c83c.asciidoc b/docs/examples/d3a5b70d493e0bd77b3f2b586341c83c.asciidoc
index 96e81aedf..4129b9464 100644
--- a/docs/examples/d3a5b70d493e0bd77b3f2b586341c83c.asciidoc
+++ b/docs/examples/d3a5b70d493e0bd77b3f2b586341c83c.asciidoc
@@ -1,17 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1637
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "runtime": {
- "http.responses": {
- "type": "long",
- "script": '\n String response=dissect(\'%{clientip} %{ident} %{auth} [%{@timestamp}] "%{verb} %{request} HTTP/%{httpversion}" %{response} %{size}\').extract(doc["message"].value)?.response;\n if (response != null) emit(Integer.parseInt(response));\n ',
- }
+ runtime={
+ "http.responses": {
+ "type": "long",
+ "script": "\n String response=dissect('%{clientip} %{ident} %{auth} [%{@timestamp}] \"%{verb} %{request} HTTP/%{httpversion}\" %{response} %{size}').extract(doc[\"message\"].value)?.response;\n if (response != null) emit(Integer.parseInt(response));\n "
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d3d117fec34301520ccdb26332e7c98a.asciidoc b/docs/examples/d3d117fec34301520ccdb26332e7c98a.asciidoc
new file mode 100644
index 000000000..52befff4d
--- /dev/null
+++ b/docs/examples/d3d117fec34301520ccdb26332e7c98a.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/registered-domain.asciidoc:35
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "processors": [
+ {
+ "registered_domain": {
+ "field": "fqdn",
+ "target_field": "url"
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_source": {
+ "fqdn": "www.example.ac.uk"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d3dccdb15822e971ededb9f6f7d8ada1.asciidoc b/docs/examples/d3dccdb15822e971ededb9f6f7d8ada1.asciidoc
index 1bbfe07e4..f3ce80185 100644
--- a/docs/examples/d3dccdb15822e971ededb9f6f7d8ada1.asciidoc
+++ b/docs/examples/d3dccdb15822e971ededb9f6f7d8ada1.asciidoc
@@ -1,16 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:354
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {
- "fields": ["content", "name.*^5"],
- "query": "this AND that OR thus",
- }
+ query={
+ "query_string": {
+ "fields": [
+ "content",
+ "name.*^5"
+ ],
+ "query": "this AND that OR thus"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d3e5edac5b461020017fd9d8ec7a91fa.asciidoc b/docs/examples/d3e5edac5b461020017fd9d8ec7a91fa.asciidoc
new file mode 100644
index 000000000..f1500d9b5
--- /dev/null
+++ b/docs/examples/d3e5edac5b461020017fd9d8ec7a91fa.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/managing-roles.asciidoc:264
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="clicks_admin",
+ run_as=[
+ "clicks_watcher_1"
+ ],
+ cluster=[
+ "monitor"
+ ],
+ indices=[
+ {
+ "names": [
+ "events-*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "field_security": {
+ "grant": [
+ "category",
+ "@timestamp",
+ "message"
+ ]
+ },
+ "query": "{\"match\": {\"category\": \"click\"}}"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d3e9e1169c3514fd46e253cd8b5ae3cb.asciidoc b/docs/examples/d3e9e1169c3514fd46e253cd8b5ae3cb.asciidoc
new file mode 100644
index 000000000..503aef566
--- /dev/null
+++ b/docs/examples/d3e9e1169c3514fd46e253cd8b5ae3cb.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/predicate-tokenfilter.asciidoc:102
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "standard",
+ "filter": [
+ "my_script_filter"
+ ]
+ }
+ },
+ "filter": {
+ "my_script_filter": {
+ "type": "predicate_token_filter",
+ "script": {
+ "source": "\n token.type.contains(\"ALPHANUM\")\n "
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d4323be84152fa91abd76e966d4751dc.asciidoc b/docs/examples/d4323be84152fa91abd76e966d4751dc.asciidoc
new file mode 100644
index 000000000..4e212eaf9
--- /dev/null
+++ b/docs/examples/d4323be84152fa91abd76e966d4751dc.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-api-key.asciidoc:469
+
+[source, python]
+----
+resp = client.security.query_api_keys(
+ query={
+ "term": {
+ "name": {
+ "value": "application-key-1"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d443db2755fde3b49ca3a9d296c4a96f.asciidoc b/docs/examples/d443db2755fde3b49ca3a9d296c4a96f.asciidoc
new file mode 100644
index 000000000..7e6463204
--- /dev/null
+++ b/docs/examples/d443db2755fde3b49ca3a9d296c4a96f.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/delimited-payload-tokenfilter.asciidoc:120
+
+[source, python]
+----
+resp = client.indices.create(
+ index="delimited_payload",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_delimited_payload": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "delimited_payload"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d44ecc69090c0b2bc08a6cbc2e3467c5.asciidoc b/docs/examples/d44ecc69090c0b2bc08a6cbc2e3467c5.asciidoc
new file mode 100644
index 000000000..c17a8b060
--- /dev/null
+++ b/docs/examples/d44ecc69090c0b2bc08a6cbc2e3467c5.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significanttext-aggregation.asciidoc:153
+
+[source, python]
+----
+resp = client.search(
+ index="news",
+ query={
+ "simple_query_string": {
+ "query": "+elasticsearch +pozmantier"
+ }
+ },
+ source=[
+ "title",
+ "source"
+ ],
+ highlight={
+ "fields": {
+ "content": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d46e9739bbf25eb2f7225f58ab08b2a7.asciidoc b/docs/examples/d46e9739bbf25eb2f7225f58ab08b2a7.asciidoc
new file mode 100644
index 000000000..920b8ddb3
--- /dev/null
+++ b/docs/examples/d46e9739bbf25eb2f7225f58ab08b2a7.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/saml-complete-logout-api.asciidoc:83
+
+[source, python]
+----
+resp = client.security.saml_complete_logout(
+ realm="saml1",
+ ids=[
+ "_1c368075e0b3..."
+ ],
+ content="PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...",
+)
+print(resp)
+----
diff --git a/docs/examples/d48b274a4b6098ffef0c016c6c945fb9.asciidoc b/docs/examples/d48b274a4b6098ffef0c016c6c945fb9.asciidoc
new file mode 100644
index 000000000..77bb46877
--- /dev/null
+++ b/docs/examples/d48b274a4b6098ffef0c016c6c945fb9.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-tokens.asciidoc:216
+
+[source, python]
+----
+resp = client.security.get_token(
+ grant_type="refresh_token",
+ refresh_token="vLBPvmAB6KvwvJZr27cS",
+)
+print(resp)
+----
diff --git a/docs/examples/d49318764244113ad2ac4cc0f06d77ec.asciidoc b/docs/examples/d49318764244113ad2ac4cc0f06d77ec.asciidoc
new file mode 100644
index 000000000..970b9082e
--- /dev/null
+++ b/docs/examples/d49318764244113ad2ac4cc0f06d77ec.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:1034
+
+[source, python]
+----
+resp = client.indices.create(
+ index="image-index",
+ mappings={
+ "properties": {
+ "image-vector": {
+ "type": "dense_vector",
+ "dims": 3,
+ "similarity": "l2_norm",
+ "index_options": {
+ "type": "hnsw",
+ "m": 32,
+ "ef_construction": 100
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d4a41fb74b41b41a0ee114a2311f2815.asciidoc b/docs/examples/d4a41fb74b41b41a0ee114a2311f2815.asciidoc
new file mode 100644
index 000000000..1ae0d830b
--- /dev/null
+++ b/docs/examples/d4a41fb74b41b41a0ee114a2311f2815.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-rollover.asciidoc:245
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_age": "7d"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d4b405ef0302227e050ac8f0e39068e1.asciidoc b/docs/examples/d4b405ef0302227e050ac8f0e39068e1.asciidoc
new file mode 100644
index 000000000..0a0a05e6a
--- /dev/null
+++ b/docs/examples/d4b405ef0302227e050ac8f0e39068e1.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/evaluate-dfanalytics.asciidoc:253
+
+[source, python]
+----
+resp = client.ml.evaluate_data_frame(
+ index="my_analytics_dest_index",
+ evaluation={
+ "outlier_detection": {
+ "actual_field": "is_outlier",
+ "predicted_probability_field": "ml.outlier_score"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d4b50ae96e541c0031264a10f6afccbf.asciidoc b/docs/examples/d4b50ae96e541c0031264a10f6afccbf.asciidoc
new file mode 100644
index 000000000..75648a069
--- /dev/null
+++ b/docs/examples/d4b50ae96e541c0031264a10f6afccbf.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-a-data-stream.asciidoc:336
+
+[source, python]
+----
+resp = client.indices.migrate_to_data_stream(
+ name="my-time-series-data",
+)
+print(resp)
+----
diff --git a/docs/examples/d4cdcf01014c75693b080c778071c1b5.asciidoc b/docs/examples/d4cdcf01014c75693b080c778071c1b5.asciidoc
new file mode 100644
index 000000000..8abfa5c25
--- /dev/null
+++ b/docs/examples/d4cdcf01014c75693b080c778071c1b5.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/stats-aggregation.asciidoc:102
+
+[source, python]
+----
+resp = client.search(
+ index="exams",
+ size="0",
+ aggs={
+ "grades_stats": {
+ "stats": {
+ "field": "grade",
+ "missing": 0
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d4d450f536d747d5ef5050d2d8c66f09.asciidoc b/docs/examples/d4d450f536d747d5ef5050d2d8c66f09.asciidoc
new file mode 100644
index 000000000..b1a92fc25
--- /dev/null
+++ b/docs/examples/d4d450f536d747d5ef5050d2d8c66f09.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// search/validate.asciidoc:87
+
+[source, python]
+----
+resp = client.bulk(
+ index="my-index-000001",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "user": {
+ "id": "kimchy"
+ },
+ "@timestamp": "2099-11-15T14:12:12",
+ "message": "trying out Elasticsearch"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "user": {
+ "id": "kimchi"
+ },
+ "@timestamp": "2099-11-15T14:12:13",
+ "message": "My user ID is similar to kimchy!"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d4ef6ac034c4d42cb75d830ec69146e6.asciidoc b/docs/examples/d4ef6ac034c4d42cb75d830ec69146e6.asciidoc
new file mode 100644
index 000000000..76daae69a
--- /dev/null
+++ b/docs/examples/d4ef6ac034c4d42cb75d830ec69146e6.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/auto-follow/delete-auto-follow-pattern.asciidoc:69
+
+[source, python]
+----
+resp = client.ccr.delete_auto_follow_pattern(
+ name="my_auto_follow_pattern",
+)
+print(resp)
+----
diff --git a/docs/examples/d4fb482a51d67a1af48e429af6019a46.asciidoc b/docs/examples/d4fb482a51d67a1af48e429af6019a46.asciidoc
index b200ad42c..25444ab3a 100644
--- a/docs/examples/d4fb482a51d67a1af48e429af6019a46.asciidoc
+++ b/docs/examples/d4fb482a51d67a1af48e429af6019a46.asciidoc
@@ -1,23 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/index-sorting.asciidoc:40
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "settings": {
- "index": {
- "sort.field": ["username", "date"],
- "sort.order": ["asc", "desc"],
- }
- },
- "mappings": {
- "properties": {
- "username": {"type": "keyword", "doc_values": True},
- "date": {"type": "date"},
+ settings={
+ "index": {
+ "sort.field": [
+ "username",
+ "date"
+ ],
+ "sort.order": [
+ "asc",
+ "desc"
+ ]
+ }
+ },
+ mappings={
+ "properties": {
+ "username": {
+ "type": "keyword",
+ "doc_values": True
+ },
+ "date": {
+ "type": "date"
}
- },
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d50b030edfe6d1128eb76aa5ba9d4e27.asciidoc b/docs/examples/d50b030edfe6d1128eb76aa5ba9d4e27.asciidoc
index d16117294..0d4378362 100644
--- a/docs/examples/d50b030edfe6d1128eb76aa5ba9d4e27.asciidoc
+++ b/docs/examples/d50b030edfe6d1128eb76aa5ba9d4e27.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/put-trained-models-aliases.asciidoc:94
[source, python]
@@ -5,7 +6,7 @@
resp = client.ml.put_trained_model_alias(
model_id="flight-delay-prediction-1580004349800",
model_alias="flight_delay_model",
- reassign="true",
+ reassign=True,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d5132d34ae922fa8e898889b627a1405.asciidoc b/docs/examples/d5132d34ae922fa8e898889b627a1405.asciidoc
new file mode 100644
index 000000000..fd40b7efc
--- /dev/null
+++ b/docs/examples/d5132d34ae922fa8e898889b627a1405.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/children-aggregation.asciidoc:95
+
+[source, python]
+----
+resp = client.search(
+ index="child_example",
+ size="0",
+ aggs={
+ "top-tags": {
+ "terms": {
+ "field": "tags.keyword",
+ "size": 10
+ },
+ "aggs": {
+ "to-answers": {
+ "children": {
+ "type": "answer"
+ },
+ "aggs": {
+ "top-names": {
+ "terms": {
+ "field": "owner.display_name.keyword",
+ "size": 10
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d524db57be9f16abac5396895b9a2a59.asciidoc b/docs/examples/d524db57be9f16abac5396895b9a2a59.asciidoc
new file mode 100644
index 000000000..b16084909
--- /dev/null
+++ b/docs/examples/d524db57be9f16abac5396895b9a2a59.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/resolve.asciidoc:47
+
+[source, python]
+----
+resp = client.indices.resolve_index(
+ name="my-index-*",
+)
+print(resp)
+----
diff --git a/docs/examples/d547d55efbf75374f6de1f224323bc73.asciidoc b/docs/examples/d547d55efbf75374f6de1f224323bc73.asciidoc
new file mode 100644
index 000000000..9341b17c1
--- /dev/null
+++ b/docs/examples/d547d55efbf75374f6de1f224323bc73.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/geo-grid.asciidoc:39
+
+[source, python]
+----
+resp = client.indices.create(
+ index="geocells",
+ mappings={
+ "properties": {
+ "geocell": {
+ "type": "geo_shape"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.ingest.put_pipeline(
+ id="geotile2shape",
+ description="translate rectangular z/x/y geotile to bounding box",
+ processors=[
+ {
+ "geo_grid": {
+ "field": "geocell",
+ "tile_type": "geotile"
+ }
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.ingest.put_pipeline(
+ id="geohex2shape",
+ description="translate H3 cell to polygon",
+ processors=[
+ {
+ "geo_grid": {
+ "field": "geocell",
+ "tile_type": "geohex",
+ "target_format": "wkt"
+ }
+ }
+ ],
+)
+print(resp2)
+----
diff --git a/docs/examples/d5533f08f5cc0479f07a46c761f0786b.asciidoc b/docs/examples/d5533f08f5cc0479f07a46c761f0786b.asciidoc
index d4621638e..bc24e9978 100644
--- a/docs/examples/d5533f08f5cc0479f07a46c761f0786b.asciidoc
+++ b/docs/examples/d5533f08f5cc0479f07a46c761f0786b.asciidoc
@@ -1,17 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:321
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "counter": {"type": "integer", "store": False},
- "tags": {"type": "keyword", "store": True},
+ mappings={
+ "properties": {
+ "counter": {
+ "type": "integer",
+ "store": False
+ },
+ "tags": {
+ "type": "keyword",
+ "store": True
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d56a9d89282df56adbbc34b91390ac17.asciidoc b/docs/examples/d56a9d89282df56adbbc34b91390ac17.asciidoc
new file mode 100644
index 000000000..fdc2e6aba
--- /dev/null
+++ b/docs/examples/d56a9d89282df56adbbc34b91390ac17.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/auto-follow/get-auto-follow-pattern.asciidoc:49
+
+[source, python]
+----
+resp = client.ccr.get_auto_follow_pattern(
+ name="",
+)
+print(resp)
+----
diff --git a/docs/examples/d595b40bf1ea71923f9824d0f9c99c49.asciidoc b/docs/examples/d595b40bf1ea71923f9824d0f9c99c49.asciidoc
new file mode 100644
index 000000000..f904ab1df
--- /dev/null
+++ b/docs/examples/d595b40bf1ea71923f9824d0f9c99c49.asciidoc
@@ -0,0 +1,64 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-using-query-rules.asciidoc:122
+
+[source, python]
+----
+resp = client.query_rules.put_ruleset(
+ ruleset_id="my-ruleset",
+ rules=[
+ {
+ "rule_id": "rule1",
+ "type": "pinned",
+ "criteria": [
+ {
+ "type": "fuzzy",
+ "metadata": "query_string",
+ "values": [
+ "puggles",
+ "pugs"
+ ]
+ },
+ {
+ "type": "exact",
+ "metadata": "user_country",
+ "values": [
+ "us"
+ ]
+ }
+ ],
+ "actions": {
+ "ids": [
+ "id1",
+ "id2"
+ ]
+ }
+ },
+ {
+ "rule_id": "rule2",
+ "type": "pinned",
+ "criteria": [
+ {
+ "type": "contains",
+ "metadata": "query_string",
+ "values": [
+ "beagles"
+ ]
+ }
+ ],
+ "actions": {
+ "docs": [
+ {
+ "_index": "my-index-000001",
+ "_id": "id3"
+ },
+ {
+ "_index": "my-index-000002",
+ "_id": "id4"
+ }
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d59e9cc75814575aa5e275dbe262918c.asciidoc b/docs/examples/d59e9cc75814575aa5e275dbe262918c.asciidoc
new file mode 100644
index 000000000..604970f71
--- /dev/null
+++ b/docs/examples/d59e9cc75814575aa5e275dbe262918c.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-grid-query.asciidoc:119
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "geo_grid": {
+ "location": {
+ "geohash": "u0"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d5abaf1fd26f0abf410dd8827d077bbf.asciidoc b/docs/examples/d5abaf1fd26f0abf410dd8827d077bbf.asciidoc
index 4ae35140e..75944958f 100644
--- a/docs/examples/d5abaf1fd26f0abf410dd8827d077bbf.asciidoc
+++ b/docs/examples/d5abaf1fd26f0abf410dd8827d077bbf.asciidoc
@@ -1,10 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/parent-join.asciidoc:173
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={"query": {"match_all": {}}, "sort": ["my_id"]},
+ query={
+ "match_all": {}
+ },
+ sort=[
+ "my_id"
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d5bf9bc08f622ece98632a14a3982e27.asciidoc b/docs/examples/d5bf9bc08f622ece98632a14a3982e27.asciidoc
new file mode 100644
index 000000000..ab676618a
--- /dev/null
+++ b/docs/examples/d5bf9bc08f622ece98632a14a3982e27.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:770
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match_all": {}
+ },
+ script_fields={
+ "test1": {
+ "script": "params['_source']['message']"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d5d0ecf75843ddb5f92cfebd089e53e9.asciidoc b/docs/examples/d5d0ecf75843ddb5f92cfebd089e53e9.asciidoc
index 340279960..4b4e8163c 100644
--- a/docs/examples/d5d0ecf75843ddb5f92cfebd089e53e9.asciidoc
+++ b/docs/examples/d5d0ecf75843ddb5f92cfebd089e53e9.asciidoc
@@ -1,15 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:742
[source, python]
----
resp = client.reindex(
- body={
- "source": {
- "index": "my-index-000001",
- "_source": ["user.id", "_doc"],
- },
- "dest": {"index": "my-new-index-000001"},
+ source={
+ "index": "my-index-000001",
+ "_source": [
+ "user.id",
+ "_doc"
+ ]
+ },
+ dest={
+ "index": "my-new-index-000001"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d5dcddc6398b473b6ad9bce5c6adf986.asciidoc b/docs/examples/d5dcddc6398b473b6ad9bce5c6adf986.asciidoc
new file mode 100644
index 000000000..d306117a8
--- /dev/null
+++ b/docs/examples/d5dcddc6398b473b6ad9bce5c6adf986.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:433
+
+[source, python]
+----
+resp = client.search(
+ scroll="1m",
+ sort=[
+ "_doc"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d5ead6aacbfbedc8396f87bb34acc880.asciidoc b/docs/examples/d5ead6aacbfbedc8396f87bb34acc880.asciidoc
new file mode 100644
index 000000000..50b1633ff
--- /dev/null
+++ b/docs/examples/d5ead6aacbfbedc8396f87bb34acc880.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/get-async-eql-search-api.asciidoc:14
+
+[source, python]
+----
+resp = client.eql.get(
+ id="FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
+)
+print(resp)
+----
diff --git a/docs/examples/d603e76ab70131f7ec6b08758f95a0e3.asciidoc b/docs/examples/d603e76ab70131f7ec6b08758f95a0e3.asciidoc
new file mode 100644
index 000000000..b7e295f92
--- /dev/null
+++ b/docs/examples/d603e76ab70131f7ec6b08758f95a0e3.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/recovery.asciidoc:143
+
+[source, python]
+----
+resp = client.cat.recovery(
+ v=True,
+ h="i,s,t,ty,st,rep,snap,f,fp,b,bp",
+)
+print(resp)
+----
diff --git a/docs/examples/d64679f8a53928fe9958dbe5ee5d9d13.asciidoc b/docs/examples/d64679f8a53928fe9958dbe5ee5d9d13.asciidoc
index da13a71fc..6fc52e038 100644
--- a/docs/examples/d64679f8a53928fe9958dbe5ee5d9d13.asciidoc
+++ b/docs/examples/d64679f8a53928fe9958dbe5ee5d9d13.asciidoc
@@ -1,24 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/parent-join.asciidoc:280
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "query": {"parent_id": {"type": "answer", "id": "1"}},
- "aggs": {
- "parents": {
- "terms": {"field": "my_join_field#question", "size": 10}
- }
- },
- "runtime_mappings": {
- "parent": {
- "type": "long",
- "script": "\n emit(Integer.parseInt(doc['my_join_field#question'].value)) \n ",
+ query={
+ "parent_id": {
+ "type": "answer",
+ "id": "1"
+ }
+ },
+ aggs={
+ "parents": {
+ "terms": {
+ "field": "my_join_field#question",
+ "size": 10
}
- },
- "fields": [{"field": "parent"}],
+ }
},
+ runtime_mappings={
+ "parent": {
+ "type": "long",
+ "script": "\n emit(Integer.parseInt(doc['my_join_field#question'].value)) \n "
+ }
+ },
+ fields=[
+ {
+ "field": "parent"
+ }
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d64d509440afbed7cefd04b6898962eb.asciidoc b/docs/examples/d64d509440afbed7cefd04b6898962eb.asciidoc
new file mode 100644
index 000000000..b0ef05f8c
--- /dev/null
+++ b/docs/examples/d64d509440afbed7cefd04b6898962eb.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-distance-query.asciidoc:100
+
+[source, python]
+----
+resp = client.search(
+ index="my_geoshapes",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_distance": {
+ "distance": "200km",
+ "pin.location": {
+ "lat": 40,
+ "lon": -70
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d66e2b4d1931bf88c72e74670156e43f.asciidoc b/docs/examples/d66e2b4d1931bf88c72e74670156e43f.asciidoc
new file mode 100644
index 000000000..d63114c25
--- /dev/null
+++ b/docs/examples/d66e2b4d1931bf88c72e74670156e43f.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-api.asciidoc:332
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ track_total_hits=100,
+ query={
+ "match": {
+ "user.id": "elkbee"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d681508a745b2bc777d47ba606d24224.asciidoc b/docs/examples/d681508a745b2bc777d47ba606d24224.asciidoc
new file mode 100644
index 000000000..ac543ef18
--- /dev/null
+++ b/docs/examples/d681508a745b2bc777d47ba606d24224.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/fielddata.asciidoc:152
+
+[source, python]
+----
+resp = client.cat.fielddata(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/d681b643da0d7f0a384f627b6d56111b.asciidoc b/docs/examples/d681b643da0d7f0a384f627b6d56111b.asciidoc
new file mode 100644
index 000000000..92c192691
--- /dev/null
+++ b/docs/examples/d681b643da0d7f0a384f627b6d56111b.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/dissect-syntax.asciidoc:89
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index",
+ mappings={
+ "properties": {
+ "message": {
+ "type": "wildcard"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d690a6af462c70a783625a323e11c72c.asciidoc b/docs/examples/d690a6af462c70a783625a323e11c72c.asciidoc
new file mode 100644
index 000000000..bbdd85f54
--- /dev/null
+++ b/docs/examples/d690a6af462c70a783625a323e11c72c.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/set-up-lifecycle-policy.asciidoc:187
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test-index",
+ settings={
+ "number_of_shards": 1,
+ "number_of_replicas": 1,
+ "index.lifecycle.name": "my_policy"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d69bd36335774c8ae1286cee21310241.asciidoc b/docs/examples/d69bd36335774c8ae1286cee21310241.asciidoc
new file mode 100644
index 000000000..846c0f023
--- /dev/null
+++ b/docs/examples/d69bd36335774c8ae1286cee21310241.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/remote-clusters-privileges-api-key.asciidoc:71
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="remote-search",
+ remote_indices=[
+ {
+ "clusters": [
+ "my_remote_cluster"
+ ],
+ "names": [
+ "target-index"
+ ],
+ "privileges": [
+ "read",
+ "read_cross_cluster",
+ "view_index_metadata"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d69cf7c82602431d9e339583e7dfb988.asciidoc b/docs/examples/d69cf7c82602431d9e339583e7dfb988.asciidoc
new file mode 100644
index 000000000..da8a0bc29
--- /dev/null
+++ b/docs/examples/d69cf7c82602431d9e339583e7dfb988.asciidoc
@@ -0,0 +1,48 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/configuring.asciidoc:10
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "std_english": {
+ "type": "standard",
+ "stopwords": "_english_"
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "my_text": {
+ "type": "text",
+ "analyzer": "standard",
+ "fields": {
+ "english": {
+ "type": "text",
+ "analyzer": "std_english"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ field="my_text",
+ text="The old brown cow",
+)
+print(resp1)
+
+resp2 = client.indices.analyze(
+ index="my-index-000001",
+ field="my_text.english",
+ text="The old brown cow",
+)
+print(resp2)
+----
diff --git a/docs/examples/d6a21afa4a94b9baa734eac430940bcf.asciidoc b/docs/examples/d6a21afa4a94b9baa734eac430940bcf.asciidoc
new file mode 100644
index 000000000..c7fca7b67
--- /dev/null
+++ b/docs/examples/d6a21afa4a94b9baa734eac430940bcf.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/list-connectors-api.asciidoc:85
+
+[source, python]
+----
+resp = client.connector.list(
+ from_="0",
+ size="2",
+)
+print(resp)
+----
diff --git a/docs/examples/d70f55cd29cdb2dcd775ffa9e23ff393.asciidoc b/docs/examples/d70f55cd29cdb2dcd775ffa9e23ff393.asciidoc
new file mode 100644
index 000000000..9848d411d
--- /dev/null
+++ b/docs/examples/d70f55cd29cdb2dcd775ffa9e23ff393.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/max-aggregation.asciidoc:52
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ runtime_mappings={
+ "price.adjusted": {
+ "type": "double",
+ "script": "\n double price = doc['price'].value;\n if (doc['promoted'].value) {\n price *= 0.8;\n }\n emit(price);\n "
+ }
+ },
+ aggs={
+ "max_price": {
+ "max": {
+ "field": "price.adjusted"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d7141bd4d0db964f5cc4a872ad79dce9.asciidoc b/docs/examples/d7141bd4d0db964f5cc4a872ad79dce9.asciidoc
new file mode 100644
index 000000000..6c9d7e7d0
--- /dev/null
+++ b/docs/examples/d7141bd4d0db964f5cc4a872ad79dce9.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// features/apis/reset-features-api.asciidoc:14
+
+[source, python]
+----
+resp = client.features.reset_features()
+print(resp)
+----
diff --git a/docs/examples/d7348119df9f89a556a7b767d5298c7e.asciidoc b/docs/examples/d7348119df9f89a556a7b767d5298c7e.asciidoc
new file mode 100644
index 000000000..1a6180ea5
--- /dev/null
+++ b/docs/examples/d7348119df9f89a556a7b767d5298c7e.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/geoline-aggregation.asciidoc:218
+
+[source, python]
+----
+resp = client.search(
+ index="tour",
+ filter_path="aggregations",
+ aggregations={
+ "path": {
+ "terms": {
+ "field": "city"
+ },
+ "aggregations": {
+ "museum_tour": {
+ "geo_line": {
+ "point": {
+ "field": "location"
+ },
+ "sort": {
+ "field": "@timestamp"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d7717318d93d0a1f3ad049f9c6604417.asciidoc b/docs/examples/d7717318d93d0a1f3ad049f9c6604417.asciidoc
new file mode 100644
index 000000000..1a1654ace
--- /dev/null
+++ b/docs/examples/d7717318d93d0a1f3ad049f9c6604417.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/standard-tokenizer.asciidoc:139
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "my_tokenizer"
+ }
+ },
+ "tokenizer": {
+ "my_tokenizer": {
+ "type": "standard",
+ "max_token_length": 5
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
+)
+print(resp1)
+----
diff --git a/docs/examples/d775836a0d7abecc6637aa988f204c30.asciidoc b/docs/examples/d775836a0d7abecc6637aa988f204c30.asciidoc
new file mode 100644
index 000000000..46b21f906
--- /dev/null
+++ b/docs/examples/d775836a0d7abecc6637aa988f204c30.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/termvectors.asciidoc:218
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "fullname": "John Doe",
+ "text": "test test test "
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="2",
+ refresh="wait_for",
+ document={
+ "fullname": "Jane Doe",
+ "text": "Another test ..."
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/d7898526d239d2aea83727fb982f8f77.asciidoc b/docs/examples/d7898526d239d2aea83727fb982f8f77.asciidoc
new file mode 100644
index 000000000..d02e7b8c5
--- /dev/null
+++ b/docs/examples/d7898526d239d2aea83727fb982f8f77.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/refresh.asciidoc:113
+
+[source, python]
+----
+resp = client.indices.refresh()
+print(resp)
+----
diff --git a/docs/examples/d7919fb6f4d02dde1390775eb8365b79.asciidoc b/docs/examples/d7919fb6f4d02dde1390775eb8365b79.asciidoc
index a32951b31..8a23680f6 100644
--- a/docs/examples/d7919fb6f4d02dde1390775eb8365b79.asciidoc
+++ b/docs/examples/d7919fb6f4d02dde1390775eb8365b79.asciidoc
@@ -1,10 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/text.asciidoc:323
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={"properties": {"my_field": {"type": "text", "fielddata": True}}},
+ properties={
+ "my_field": {
+ "type": "text",
+ "fielddata": True
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d7a55a7c491e97079e429483085f1d58.asciidoc b/docs/examples/d7a55a7c491e97079e429483085f1d58.asciidoc
new file mode 100644
index 000000000..a09d7affa
--- /dev/null
+++ b/docs/examples/d7a55a7c491e97079e429483085f1d58.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-migrate-data-stream-from-ilm-to-dsl.asciidoc:60
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="dsl-data-stream-template",
+ index_patterns=[
+ "dsl-data-stream*"
+ ],
+ data_stream={},
+ priority=500,
+ template={
+ "settings": {
+ "index.lifecycle.name": "pre-dsl-ilm-policy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d7a5b0159ffdcdd1ab9078b38829a08b.asciidoc b/docs/examples/d7a5b0159ffdcdd1ab9078b38829a08b.asciidoc
new file mode 100644
index 000000000..1992809fe
--- /dev/null
+++ b/docs/examples/d7a5b0159ffdcdd1ab9078b38829a08b.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/semantic-query.asciidoc:87
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ retriever={
+ "rrf": {
+ "retrievers": [
+ {
+ "standard": {
+ "query": {
+ "term": {
+ "text": "shoes"
+ }
+ }
+ }
+ },
+ {
+ "standard": {
+ "query": {
+ "semantic": {
+ "field": "semantic_field",
+ "query": "shoes"
+ }
+ }
+ }
+ }
+ ],
+ "rank_window_size": 50,
+ "rank_constant": 20
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d7ae456f119246e95f2f4c37e7544b8c.asciidoc b/docs/examples/d7ae456f119246e95f2f4c37e7544b8c.asciidoc
new file mode 100644
index 000000000..ed5729b4f
--- /dev/null
+++ b/docs/examples/d7ae456f119246e95f2f4c37e7544b8c.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/start-datafeed.asciidoc:109
+
+[source, python]
+----
+resp = client.ml.start_datafeed(
+ datafeed_id="datafeed-low_request_rate",
+ start="2019-04-07T18:22:16Z",
+)
+print(resp)
+----
diff --git a/docs/examples/d7b61bfb6adb22986a43388b823894cc.asciidoc b/docs/examples/d7b61bfb6adb22986a43388b823894cc.asciidoc
new file mode 100644
index 000000000..6c74ad761
--- /dev/null
+++ b/docs/examples/d7b61bfb6adb22986a43388b823894cc.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-task.asciidoc:4
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="cohere_embeddings",
+ inference_config={
+ "service": "cohere",
+ "service_settings": {
+ "api_key": "",
+ "model_id": "embed-english-v3.0",
+ "embedding_type": "byte"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d7d92816cac64b7c70d72b0000eeeeea.asciidoc b/docs/examples/d7d92816cac64b7c70d72b0000eeeeea.asciidoc
new file mode 100644
index 000000000..4c4ea8247
--- /dev/null
+++ b/docs/examples/d7d92816cac64b7c70d72b0000eeeeea.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/field-level-security.asciidoc:77
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="test_role3",
+ indices=[
+ {
+ "names": [
+ "*"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "field_security": {
+ "grant": [
+ "customer.handle"
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d7f42d1b906dc406be1819d17c625d5f.asciidoc b/docs/examples/d7f42d1b906dc406be1819d17c625d5f.asciidoc
index c30eaee45..48ef0f04f 100644
--- a/docs/examples/d7f42d1b906dc406be1819d17c625d5f.asciidoc
+++ b/docs/examples/d7f42d1b906dc406be1819d17c625d5f.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/filter-aggregation.asciidoc:83
[source, python]
@@ -6,14 +7,22 @@ resp = client.search(
index="sales",
size="0",
filter_path="aggregations",
- body={
- "aggs": {
- "t_shirts": {
- "filter": {"term": {"type": "t-shirt"}},
- "aggs": {"avg_price": {"avg": {"field": "price"}}},
+ aggs={
+ "t_shirts": {
+ "filter": {
+ "term": {
+ "type": "t-shirt"
+ }
+ },
+ "aggs": {
+ "avg_price": {
+ "avg": {
+ "field": "price"
+ }
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d7fe687201ac87b307cd06ed015dd317.asciidoc b/docs/examples/d7fe687201ac87b307cd06ed015dd317.asciidoc
index a7f044db0..f77b3758f 100644
--- a/docs/examples/d7fe687201ac87b307cd06ed015dd317.asciidoc
+++ b/docs/examples/d7fe687201ac87b307cd06ed015dd317.asciidoc
@@ -1,12 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:282
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "properties": {"user_id": {"type": "keyword", "ignore_above": 100}}
+ properties={
+ "user_id": {
+ "type": "keyword",
+ "ignore_above": 100
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d803ed00d8f45f81c33e415e1c1ecb8c.asciidoc b/docs/examples/d803ed00d8f45f81c33e415e1c1ecb8c.asciidoc
new file mode 100644
index 000000000..8c7f478d6
--- /dev/null
+++ b/docs/examples/d803ed00d8f45f81c33e415e1c1ecb8c.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:642
+
+[source, python]
+----
+resp = client.reindex(
+ source={
+ "index": "my-data-stream",
+ "query": {
+ "range": {
+ "@timestamp": {
+ "gte": "now-7d/d",
+ "lte": "now/d"
+ }
+ }
+ }
+ },
+ dest={
+ "index": "new-data-stream",
+ "op_type": "create"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d80ac403d8d936ca9dec185c7da13f2f.asciidoc b/docs/examples/d80ac403d8d936ca9dec185c7da13f2f.asciidoc
new file mode 100644
index 000000000..8a73c0098
--- /dev/null
+++ b/docs/examples/d80ac403d8d936ca9dec185c7da13f2f.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/apis/create-stored-script-api.asciidoc:11
+
+[source, python]
+----
+resp = client.put_script(
+ id="my-stored-script",
+ script={
+ "lang": "painless",
+ "source": "Math.log(_score * 2) + params['my_modifier']"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d8310e5606c61e7a6e64a90838b1a830.asciidoc b/docs/examples/d8310e5606c61e7a6e64a90838b1a830.asciidoc
new file mode 100644
index 000000000..e3078bcf3
--- /dev/null
+++ b/docs/examples/d8310e5606c61e7a6e64a90838b1a830.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/parent-aggregation.asciidoc:59
+
+[source, python]
+----
+resp = client.index(
+ index="parent_example",
+ id="2",
+ routing="1",
+ document={
+ "join": {
+ "name": "answer",
+ "parent": "1"
+ },
+ "owner": {
+ "location": "Norfolk, United Kingdom",
+ "display_name": "Sam",
+ "id": 48
+ },
+ "body": "Unfortunately you're pretty much limited to FTP...",
+ "creation_date": "2009-05-04T13:45:37.030"
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="parent_example",
+ id="3",
+ routing="1",
+ refresh=True,
+ document={
+ "join": {
+ "name": "answer",
+ "parent": "1"
+ },
+ "owner": {
+ "location": "Norfolk, United Kingdom",
+ "display_name": "Troll",
+ "id": 49
+ },
+ "body": "Use Linux...",
+ "creation_date": "2009-05-05T13:45:37.030"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/d8496fa0e5a394fd758617ed6a6c956f.asciidoc b/docs/examples/d8496fa0e5a394fd758617ed6a6c956f.asciidoc
new file mode 100644
index 000000000..9b1fae207
--- /dev/null
+++ b/docs/examples/d8496fa0e5a394fd758617ed6a6c956f.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:373
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "percolate": {
+ "field": "query",
+ "document": {
+ "message": "The quick brown fox jumps over the lazy dog"
+ }
+ }
+ },
+ highlight={
+ "fields": {
+ "message": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d84a861ce563508aeaaf30a9dd84b5cf.asciidoc b/docs/examples/d84a861ce563508aeaaf30a9dd84b5cf.asciidoc
new file mode 100644
index 000000000..80264782b
--- /dev/null
+++ b/docs/examples/d84a861ce563508aeaaf30a9dd84b5cf.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-rollover.asciidoc:271
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "hot": {
+ "actions": {
+ "rollover": {
+ "max_age": "7d",
+ "max_size": "100gb",
+ "min_docs": 1000
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d851282dba548251d10db5954a339307.asciidoc b/docs/examples/d851282dba548251d10db5954a339307.asciidoc
new file mode 100644
index 000000000..e47caa602
--- /dev/null
+++ b/docs/examples/d851282dba548251d10db5954a339307.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/paginate-search-results.asciidoc:136
+
+[source, python]
+----
+resp = client.search(
+ index="twitter",
+ query={
+ "match": {
+ "title": "elasticsearch"
+ }
+ },
+ search_after=[
+ 1463538857,
+ "654323"
+ ],
+ sort=[
+ {
+ "date": "asc"
+ },
+ {
+ "tie_breaker_id": "asc"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d870d5bd1f97fc75872a298fcddec513.asciidoc b/docs/examples/d870d5bd1f97fc75872a298fcddec513.asciidoc
new file mode 100644
index 000000000..e128de0b6
--- /dev/null
+++ b/docs/examples/d870d5bd1f97fc75872a298fcddec513.asciidoc
@@ -0,0 +1,155 @@
+// This file is autogenerated, DO NOT EDIT
+// text-structure/apis/find-structure.asciidoc:95
+
+[source, python]
+----
+resp = client.text_structure.find_structure(
+ text_files=[
+ {
+ "name": "Leviathan Wakes",
+ "author": "James S.A. Corey",
+ "release_date": "2011-06-02",
+ "page_count": 561
+ },
+ {
+ "name": "Hyperion",
+ "author": "Dan Simmons",
+ "release_date": "1989-05-26",
+ "page_count": 482
+ },
+ {
+ "name": "Dune",
+ "author": "Frank Herbert",
+ "release_date": "1965-06-01",
+ "page_count": 604
+ },
+ {
+ "name": "Dune Messiah",
+ "author": "Frank Herbert",
+ "release_date": "1969-10-15",
+ "page_count": 331
+ },
+ {
+ "name": "Children of Dune",
+ "author": "Frank Herbert",
+ "release_date": "1976-04-21",
+ "page_count": 408
+ },
+ {
+ "name": "God Emperor of Dune",
+ "author": "Frank Herbert",
+ "release_date": "1981-05-28",
+ "page_count": 454
+ },
+ {
+ "name": "Consider Phlebas",
+ "author": "Iain M. Banks",
+ "release_date": "1987-04-23",
+ "page_count": 471
+ },
+ {
+ "name": "Pandora's Star",
+ "author": "Peter F. Hamilton",
+ "release_date": "2004-03-02",
+ "page_count": 768
+ },
+ {
+ "name": "Revelation Space",
+ "author": "Alastair Reynolds",
+ "release_date": "2000-03-15",
+ "page_count": 585
+ },
+ {
+ "name": "A Fire Upon the Deep",
+ "author": "Vernor Vinge",
+ "release_date": "1992-06-01",
+ "page_count": 613
+ },
+ {
+ "name": "Ender's Game",
+ "author": "Orson Scott Card",
+ "release_date": "1985-06-01",
+ "page_count": 324
+ },
+ {
+ "name": "1984",
+ "author": "George Orwell",
+ "release_date": "1985-06-01",
+ "page_count": 328
+ },
+ {
+ "name": "Fahrenheit 451",
+ "author": "Ray Bradbury",
+ "release_date": "1953-10-15",
+ "page_count": 227
+ },
+ {
+ "name": "Brave New World",
+ "author": "Aldous Huxley",
+ "release_date": "1932-06-01",
+ "page_count": 268
+ },
+ {
+ "name": "Foundation",
+ "author": "Isaac Asimov",
+ "release_date": "1951-06-01",
+ "page_count": 224
+ },
+ {
+ "name": "The Giver",
+ "author": "Lois Lowry",
+ "release_date": "1993-04-26",
+ "page_count": 208
+ },
+ {
+ "name": "Slaughterhouse-Five",
+ "author": "Kurt Vonnegut",
+ "release_date": "1969-06-01",
+ "page_count": 275
+ },
+ {
+ "name": "The Hitchhiker's Guide to the Galaxy",
+ "author": "Douglas Adams",
+ "release_date": "1979-10-12",
+ "page_count": 180
+ },
+ {
+ "name": "Snow Crash",
+ "author": "Neal Stephenson",
+ "release_date": "1992-06-01",
+ "page_count": 470
+ },
+ {
+ "name": "Neuromancer",
+ "author": "William Gibson",
+ "release_date": "1984-07-01",
+ "page_count": 271
+ },
+ {
+ "name": "The Handmaid's Tale",
+ "author": "Margaret Atwood",
+ "release_date": "1985-06-01",
+ "page_count": 311
+ },
+ {
+ "name": "Starship Troopers",
+ "author": "Robert A. Heinlein",
+ "release_date": "1959-12-01",
+ "page_count": 335
+ },
+ {
+ "name": "The Left Hand of Darkness",
+ "author": "Ursula K. Le Guin",
+ "release_date": "1969-06-01",
+ "page_count": 304
+ },
+ {
+ "name": "The Moon is a Harsh Mistress",
+ "author": "Robert A. Heinlein",
+ "release_date": "1966-04-01",
+ "page_count": 288
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/d87175daed2327565d4325528c6d8b38.asciidoc b/docs/examples/d87175daed2327565d4325528c6d8b38.asciidoc
index dca82049e..2aca8df64 100644
--- a/docs/examples/d87175daed2327565d4325528c6d8b38.asciidoc
+++ b/docs/examples/d87175daed2327565d4325528c6d8b38.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:229
[source, python]
@@ -7,4 +8,4 @@ resp = client.get(
id="0",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d87cfcc0a297f75ffe646b2e61940d14.asciidoc b/docs/examples/d87cfcc0a297f75ffe646b2e61940d14.asciidoc
new file mode 100644
index 000000000..64c4b7bbb
--- /dev/null
+++ b/docs/examples/d87cfcc0a297f75ffe646b2e61940d14.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/uppercase-tokenfilter.asciidoc:92
+
+[source, python]
+----
+resp = client.indices.create(
+ index="uppercase_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_uppercase": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "uppercase"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d880630b6f7dc634c4078293f9cd3d80.asciidoc b/docs/examples/d880630b6f7dc634c4078293f9cd3d80.asciidoc
new file mode 100644
index 000000000..7ceab7b6f
--- /dev/null
+++ b/docs/examples/d880630b6f7dc634c4078293f9cd3d80.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:716
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "size": 2,
+ "sources": [
+ {
+ "date": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "1d",
+ "order": "desc"
+ }
+ }
+ },
+ {
+ "product": {
+ "terms": {
+ "field": "product",
+ "order": "asc"
+ }
+ }
+ }
+ ],
+ "after": {
+ "date": 1494288000000,
+ "product": "mad max"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d88f883ed2fb8be35cd3e72ddffcf4ef.asciidoc b/docs/examples/d88f883ed2fb8be35cd3e72ddffcf4ef.asciidoc
new file mode 100644
index 000000000..262410ea5
--- /dev/null
+++ b/docs/examples/d88f883ed2fb8be35cd3e72ddffcf4ef.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/length-tokenfilter.asciidoc:149
+
+[source, python]
+----
+resp = client.indices.create(
+ index="length_custom_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_length_2_to_10_char": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "length_2_to_10_char"
+ ]
+ }
+ },
+ "filter": {
+ "length_2_to_10_char": {
+ "type": "length",
+ "min": 2,
+ "max": 10
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d89d36741d906a71eca6c144e8d83889.asciidoc b/docs/examples/d89d36741d906a71eca6c144e8d83889.asciidoc
new file mode 100644
index 000000000..66975ea95
--- /dev/null
+++ b/docs/examples/d89d36741d906a71eca6c144e8d83889.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/tasks.asciidoc:237
+
+[source, python]
+----
+resp = client.tasks.cancel(
+ task_id="oTUltX4IQMOUUVeiohTt8A:12345",
+)
+print(resp)
+----
diff --git a/docs/examples/d8a82511cb94f49b4fe4828fee3ba074.asciidoc b/docs/examples/d8a82511cb94f49b4fe4828fee3ba074.asciidoc
new file mode 100644
index 000000000..7f8a3b734
--- /dev/null
+++ b/docs/examples/d8a82511cb94f49b4fe4828fee3ba074.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/circuit-breaker-errors.asciidoc:56
+
+[source, python]
+----
+resp = client.cat.nodes(
+ v=True,
+ h="name,node*,heap*",
+)
+print(resp)
+----
diff --git a/docs/examples/d8c401a5b7359ec65947b9f35ecf6927.asciidoc b/docs/examples/d8c401a5b7359ec65947b9f35ecf6927.asciidoc
new file mode 100644
index 000000000..6ff962766
--- /dev/null
+++ b/docs/examples/d8c401a5b7359ec65947b9f35ecf6927.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/ngram-tokenizer.asciidoc:220
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "my_tokenizer"
+ }
+ },
+ "tokenizer": {
+ "my_tokenizer": {
+ "type": "ngram",
+ "min_gram": 3,
+ "max_gram": 3,
+ "token_chars": [
+ "letter",
+ "digit"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="2 Quick Foxes.",
+)
+print(resp1)
+----
diff --git a/docs/examples/d8ea6a1a1c546bf29f65f8c65439b156.asciidoc b/docs/examples/d8ea6a1a1c546bf29f65f8c65439b156.asciidoc
new file mode 100644
index 000000000..483d1bc42
--- /dev/null
+++ b/docs/examples/d8ea6a1a1c546bf29f65f8c65439b156.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:190
+
+[source, python]
+----
+resp = client.indices.create(
+ index="byte-image-index",
+ mappings={
+ "properties": {
+ "byte-image-vector": {
+ "type": "dense_vector",
+ "element_type": "byte",
+ "dims": 2
+ },
+ "title": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d8fa7ca2ec8dbfa034603ea566e33f5b.asciidoc b/docs/examples/d8fa7ca2ec8dbfa034603ea566e33f5b.asciidoc
new file mode 100644
index 000000000..baa33b757
--- /dev/null
+++ b/docs/examples/d8fa7ca2ec8dbfa034603ea566e33f5b.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/filters-aggregation.asciidoc:208
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ filter_path="aggregations",
+ aggs={
+ "the_filter": {
+ "filters": {
+ "keyed": False,
+ "filters": {
+ "t-shirt": {
+ "term": {
+ "type": "t-shirt"
+ }
+ },
+ "hat": {
+ "term": {
+ "type": "hat"
+ }
+ }
+ }
+ },
+ "aggs": {
+ "avg_price": {
+ "avg": {
+ "field": "price"
+ }
+ },
+ "sort_by_avg_price": {
+ "bucket_sort": {
+ "sort": {
+ "avg_price": "asc"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d93d52b6057a7aff3d0766ca44c505e0.asciidoc b/docs/examples/d93d52b6057a7aff3d0766ca44c505e0.asciidoc
new file mode 100644
index 000000000..d6d263200
--- /dev/null
+++ b/docs/examples/d93d52b6057a7aff3d0766ca44c505e0.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:204
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="my-aliases",
+ template={
+ "aliases": {
+ "my-alias": {}
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.put_index_template(
+ name="my-index-template",
+ index_patterns=[
+ "my-index-*"
+ ],
+ composed_of=[
+ "my-aliases",
+ "my-mappings",
+ "my-settings"
+ ],
+ template={
+ "aliases": {
+ "yet-another-alias": {}
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/d94f666616dea141dcb7aaf08a35bc10.asciidoc b/docs/examples/d94f666616dea141dcb7aaf08a35bc10.asciidoc
new file mode 100644
index 000000000..3bd950073
--- /dev/null
+++ b/docs/examples/d94f666616dea141dcb7aaf08a35bc10.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/keep-types-tokenfilter.asciidoc:94
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ {
+ "type": "keep_types",
+ "types": [
+ ""
+ ],
+ "mode": "exclude"
+ }
+ ],
+ text="1 quick fox 2 lazy dogs",
+)
+print(resp)
+----
diff --git a/docs/examples/d952ac7c73219d8cabc080679e035514.asciidoc b/docs/examples/d952ac7c73219d8cabc080679e035514.asciidoc
new file mode 100644
index 000000000..a676a46eb
--- /dev/null
+++ b/docs/examples/d952ac7c73219d8cabc080679e035514.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/semantic-search/search.asciidoc:34
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ knn={
+ "field": "my_embeddings.predicted_value",
+ "k": 10,
+ "num_candidates": 100,
+ "query_vector_builder": {
+ "text_embedding": {
+ "model_id": "sentence-transformers__msmarco-minilm-l-12-v3",
+ "model_text": "the query string"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d979f934af0992fb8c8596beff80b638.asciidoc b/docs/examples/d979f934af0992fb8c8596beff80b638.asciidoc
new file mode 100644
index 000000000..c13f5b2f8
--- /dev/null
+++ b/docs/examples/d979f934af0992fb8c8596beff80b638.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:530
+
+[source, python]
+----
+resp = client.search(
+ source=[
+ "obj1.*",
+ "obj2.*"
+ ],
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d983c1ea730eeabac9e914656d7c9be2.asciidoc b/docs/examples/d983c1ea730eeabac9e914656d7c9be2.asciidoc
new file mode 100644
index 000000000..9c3f6df1b
--- /dev/null
+++ b/docs/examples/d983c1ea730eeabac9e914656d7c9be2.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1263
+
+[source, python]
+----
+resp = client.indices.create(
+ index="latvian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "latvian_stop": {
+ "type": "stop",
+ "stopwords": "_latvian_"
+ },
+ "latvian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "piemērs"
+ ]
+ },
+ "latvian_stemmer": {
+ "type": "stemmer",
+ "language": "latvian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_latvian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "latvian_stop",
+ "latvian_keywords",
+ "latvian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d98fb2ff2cdd154dff4a576430755d98.asciidoc b/docs/examples/d98fb2ff2cdd154dff4a576430755d98.asciidoc
index 1742a248c..a76e0c4c3 100644
--- a/docs/examples/d98fb2ff2cdd154dff4a576430755d98.asciidoc
+++ b/docs/examples/d98fb2ff2cdd154dff4a576430755d98.asciidoc
@@ -1,27 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1124
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "timestamp": {"type": "date"},
- "temperature": {"type": "long"},
- "voltage": {"type": "double"},
- "node": {"type": "keyword"},
- "voltage_corrected": {
- "type": "double",
- "on_script_error": "fail",
- "script": {
- "source": "\n emit(doc['voltage'].value * params['multiplier'])\n ",
- "params": {"multiplier": 4},
- },
- },
+ mappings={
+ "properties": {
+ "timestamp": {
+ "type": "date"
+ },
+ "temperature": {
+ "type": "long"
+ },
+ "voltage": {
+ "type": "double"
+ },
+ "node": {
+ "type": "keyword"
+ },
+ "voltage_corrected": {
+ "type": "double",
+ "on_script_error": "fail",
+ "script": {
+ "source": "\n emit(doc['voltage'].value * params['multiplier'])\n ",
+ "params": {
+ "multiplier": 4
+ }
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d9a1ad1c5746b75972c74dd4d3a3d623.asciidoc b/docs/examples/d9a1ad1c5746b75972c74dd4d3a3d623.asciidoc
index 190860fcc..8d818af33 100644
--- a/docs/examples/d9a1ad1c5746b75972c74dd4d3a3d623.asciidoc
+++ b/docs/examples/d9a1ad1c5746b75972c74dd4d3a3d623.asciidoc
@@ -1,22 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/parent-join.asciidoc:442
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "my_join_field": {
- "type": "join",
- "relations": {
- "question": ["answer", "comment"],
- "answer": "vote",
- },
+ mappings={
+ "properties": {
+ "my_join_field": {
+ "type": "join",
+ "relations": {
+ "question": [
+ "answer",
+ "comment"
+ ],
+ "answer": "vote"
}
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/d9de409a4a197ce7cbe3714e07155d34.asciidoc b/docs/examples/d9de409a4a197ce7cbe3714e07155d34.asciidoc
new file mode 100644
index 000000000..c876bb23e
--- /dev/null
+++ b/docs/examples/d9de409a4a197ce7cbe3714e07155d34.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/engine.asciidoc:28
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "function_score": {
+ "query": {
+ "match": {
+ "body": "foo"
+ }
+ },
+ "functions": [
+ {
+ "script_score": {
+ "script": {
+ "source": "pure_df",
+ "lang": "expert_scripts",
+ "params": {
+ "field": "body",
+ "term": "foo"
+ }
+ }
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/d9e0cba8e150681d861f5fd1545514e2.asciidoc b/docs/examples/d9e0cba8e150681d861f5fd1545514e2.asciidoc
new file mode 100644
index 000000000..1577b15f7
--- /dev/null
+++ b/docs/examples/d9e0cba8e150681d861f5fd1545514e2.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:513
+
+[source, python]
+----
+resp = client.sql.query(
+ format="txt",
+ query="SELECT YEAR(release_date) AS year FROM library WHERE page_count > ? AND author = ? GROUP BY year HAVING COUNT(*) > ?",
+ params=[
+ 300,
+ "Frank Herbert",
+ 0
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/da0fe1316e5b8fd68e2a8525bcd8b0f6.asciidoc b/docs/examples/da0fe1316e5b8fd68e2a8525bcd8b0f6.asciidoc
new file mode 100644
index 000000000..6670d51f8
--- /dev/null
+++ b/docs/examples/da0fe1316e5b8fd68e2a8525bcd8b0f6.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/recipes/scoring.asciidoc:168
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "bool": {
+ "must": {
+ "match": {
+ "body": "elasticsearch"
+ }
+ },
+ "should": {
+ "rank_feature": {
+ "field": "pagerank",
+ "saturation": {
+ "pivot": 10
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/da18bae37cda566c0254b30c15221b01.asciidoc b/docs/examples/da18bae37cda566c0254b30c15221b01.asciidoc
new file mode 100644
index 000000000..9f1939a58
--- /dev/null
+++ b/docs/examples/da18bae37cda566c0254b30c15221b01.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-service-token-caches.asciidoc:55
+
+[source, python]
+----
+resp = client.security.clear_cached_service_tokens(
+ namespace="elastic",
+ service="fleet-server",
+ name="token1",
+)
+print(resp)
+----
diff --git a/docs/examples/da24c13eee8c9aeae9a23faf80489e31.asciidoc b/docs/examples/da24c13eee8c9aeae9a23faf80489e31.asciidoc
new file mode 100644
index 000000000..d33da60af
--- /dev/null
+++ b/docs/examples/da24c13eee8c9aeae9a23faf80489e31.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:177
+
+[source, python]
+----
+resp = client.indices.delete(
+ index="my-index",
+)
+print(resp)
+
+resp1 = client.reindex(
+ source={
+ "index": "restored-my-index"
+ },
+ dest={
+ "index": "my-index"
+ },
+)
+print(resp1)
+
+resp2 = client.indices.delete_data_stream(
+ name="logs-my_app-default",
+)
+print(resp2)
+
+resp3 = client.reindex(
+ source={
+ "index": "restored-logs-my_app-default"
+ },
+ dest={
+ "index": "logs-my_app-default",
+ "op_type": "create"
+ },
+)
+print(resp3)
+----
diff --git a/docs/examples/da3cecc36a7313385d32c7f52ccfb7e3.asciidoc b/docs/examples/da3cecc36a7313385d32c7f52ccfb7e3.asciidoc
index 5fe27c39e..18e289782 100644
--- a/docs/examples/da3cecc36a7313385d32c7f52ccfb7e3.asciidoc
+++ b/docs/examples/da3cecc36a7313385d32c7f52ccfb7e3.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:816
[source, python]
@@ -5,15 +6,19 @@
resp = client.search(
index="sales",
size="0",
- body={
- "runtime_mappings": {
- "date.day_of_week": {
- "type": "keyword",
- "script": "emit(doc['date'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))",
+ runtime_mappings={
+ "date.day_of_week": {
+ "type": "keyword",
+ "script": "emit(doc['date'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
+ }
+ },
+ aggs={
+ "day_of_week": {
+ "terms": {
+ "field": "date.day_of_week"
}
- },
- "aggs": {"day_of_week": {"terms": {"field": "date.day_of_week"}}},
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/da3f280bc65b581fb3097be768061bee.asciidoc b/docs/examples/da3f280bc65b581fb3097be768061bee.asciidoc
new file mode 100644
index 000000000..7dfabdaa3
--- /dev/null
+++ b/docs/examples/da3f280bc65b581fb3097be768061bee.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/saml-prepare-authentication-api.asciidoc:90
+
+[source, python]
+----
+resp = client.security.saml_prepare_authentication(
+ acs="https://kibana.org/api/security/saml/callback",
+)
+print(resp)
+----
diff --git a/docs/examples/da8db0769dff7305f178c12b1111bc99.asciidoc b/docs/examples/da8db0769dff7305f178c12b1111bc99.asciidoc
new file mode 100644
index 000000000..5a683b93f
--- /dev/null
+++ b/docs/examples/da8db0769dff7305f178c12b1111bc99.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/simple-query-string-query.asciidoc:262
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "simple_query_string": {
+ "query": "this is a test",
+ "fields": [
+ "subject^3",
+ "message"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/da90e457e2a34fe47dd82a0a2f336095.asciidoc b/docs/examples/da90e457e2a34fe47dd82a0a2f336095.asciidoc
new file mode 100644
index 000000000..90369303d
--- /dev/null
+++ b/docs/examples/da90e457e2a34fe47dd82a0a2f336095.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/range-enrich-policy-type-ex.asciidoc:33
+
+[source, python]
+----
+resp = client.index(
+ index="networks",
+ id="1",
+ refresh="wait_for",
+ document={
+ "range": "10.100.0.0/16",
+ "name": "production",
+ "department": "OPS"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/daae2e6acebc84e537764f4ba07f2e6e.asciidoc b/docs/examples/daae2e6acebc84e537764f4ba07f2e6e.asciidoc
new file mode 100644
index 000000000..1205c8e57
--- /dev/null
+++ b/docs/examples/daae2e6acebc84e537764f4ba07f2e6e.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// setup/important-settings/path-settings.asciidoc:95
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.exclude._name": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dabb159e0b3456024889fb9754a10655.asciidoc b/docs/examples/dabb159e0b3456024889fb9754a10655.asciidoc
index b0f2fa8e7..62fdfd15f 100644
--- a/docs/examples/dabb159e0b3456024889fb9754a10655.asciidoc
+++ b/docs/examples/dabb159e0b3456024889fb9754a10655.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:76
[source, python]
----
resp = client.indices.create(
index="example",
- body={"mappings": {"properties": {"geometry": {"type": "shape"}}}},
+ mappings={
+ "properties": {
+ "geometry": {
+ "type": "shape"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/dabcf0bead37cae1d3e5d2813fd3ccfe.asciidoc b/docs/examples/dabcf0bead37cae1d3e5d2813fd3ccfe.asciidoc
index 778338f40..63d3d0e14 100644
--- a/docs/examples/dabcf0bead37cae1d3e5d2813fd3ccfe.asciidoc
+++ b/docs/examples/dabcf0bead37cae1d3e5d2813fd3ccfe.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/ip.asciidoc:143
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={"query": {"query_string": {"query": 'ip_addr:"2001:db8::/48"'}}},
+ query={
+ "query_string": {
+ "query": "ip_addr:\"2001:db8::/48\""
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/dac8ec8547bc446637fd97d9fa872f4f.asciidoc b/docs/examples/dac8ec8547bc446637fd97d9fa872f4f.asciidoc
new file mode 100644
index 000000000..d5957ecad
--- /dev/null
+++ b/docs/examples/dac8ec8547bc446637fd97d9fa872f4f.asciidoc
@@ -0,0 +1,84 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/put-dfanalytics.asciidoc:816
+
+[source, python]
+----
+resp = client.ml.put_data_frame_analytics(
+ id="flight_prices",
+ source={
+ "index": [
+ "kibana_sample_data_flights"
+ ]
+ },
+ dest={
+ "index": "kibana_sample_flight_prices"
+ },
+ analysis={
+ "regression": {
+ "dependent_variable": "AvgTicketPrice",
+ "num_top_feature_importance_values": 2,
+ "feature_processors": [
+ {
+ "frequency_encoding": {
+ "field": "DestWeather",
+ "feature_name": "DestWeather_frequency",
+ "frequency_map": {
+ "Rain": 0.14604811155570188,
+ "Heavy Fog": 0.14604811155570188,
+ "Thunder & Lightning": 0.14604811155570188,
+ "Cloudy": 0.14604811155570188,
+ "Damaging Wind": 0.14604811155570188,
+ "Hail": 0.14604811155570188,
+ "Sunny": 0.14604811155570188,
+ "Clear": 0.14604811155570188
+ }
+ }
+ },
+ {
+ "target_mean_encoding": {
+ "field": "DestWeather",
+ "feature_name": "DestWeather_targetmean",
+ "target_map": {
+ "Rain": 626.5588814585794,
+ "Heavy Fog": 626.5588814585794,
+ "Thunder & Lightning": 626.5588814585794,
+ "Hail": 626.5588814585794,
+ "Damaging Wind": 626.5588814585794,
+ "Cloudy": 626.5588814585794,
+ "Clear": 626.5588814585794,
+ "Sunny": 626.5588814585794
+ },
+ "default_value": 624.0249512020454
+ }
+ },
+ {
+ "one_hot_encoding": {
+ "field": "DestWeather",
+ "hot_map": {
+ "Rain": "DestWeather_Rain",
+ "Heavy Fog": "DestWeather_Heavy Fog",
+ "Thunder & Lightning": "DestWeather_Thunder & Lightning",
+ "Cloudy": "DestWeather_Cloudy",
+ "Damaging Wind": "DestWeather_Damaging Wind",
+ "Hail": "DestWeather_Hail",
+ "Clear": "DestWeather_Clear",
+ "Sunny": "DestWeather_Sunny"
+ }
+ }
+ }
+ ]
+ }
+ },
+ analyzed_fields={
+ "includes": [
+ "AvgTicketPrice",
+ "Cancelled",
+ "DestWeather",
+ "FlightDelayMin",
+ "DistanceMiles"
+ ]
+ },
+ model_memory_limit="30mb",
+)
+print(resp)
+----
diff --git a/docs/examples/dad2d4add751fde5c39475ca709cc14b.asciidoc b/docs/examples/dad2d4add751fde5c39475ca709cc14b.asciidoc
index a78af005f..9ffe5f11e 100644
--- a/docs/examples/dad2d4add751fde5c39475ca709cc14b.asciidoc
+++ b/docs/examples/dad2d4add751fde5c39475ca709cc14b.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/allocation/filtering.asciidoc:54
[source, python]
----
resp = client.indices.put_settings(
index="test",
- body={"index.routing.allocation.include.size": "big,medium"},
+ settings={
+ "index.routing.allocation.include.size": "big,medium"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/dadb69a225778ecd6528924c0aa029bb.asciidoc b/docs/examples/dadb69a225778ecd6528924c0aa029bb.asciidoc
new file mode 100644
index 000000000..49164858f
--- /dev/null
+++ b/docs/examples/dadb69a225778ecd6528924c0aa029bb.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:85
+
+[source, python]
+----
+resp = client.indices.create(
+ index="image-index",
+ mappings={
+ "properties": {
+ "image-vector": {
+ "type": "dense_vector",
+ "dims": 3,
+ "similarity": "l2_norm"
+ },
+ "title-vector": {
+ "type": "dense_vector",
+ "dims": 5,
+ "similarity": "l2_norm"
+ },
+ "title": {
+ "type": "text"
+ },
+ "file-type": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dae57cf7df18adb4dc64426eb159733a.asciidoc b/docs/examples/dae57cf7df18adb4dc64426eb159733a.asciidoc
new file mode 100644
index 000000000..ef09d59ad
--- /dev/null
+++ b/docs/examples/dae57cf7df18adb4dc64426eb159733a.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/percentile-aggregation.asciidoc:370
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ aggs={
+ "load_time_outlier": {
+ "percentiles": {
+ "field": "load_time",
+ "percents": [
+ 95,
+ 99,
+ 99.9
+ ],
+ "hdr": {
+ "number_of_significant_value_digits": 3
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/daf5631eba5285f1b929d5d8d8dc0d50.asciidoc b/docs/examples/daf5631eba5285f1b929d5d8d8dc0d50.asciidoc
new file mode 100644
index 000000000..3beec7886
--- /dev/null
+++ b/docs/examples/daf5631eba5285f1b929d5d8d8dc0d50.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/uaxurlemail-tokenizer.asciidoc:95
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "my_tokenizer"
+ }
+ },
+ "tokenizer": {
+ "my_tokenizer": {
+ "type": "uax_url_email",
+ "max_token_length": 5
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.analyze(
+ index="my-index-000001",
+ analyzer="my_analyzer",
+ text="john.smith@global-international.com",
+)
+print(resp1)
+----
diff --git a/docs/examples/db19cc7a26ca80106d86d688f4be67a8.asciidoc b/docs/examples/db19cc7a26ca80106d86d688f4be67a8.asciidoc
new file mode 100644
index 000000000..707ba862c
--- /dev/null
+++ b/docs/examples/db19cc7a26ca80106d86d688f4be67a8.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/stop-dfanalytics.asciidoc:69
+
+[source, python]
+----
+resp = client.ml.stop_data_frame_analytics(
+ id="loganalytics",
+)
+print(resp)
+----
diff --git a/docs/examples/db773f690edf659ac9b044dc854c77eb.asciidoc b/docs/examples/db773f690edf659ac9b044dc854c77eb.asciidoc
new file mode 100644
index 000000000..b579ccc7f
--- /dev/null
+++ b/docs/examples/db773f690edf659ac9b044dc854c77eb.asciidoc
@@ -0,0 +1,78 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-vector-tile-api.asciidoc:666
+
+[source, python]
+----
+resp = client.indices.create(
+ index="museums",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ },
+ "name": {
+ "type": "keyword"
+ },
+ "price": {
+ "type": "long"
+ },
+ "included": {
+ "type": "boolean"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="museums",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "1"
+ }
+ },
+ {
+ "location": "POINT (4.912350 52.374081)",
+ "name": "NEMO Science Museum",
+ "price": 1750,
+ "included": True
+ },
+ {
+ "index": {
+ "_id": "2"
+ }
+ },
+ {
+ "location": "POINT (4.901618 52.369219)",
+ "name": "Museum Het Rembrandthuis",
+ "price": 1500,
+ "included": False
+ },
+ {
+ "index": {
+ "_id": "3"
+ }
+ },
+ {
+ "location": "POINT (4.914722 52.371667)",
+ "name": "Nederlands Scheepvaartmuseum",
+ "price": 1650,
+ "included": True
+ },
+ {
+ "index": {
+ "_id": "4"
+ }
+ },
+ {
+ "location": "POINT (4.914722 52.371667)",
+ "name": "Amsterdam Centre for Architecture",
+ "price": 0,
+ "included": True
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/db8710a9793ae0817a45892d33468160.asciidoc b/docs/examples/db8710a9793ae0817a45892d33468160.asciidoc
new file mode 100644
index 000000000..ec6ab218d
--- /dev/null
+++ b/docs/examples/db8710a9793ae0817a45892d33468160.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/diskusage.asciidoc:69
+
+[source, python]
+----
+resp = client.indices.disk_usage(
+ index="my-index-000001",
+ run_expensive_tasks=True,
+)
+print(resp)
+----
diff --git a/docs/examples/db879dcf70abc4a9a14063a9a2d8d6f5.asciidoc b/docs/examples/db879dcf70abc4a9a14063a9a2d8d6f5.asciidoc
new file mode 100644
index 000000000..c6a5c9ea8
--- /dev/null
+++ b/docs/examples/db879dcf70abc4a9a14063a9a2d8d6f5.asciidoc
@@ -0,0 +1,93 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geohashgrid-aggregation.asciidoc:27
+
+[source, python]
+----
+resp = client.indices.create(
+ index="museums",
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="museums",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": 1
+ }
+ },
+ {
+ "location": "POINT (4.912350 52.374081)",
+ "name": "NEMO Science Museum"
+ },
+ {
+ "index": {
+ "_id": 2
+ }
+ },
+ {
+ "location": "POINT (4.901618 52.369219)",
+ "name": "Museum Het Rembrandthuis"
+ },
+ {
+ "index": {
+ "_id": 3
+ }
+ },
+ {
+ "location": "POINT (4.914722 52.371667)",
+ "name": "Nederlands Scheepvaartmuseum"
+ },
+ {
+ "index": {
+ "_id": 4
+ }
+ },
+ {
+ "location": "POINT (4.405200 51.222900)",
+ "name": "Letterenhuis"
+ },
+ {
+ "index": {
+ "_id": 5
+ }
+ },
+ {
+ "location": "POINT (2.336389 48.861111)",
+ "name": "Musée du Louvre"
+ },
+ {
+ "index": {
+ "_id": 6
+ }
+ },
+ {
+ "location": "POINT (2.327000 48.860000)",
+ "name": "Musée d'Orsay"
+ }
+ ],
+)
+print(resp1)
+
+resp2 = client.search(
+ index="museums",
+ size="0",
+ aggregations={
+ "large-grid": {
+ "geohash_grid": {
+ "field": "location",
+ "precision": 3
+ }
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/db9a8e3edee7c9a96ea0875fd4bbaa69.asciidoc b/docs/examples/db9a8e3edee7c9a96ea0875fd4bbaa69.asciidoc
new file mode 100644
index 000000000..c259d47ff
--- /dev/null
+++ b/docs/examples/db9a8e3edee7c9a96ea0875fd4bbaa69.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// monitoring/collecting-monitoring-data.asciidoc:45
+
+[source, python]
+----
+resp = client.cluster.get_settings()
+print(resp)
+----
diff --git a/docs/examples/dbc50b8c934171e94604575a8b36f349.asciidoc b/docs/examples/dbc50b8c934171e94604575a8b36f349.asciidoc
index 787b46572..77af53991 100644
--- a/docs/examples/dbc50b8c934171e94604575a8b36f349.asciidoc
+++ b/docs/examples/dbc50b8c934171e94604575a8b36f349.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// indices/update-settings.asciidoc:145
[source, python]
@@ -7,4 +8,4 @@ resp = client.indices.forcemerge(
max_num_segments="5",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/dbcd8892dd01c43d5a60c94173574faf.asciidoc b/docs/examples/dbcd8892dd01c43d5a60c94173574faf.asciidoc
new file mode 100644
index 000000000..ca368e75a
--- /dev/null
+++ b/docs/examples/dbcd8892dd01c43d5a60c94173574faf.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/range-field-note.asciidoc:12
+
+[source, python]
+----
+resp = client.indices.create(
+ index="range_index",
+ settings={
+ "number_of_shards": 2
+ },
+ mappings={
+ "properties": {
+ "expected_attendees": {
+ "type": "integer_range"
+ },
+ "time_frame": {
+ "type": "date_range",
+ "format": "yyyy-MM-dd||epoch_millis"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="range_index",
+ id="1",
+ refresh=True,
+ document={
+ "expected_attendees": {
+ "gte": 10,
+ "lte": 20
+ },
+ "time_frame": {
+ "gte": "2019-10-28",
+ "lte": "2019-11-04"
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/dbd1b930782d34d7396fdb2db1216c0d.asciidoc b/docs/examples/dbd1b930782d34d7396fdb2db1216c0d.asciidoc
new file mode 100644
index 000000000..092335a6f
--- /dev/null
+++ b/docs/examples/dbd1b930782d34d7396fdb2db1216c0d.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/ids-query.asciidoc:13
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "ids": {
+ "values": [
+ "1",
+ "4",
+ "100"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dbdd58cdeac9ef20b42ff73e4864e697.asciidoc b/docs/examples/dbdd58cdeac9ef20b42ff73e4864e697.asciidoc
new file mode 100644
index 000000000..9371ae3f1
--- /dev/null
+++ b/docs/examples/dbdd58cdeac9ef20b42ff73e4864e697.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-field-mapping.asciidoc:245
+
+[source, python]
+----
+resp = client.indices.get_field_mapping(
+ index="_all",
+ fields="*.id",
+)
+print(resp)
+----
diff --git a/docs/examples/dbf93d02ab86a09929a21232b19709cc.asciidoc b/docs/examples/dbf93d02ab86a09929a21232b19709cc.asciidoc
index 165dcd621..bbdbc2287 100644
--- a/docs/examples/dbf93d02ab86a09929a21232b19709cc.asciidoc
+++ b/docs/examples/dbf93d02ab86a09929a21232b19709cc.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/stop-trained-model-deployment.asciidoc:67
[source, python]
@@ -6,4 +7,4 @@ resp = client.ml.stop_trained_model_deployment(
model_id="my_model_for_search",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/dbf9abc37899352751dab0ede62af2fd.asciidoc b/docs/examples/dbf9abc37899352751dab0ede62af2fd.asciidoc
new file mode 100644
index 000000000..eeccebacc
--- /dev/null
+++ b/docs/examples/dbf9abc37899352751dab0ede62af2fd.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-tokens.asciidoc:115
+
+[source, python]
+----
+resp = client.security.invalidate_token(
+ token="dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
+)
+print(resp)
+----
diff --git a/docs/examples/dc33160f4087443f867080a8f5b2cfbd.asciidoc b/docs/examples/dc33160f4087443f867080a8f5b2cfbd.asciidoc
new file mode 100644
index 000000000..2cc88b81d
--- /dev/null
+++ b/docs/examples/dc33160f4087443f867080a8f5b2cfbd.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-rest.asciidoc:176
+
+[source, python]
+----
+resp = client.esql.query(
+ format="json",
+ query="\n FROM library\n | KEEP author, name, page_count, release_date\n | SORT page_count DESC\n | LIMIT 5\n ",
+ columnar=True,
+)
+print(resp)
+----
diff --git a/docs/examples/dc3b7603e7d688106acb804059af7834.asciidoc b/docs/examples/dc3b7603e7d688106acb804059af7834.asciidoc
new file mode 100644
index 000000000..76b8fb01b
--- /dev/null
+++ b/docs/examples/dc3b7603e7d688106acb804059af7834.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:496
+
+[source, python]
+----
+resp = client.search(
+ source=False,
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dc468865da947b4a9136a5b92878d918.asciidoc b/docs/examples/dc468865da947b4a9136a5b92878d918.asciidoc
new file mode 100644
index 000000000..856c3b54b
--- /dev/null
+++ b/docs/examples/dc468865da947b4a9136a5b92878d918.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/bulk-update-api-keys.asciidoc:125
+
+[source, python]
+----
+resp = client.security.create_api_key(
+ name="my-other-api-key",
+ metadata={
+ "application": "my-application",
+ "environment": {
+ "level": 2,
+ "trusted": True,
+ "tags": [
+ "dev",
+ "staging"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dc4dcfeae8a5f248639335c2c9809549.asciidoc b/docs/examples/dc4dcfeae8a5f248639335c2c9809549.asciidoc
new file mode 100644
index 000000000..c13962880
--- /dev/null
+++ b/docs/examples/dc4dcfeae8a5f248639335c2c9809549.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/pathhierarchy-tokenizer.asciidoc:17
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="path_hierarchy",
+ text="/one/two/three",
+)
+print(resp)
+----
diff --git a/docs/examples/dc8c94c9bef1f879282caea5c406f36e.asciidoc b/docs/examples/dc8c94c9bef1f879282caea5c406f36e.asciidoc
new file mode 100644
index 000000000..9e0d71ce6
--- /dev/null
+++ b/docs/examples/dc8c94c9bef1f879282caea5c406f36e.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:183
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="keyword",
+ filter=[
+ "lowercase"
+ ],
+ char_filter=[
+ "html_strip"
+ ],
+ text="this is a test",
+)
+print(resp)
+----
diff --git a/docs/examples/dcc02ad69da0a5aa10c4e53b34be8ec0.asciidoc b/docs/examples/dcc02ad69da0a5aa10c4e53b34be8ec0.asciidoc
new file mode 100644
index 000000000..d5a65b419
--- /dev/null
+++ b/docs/examples/dcc02ad69da0a5aa10c4e53b34be8ec0.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/multi-get.asciidoc:10
+
+[source, python]
+----
+resp = client.mget(
+ docs=[
+ {
+ "_index": "my-index-000001",
+ "_id": "1"
+ },
+ {
+ "_index": "my-index-000001",
+ "_id": "2"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/dcee24dba43050e4b01b6e3a3211ce09.asciidoc b/docs/examples/dcee24dba43050e4b01b6e3a3211ce09.asciidoc
index 0f01fe413..21686169d 100644
--- a/docs/examples/dcee24dba43050e4b01b6e3a3211ce09.asciidoc
+++ b/docs/examples/dcee24dba43050e4b01b6e3a3211ce09.asciidoc
@@ -1,20 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1283
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "@timestamp": {
- "format": "strict_date_optional_time||epoch_second",
- "type": "date",
- },
- "message": {"type": "wildcard"},
+ mappings={
+ "properties": {
+ "@timestamp": {
+ "format": "strict_date_optional_time||epoch_second",
+ "type": "date"
+ },
+ "message": {
+ "type": "wildcard"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/dcfa7f479a33f459a2d222a92e651451.asciidoc b/docs/examples/dcfa7f479a33f459a2d222a92e651451.asciidoc
new file mode 100644
index 000000000..a52fb6c46
--- /dev/null
+++ b/docs/examples/dcfa7f479a33f459a2d222a92e651451.asciidoc
@@ -0,0 +1,50 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-roles.asciidoc:107
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="my_admin_role",
+ description="Grants full access to all management features within the cluster.",
+ cluster=[
+ "all"
+ ],
+ indices=[
+ {
+ "names": [
+ "index1",
+ "index2"
+ ],
+ "privileges": [
+ "all"
+ ],
+ "field_security": {
+ "grant": [
+ "title",
+ "body"
+ ]
+ },
+ "query": "{\"match\": {\"title\": \"foo\"}}"
+ }
+ ],
+ applications=[
+ {
+ "application": "myapp",
+ "privileges": [
+ "admin",
+ "read"
+ ],
+ "resources": [
+ "*"
+ ]
+ }
+ ],
+ run_as=[
+ "other_user"
+ ],
+ metadata={
+ "version": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dd0b196a099e1cca08c5ce4dd74e935a.asciidoc b/docs/examples/dd0b196a099e1cca08c5ce4dd74e935a.asciidoc
new file mode 100644
index 000000000..95af9d000
--- /dev/null
+++ b/docs/examples/dd0b196a099e1cca08c5ce4dd74e935a.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/example-watches/example-watch-clusterstatus.asciidoc:27
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="cluster_health_watch",
+ trigger={
+ "schedule": {
+ "interval": "10s"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dd1a25d821d0c8deaeaa9c8083152a54.asciidoc b/docs/examples/dd1a25d821d0c8deaeaa9c8083152a54.asciidoc
new file mode 100644
index 000000000..f00597f0c
--- /dev/null
+++ b/docs/examples/dd1a25d821d0c8deaeaa9c8083152a54.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/grok.asciidoc:293
+
+[source, python]
+----
+resp = client.ingest.processor_grok(
+ s=True,
+)
+print(resp)
+----
diff --git a/docs/examples/dd3b263e9fa4226e59bedfc957d399d2.asciidoc b/docs/examples/dd3b263e9fa4226e59bedfc957d399d2.asciidoc
new file mode 100644
index 000000000..38b128318
--- /dev/null
+++ b/docs/examples/dd3b263e9fa4226e59bedfc957d399d2.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/getting-started.asciidoc:22
+
+[source, python]
+----
+resp = client.sql.query(
+ format="txt",
+ query="SELECT * FROM library WHERE release_date < '2000-01-01'",
+)
+print(resp)
+----
diff --git a/docs/examples/dd4f051ab62f0507e3b6e3d6f333e85f.asciidoc b/docs/examples/dd4f051ab62f0507e3b6e3d6f333e85f.asciidoc
new file mode 100644
index 000000000..bbab73fed
--- /dev/null
+++ b/docs/examples/dd4f051ab62f0507e3b6e3d6f333e85f.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-component-template.asciidoc:95
+
+[source, python]
+----
+resp = client.cluster.get_component_template()
+print(resp)
+----
diff --git a/docs/examples/dd71b0c9f9197684ff29c61062c55660.asciidoc b/docs/examples/dd71b0c9f9197684ff29c61062c55660.asciidoc
new file mode 100644
index 000000000..9c29e08a5
--- /dev/null
+++ b/docs/examples/dd71b0c9f9197684ff29c61062c55660.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-settings.asciidoc:32
+
+[source, python]
+----
+resp = client.security.get_settings()
+print(resp)
+----
diff --git a/docs/examples/dd792bb53703a57f9207e36d16e26255.asciidoc b/docs/examples/dd792bb53703a57f9207e36d16e26255.asciidoc
index cae554f0a..a37ac7dc1 100644
--- a/docs/examples/dd792bb53703a57f9207e36d16e26255.asciidoc
+++ b/docs/examples/dd792bb53703a57f9207e36d16e26255.asciidoc
@@ -1,54 +1,67 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:1164
[source, python]
----
resp = client.bulk(
index="my-index-000001",
- refresh="true",
- body=[
- {"index": {}},
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
{
"timestamp": 1516729294000,
"temperature": 200,
"voltage": 5.2,
- "node": "a",
+ "node": "a"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": 1516642894000,
"temperature": 201,
"voltage": 5.8,
- "node": "b",
+ "node": "b"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": 1516556494000,
"temperature": 202,
"voltage": 5.1,
- "node": "a",
+ "node": "a"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": 1516470094000,
"temperature": 198,
"voltage": 5.6,
- "node": "b",
+ "node": "b"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": 1516383694000,
"temperature": 200,
"voltage": 4.2,
- "node": "c",
+ "node": "c"
+ },
+ {
+ "index": {}
},
- {"index": {}},
{
"timestamp": 1516297294000,
"temperature": 202,
"voltage": 4,
- "node": "c",
- },
+ "node": "c"
+ }
],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/dda949d20d07a9edbe64cefc623df945.asciidoc b/docs/examples/dda949d20d07a9edbe64cefc623df945.asciidoc
new file mode 100644
index 000000000..744a4739f
--- /dev/null
+++ b/docs/examples/dda949d20d07a9edbe64cefc623df945.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:467
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my_test_scores",
+ properties={
+ "total_score": {
+ "type": "long"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ddcfa47381d47078dbec651e31b69949.asciidoc b/docs/examples/ddcfa47381d47078dbec651e31b69949.asciidoc
new file mode 100644
index 000000000..18f91c7e6
--- /dev/null
+++ b/docs/examples/ddcfa47381d47078dbec651e31b69949.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/detect-threats-with-eql.asciidoc:209
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n library where process.name == \"regsvr32.exe\" and dll.name == \"scrobj.dll\"\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/dddb6a6ebd145f8411c5b4910d332f87.asciidoc b/docs/examples/dddb6a6ebd145f8411c5b4910d332f87.asciidoc
new file mode 100644
index 000000000..534bd51fb
--- /dev/null
+++ b/docs/examples/dddb6a6ebd145f8411c5b4910d332f87.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/multivalued-fields.asciidoc:186
+
+[source, python]
+----
+resp = client.esql.query(
+ query="FROM mv | EVAL b + 2, a + b | LIMIT 4",
+)
+print(resp)
+----
diff --git a/docs/examples/dde283eab92608e7bfbfa09c6482a12e.asciidoc b/docs/examples/dde283eab92608e7bfbfa09c6482a12e.asciidoc
new file mode 100644
index 000000000..c8f32431a
--- /dev/null
+++ b/docs/examples/dde283eab92608e7bfbfa09c6482a12e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-api-keys.asciidoc:134
+
+[source, python]
+----
+resp = client.security.invalidate_api_key(
+ realm_name="native1",
+)
+print(resp)
+----
diff --git a/docs/examples/ddf375e4b6175d830fa4097ea0b41536.asciidoc b/docs/examples/ddf375e4b6175d830fa4097ea0b41536.asciidoc
new file mode 100644
index 000000000..ca50fe2d1
--- /dev/null
+++ b/docs/examples/ddf375e4b6175d830fa4097ea0b41536.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/delete-desired-nodes.asciidoc:55
+
+[source, python]
+----
+resp = client.perform_request(
+ "DELETE",
+ "/_internal/desired_nodes",
+)
+print(resp)
+----
diff --git a/docs/examples/ddf56782ecc7eaeb3115e150c4830013.asciidoc b/docs/examples/ddf56782ecc7eaeb3115e150c4830013.asciidoc
index 426c893d9..c21a7216f 100644
--- a/docs/examples/ddf56782ecc7eaeb3115e150c4830013.asciidoc
+++ b/docs/examples/ddf56782ecc7eaeb3115e150c4830013.asciidoc
@@ -1,22 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:585
[source, python]
----
resp = client.update_by_query(
index="my-index-000001",
- body={
- "slice": {"id": 0, "max": 2},
- "script": {"source": "ctx._source['extra'] = 'test'"},
+ slice={
+ "id": 0,
+ "max": 2
+ },
+ script={
+ "source": "ctx._source['extra'] = 'test'"
},
)
print(resp)
-resp = client.update_by_query(
+resp1 = client.update_by_query(
index="my-index-000001",
- body={
- "slice": {"id": 1, "max": 2},
- "script": {"source": "ctx._source['extra'] = 'test'"},
+ slice={
+ "id": 1,
+ "max": 2
+ },
+ script={
+ "source": "ctx._source['extra'] = 'test'"
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/de139866a220124360e5e27d1a736ea4.asciidoc b/docs/examples/de139866a220124360e5e27d1a736ea4.asciidoc
new file mode 100644
index 000000000..a65c0590d
--- /dev/null
+++ b/docs/examples/de139866a220124360e5e27d1a736ea4.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:286
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "term": {
+ "product": "chocolate"
+ }
+ },
+ sort=[
+ {
+ "offer.price": {
+ "mode": "avg",
+ "order": "asc",
+ "nested": {
+ "path": "offer",
+ "filter": {
+ "term": {
+ "offer.color": "blue"
+ }
+ }
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/de2f59887737de3a27716177b60393a2.asciidoc b/docs/examples/de2f59887737de3a27716177b60393a2.asciidoc
new file mode 100644
index 000000000..12fb371a6
--- /dev/null
+++ b/docs/examples/de2f59887737de3a27716177b60393a2.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:239
+
+[source, python]
+----
+resp = client.indices.analyze(
+ index="analyze_sample",
+ field="obj1.field1",
+ text="this is a test",
+)
+print(resp)
+----
diff --git a/docs/examples/de876505acc75d371d1f6f484c449197.asciidoc b/docs/examples/de876505acc75d371d1f6f484c449197.asciidoc
index 9672928f5..c3fb4ff3c 100644
--- a/docs/examples/de876505acc75d371d1f6f484c449197.asciidoc
+++ b/docs/examples/de876505acc75d371d1f6f484c449197.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// indices/create-index.asciidoc:251
[source, python]
----
resp = client.indices.create(
index="test",
- body={"settings": {"index.write.wait_for_active_shards": "2"}},
+ settings={
+ "index.write.wait_for_active_shards": "2"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/de90249caeac6f1601a7e7e9f98f1bec.asciidoc b/docs/examples/de90249caeac6f1601a7e7e9f98f1bec.asciidoc
new file mode 100644
index 000000000..70c2d979b
--- /dev/null
+++ b/docs/examples/de90249caeac6f1601a7e7e9f98f1bec.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-api-key.asciidoc:395
+
+[source, python]
+----
+resp = client.security.query_api_keys(
+ with_limited_by=True,
+ query={
+ "ids": {
+ "values": [
+ "VuaCfGcBCdbkQm-e5aOx"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dea22bb4997e368950f0fc80f2a5f304.asciidoc b/docs/examples/dea22bb4997e368950f0fc80f2a5f304.asciidoc
index 4b75ec23c..31eb1c7e4 100644
--- a/docs/examples/dea22bb4997e368950f0fc80f2a5f304.asciidoc
+++ b/docs/examples/dea22bb4997e368950f0fc80f2a5f304.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/explicit-mapping.asciidoc:123
[source, python]
@@ -7,4 +8,4 @@ resp = client.indices.get_field_mapping(
fields="employee-id",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/dea4ac54c63a10c62eccd7b7f6543b86.asciidoc b/docs/examples/dea4ac54c63a10c62eccd7b7f6543b86.asciidoc
new file mode 100644
index 000000000..dcef634ed
--- /dev/null
+++ b/docs/examples/dea4ac54c63a10c62eccd7b7f6543b86.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/context-suggest.asciidoc:100
+
+[source, python]
+----
+resp = client.index(
+ index="place",
+ id="1",
+ document={
+ "suggest": {
+ "input": [
+ "timmy's",
+ "starbucks",
+ "dunkin donuts"
+ ],
+ "contexts": {
+ "place_type": [
+ "cafe",
+ "food"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dead0682932ea6ec33c1197017bcb209.asciidoc b/docs/examples/dead0682932ea6ec33c1197017bcb209.asciidoc
new file mode 100644
index 000000000..822cb483b
--- /dev/null
+++ b/docs/examples/dead0682932ea6ec33c1197017bcb209.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-bounding-box-query.asciidoc:295
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_bounding_box": {
+ "pin.location": {
+ "top_left": "dr5r9ydj2y73",
+ "bottom_right": "drj7teegpus6"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dec2af498a7e5892e8fcd09ae779c8f0.asciidoc b/docs/examples/dec2af498a7e5892e8fcd09ae779c8f0.asciidoc
new file mode 100644
index 000000000..5e12085c2
--- /dev/null
+++ b/docs/examples/dec2af498a7e5892e8fcd09ae779c8f0.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/iprange-aggregation.asciidoc:61
+
+[source, python]
+----
+resp = client.search(
+ index="ip_addresses",
+ size=0,
+ aggs={
+ "ip_ranges": {
+ "ip_range": {
+ "field": "ip",
+ "ranges": [
+ {
+ "mask": "10.0.0.0/25"
+ },
+ {
+ "mask": "10.0.0.127/25"
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dee3023098d9e63aa9e113beea5686da.asciidoc b/docs/examples/dee3023098d9e63aa9e113beea5686da.asciidoc
new file mode 100644
index 000000000..07fceb7db
--- /dev/null
+++ b/docs/examples/dee3023098d9e63aa9e113beea5686da.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:789
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my_search_application",
+ search_application={
+ "indices": [
+ "index1"
+ ],
+ "template": {
+ "script": {
+ "lang": "mustache",
+ "source": "\n {\n \"knn\": {\n \"field\": \"{{knn_field}}\",\n \"query_vector\": {{#toJson}}query_vector{{/toJson}},\n \"k\": \"{{k}}\",\n \"num_candidates\": {{num_candidates}}\n },\n \"fields\": {{#toJson}}fields{{/toJson}}\n }\n ",
+ "params": {
+ "knn_field": "image-vector",
+ "query_vector": [],
+ "k": 10,
+ "num_candidates": 100,
+ "fields": [
+ "title",
+ "file-type"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/df04e2e9af66d5e30b1bfdbd458cab13.asciidoc b/docs/examples/df04e2e9af66d5e30b1bfdbd458cab13.asciidoc
new file mode 100644
index 000000000..9855d9a99
--- /dev/null
+++ b/docs/examples/df04e2e9af66d5e30b1bfdbd458cab13.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/size-your-shards.asciidoc:237
+
+[source, python]
+----
+resp = client.cat.nodes(
+ v=True,
+ h="heap.max",
+)
+print(resp)
+----
diff --git a/docs/examples/df0d27d3abd286b75aef7ddcf0e6c66c.asciidoc b/docs/examples/df0d27d3abd286b75aef7ddcf0e6c66c.asciidoc
new file mode 100644
index 000000000..4d21c00df
--- /dev/null
+++ b/docs/examples/df0d27d3abd286b75aef7ddcf0e6c66c.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/apis/reload-analyzers.asciidoc:110
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "index": {
+ "analysis": {
+ "analyzer": {
+ "my_synonyms": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "synonym"
+ ]
+ }
+ },
+ "filter": {
+ "synonym": {
+ "type": "synonym_graph",
+ "synonyms_path": "analysis/synonym.txt",
+ "updateable": True
+ }
+ }
+ }
+ }
+ },
+ mappings={
+ "properties": {
+ "text": {
+ "type": "text",
+ "analyzer": "standard",
+ "search_analyzer": "my_synonyms"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/df103a3df9b353357e72f9180ef421a1.asciidoc b/docs/examples/df103a3df9b353357e72f9180ef421a1.asciidoc
new file mode 100644
index 000000000..6f5c164ab
--- /dev/null
+++ b/docs/examples/df103a3df9b353357e72f9180ef421a1.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/rare-terms-aggregation.asciidoc:280
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "genres": {
+ "rare_terms": {
+ "field": "genre",
+ "include": "swi*",
+ "exclude": "electro*"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/df1336e768fb6fc1826a5afa30a57285.asciidoc b/docs/examples/df1336e768fb6fc1826a5afa30a57285.asciidoc
new file mode 100644
index 000000000..679646b1e
--- /dev/null
+++ b/docs/examples/df1336e768fb6fc1826a5afa30a57285.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:61
+
+[source, python]
+----
+resp = client.index(
+ index="my-data-stream",
+ document={
+ "@timestamp": "2099-03-08T11:06:07.000Z",
+ "user": {
+ "id": "8a4f500d"
+ },
+ "message": "Login successful"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc b/docs/examples/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc
index 272cfa284..07e3b1de7 100644
--- a/docs/examples/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc
+++ b/docs/examples/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc
@@ -1,53 +1,83 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/nested-query.asciidoc:298
[source, python]
----
resp = client.indices.create(
index="my-index",
- body={"mappings": {"properties": {"comments": {"type": "nested"}}}},
+ mappings={
+ "properties": {
+ "comments": {
+ "type": "nested"
+ }
+ }
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index",
id="1",
- refresh="true",
- body={"comments": [{"author": "kimchy"}]},
+ refresh=True,
+ document={
+ "comments": [
+ {
+ "author": "kimchy"
+ }
+ ]
+ },
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="my-index",
id="2",
- refresh="true",
- body={"comments": [{"author": "kimchy"}, {"author": "nik9000"}]},
+ refresh=True,
+ document={
+ "comments": [
+ {
+ "author": "kimchy"
+ },
+ {
+ "author": "nik9000"
+ }
+ ]
+ },
)
-print(resp)
+print(resp2)
-resp = client.index(
+resp3 = client.index(
index="my-index",
id="3",
- refresh="true",
- body={"comments": [{"author": "nik9000"}]},
+ refresh=True,
+ document={
+ "comments": [
+ {
+ "author": "nik9000"
+ }
+ ]
+ },
)
-print(resp)
+print(resp3)
-resp = client.search(
+resp4 = client.search(
index="my-index",
- body={
- "query": {
- "nested": {
- "path": "comments",
- "query": {
- "bool": {
- "must_not": [
- {"term": {"comments.author": "nik9000"}}
- ]
- }
- },
+ query={
+ "nested": {
+ "path": "comments",
+ "query": {
+ "bool": {
+ "must_not": [
+ {
+ "term": {
+ "comments.author": "nik9000"
+ }
+ }
+ ]
+ }
}
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp4)
+----
diff --git a/docs/examples/df7dbac966b67404b8bfa9cdda5ef480.asciidoc b/docs/examples/df7dbac966b67404b8bfa9cdda5ef480.asciidoc
new file mode 100644
index 000000000..ffbfb83ee
--- /dev/null
+++ b/docs/examples/df7dbac966b67404b8bfa9cdda5ef480.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/ack-watch.asciidoc:253
+
+[source, python]
+----
+resp = client.watcher.ack_watch(
+ watch_id="my_watch",
+)
+print(resp)
+----
diff --git a/docs/examples/df7ed126d8c92ddd3655c59ce4f305c9.asciidoc b/docs/examples/df7ed126d8c92ddd3655c59ce4f305c9.asciidoc
new file mode 100644
index 000000000..3c77d1754
--- /dev/null
+++ b/docs/examples/df7ed126d8c92ddd3655c59ce4f305c9.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/thread_pool.asciidoc:172
+
+[source, python]
+----
+resp = client.cat.thread_pool(
+ thread_pool_patterns="generic",
+ v=True,
+ h="id,name,active,rejected,completed",
+)
+print(resp)
+----
diff --git a/docs/examples/df82a9cb21a7557f3ddba2509f76f608.asciidoc b/docs/examples/df82a9cb21a7557f3ddba2509f76f608.asciidoc
new file mode 100644
index 000000000..3fd2b7037
--- /dev/null
+++ b/docs/examples/df82a9cb21a7557f3ddba2509f76f608.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/fingerprint-tokenfilter.asciidoc:35
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "fingerprint"
+ ],
+ text="zebra jumps over resting resting dog",
+)
+print(resp)
+----
diff --git a/docs/examples/dfa16b7300d225e013f23625f44c087b.asciidoc b/docs/examples/dfa16b7300d225e013f23625f44c087b.asciidoc
index e31713951..2d5d12d6d 100644
--- a/docs/examples/dfa16b7300d225e013f23625f44c087b.asciidoc
+++ b/docs/examples/dfa16b7300d225e013f23625f44c087b.asciidoc
@@ -1,57 +1,64 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/similarity.asciidoc:192
[source, python]
----
resp = client.indices.create(
index="index",
- body={
- "settings": {
- "number_of_shards": 1,
- "similarity": {
- "scripted_tfidf": {
- "type": "scripted",
- "script": {
- "source": "double tf = Math.sqrt(doc.freq); double idf = Math.log((field.docCount+1.0)/(term.docFreq+1.0)) + 1.0; double norm = 1/Math.sqrt(doc.length); return query.boost * tf * idf * norm;"
- },
+ settings={
+ "number_of_shards": 1,
+ "similarity": {
+ "scripted_tfidf": {
+ "type": "scripted",
+ "script": {
+ "source": "double tf = Math.sqrt(doc.freq); double idf = Math.log((field.docCount+1.0)/(term.docFreq+1.0)) + 1.0; double norm = 1/Math.sqrt(doc.length); return query.boost * tf * idf * norm;"
}
- },
- },
- "mappings": {
- "properties": {
- "field": {"type": "text", "similarity": "scripted_tfidf"}
}
- },
+ }
+ },
+ mappings={
+ "properties": {
+ "field": {
+ "type": "text",
+ "similarity": "scripted_tfidf"
+ }
+ }
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="index",
id="1",
- body={"field": "foo bar foo"},
+ document={
+ "field": "foo bar foo"
+ },
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="index",
id="2",
- body={"field": "bar baz"},
+ document={
+ "field": "bar baz"
+ },
)
-print(resp)
+print(resp2)
-resp = client.indices.refresh(
+resp3 = client.indices.refresh(
index="index",
)
-print(resp)
+print(resp3)
-resp = client.search(
+resp4 = client.search(
index="index",
- explain="true",
- body={
- "query": {
- "query_string": {"query": "foo^1.7", "default_field": "field"}
+ explain=True,
+ query={
+ "query_string": {
+ "query": "foo^1.7",
+ "default_field": "field"
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp4)
+----
diff --git a/docs/examples/dfa75000edf4b960ed9002595a051871.asciidoc b/docs/examples/dfa75000edf4b960ed9002595a051871.asciidoc
new file mode 100644
index 000000000..ee3de042a
--- /dev/null
+++ b/docs/examples/dfa75000edf4b960ed9002595a051871.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/migrate-to-data-tiers-routing-guide.asciidoc:139
+
+[source, python]
+----
+resp = client.ilm.stop()
+print(resp)
+----
diff --git a/docs/examples/dfb20907cfc5ac520ea3b1dba5f00811.asciidoc b/docs/examples/dfb20907cfc5ac520ea3b1dba5f00811.asciidoc
new file mode 100644
index 000000000..c7c2b2ad3
--- /dev/null
+++ b/docs/examples/dfb20907cfc5ac520ea3b1dba5f00811.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/example-watches/example-watch-clusterstatus.asciidoc:115
+
+[source, python]
+----
+resp = client.search(
+ index=".watcher-history*",
+ sort=[
+ {
+ "result.execution_time": "desc"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/dfb641d2d3155669ad6fb5a424dabf4f.asciidoc b/docs/examples/dfb641d2d3155669ad6fb5a424dabf4f.asciidoc
new file mode 100644
index 000000000..6d55f4e7f
--- /dev/null
+++ b/docs/examples/dfb641d2d3155669ad6fb5a424dabf4f.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/migrate-to-data-tiers-routing-guide.asciidoc:158
+
+[source, python]
+----
+resp = client.ilm.get_status()
+print(resp)
+----
diff --git a/docs/examples/dfbf53781adc6640493d49931a352167.asciidoc b/docs/examples/dfbf53781adc6640493d49931a352167.asciidoc
new file mode 100644
index 000000000..c93b99989
--- /dev/null
+++ b/docs/examples/dfbf53781adc6640493d49931a352167.asciidoc
@@ -0,0 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/enabled.asciidoc:64
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "enabled": False
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="session_1",
+ document={
+ "user_id": "kimchy",
+ "session_data": {
+ "arbitrary_object": {
+ "some_array": [
+ "foo",
+ "bar",
+ {
+ "baz": 2
+ }
+ ]
+ }
+ },
+ "last_updated": "2015-12-06T18:20:22"
+ },
+)
+print(resp1)
+
+resp2 = client.get(
+ index="my-index-000001",
+ id="session_1",
+)
+print(resp2)
+
+resp3 = client.indices.get_mapping(
+ index="my-index-000001",
+)
+print(resp3)
+----
diff --git a/docs/examples/dfcc83efefaddccfe5dce0695c2266ef.asciidoc b/docs/examples/dfcc83efefaddccfe5dce0695c2266ef.asciidoc
index 6bcd2b4dc..3101cb92b 100644
--- a/docs/examples/dfcc83efefaddccfe5dce0695c2266ef.asciidoc
+++ b/docs/examples/dfcc83efefaddccfe5dce0695c2266ef.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/nested-query.asciidoc:23
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"obj1": {"type": "nested"}}}},
+ mappings={
+ "properties": {
+ "obj1": {
+ "type": "nested"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/dfcdadcf91529d3a399e05684195028e.asciidoc b/docs/examples/dfcdadcf91529d3a399e05684195028e.asciidoc
new file mode 100644
index 000000000..635e058fb
--- /dev/null
+++ b/docs/examples/dfcdadcf91529d3a399e05684195028e.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-reindex.asciidoc:134
+
+[source, python]
+----
+resp = client.reindex(
+ wait_for_completion=False,
+ source={
+ "index": "test-data",
+ "size": 50
+ },
+ dest={
+ "index": "azure-ai-studio-embeddings",
+ "pipeline": "azure_ai_studio_embeddings"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dfcdcd3ea6753dcc391a4a52cf640527.asciidoc b/docs/examples/dfcdcd3ea6753dcc391a4a52cf640527.asciidoc
new file mode 100644
index 000000000..5176519eb
--- /dev/null
+++ b/docs/examples/dfcdcd3ea6753dcc391a4a52cf640527.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/update-desired-nodes.asciidoc:112
+
+[source, python]
+----
+resp = client.perform_request(
+ "PUT",
+ "/_internal/desired_nodes/Ywkh3INLQcuPT49f6kcppA/101",
+ headers={"Content-Type": "application/json"},
+ body={
+ "nodes": [
+ {
+ "settings": {
+ "node.name": "instance-000187",
+ "node.external_id": "instance-000187",
+ "node.roles": [
+ "data_hot",
+ "master"
+ ],
+ "node.attr.data": "hot",
+ "node.attr.logical_availability_zone": "zone-0"
+ },
+ "processors_range": {
+ "min": 8,
+ "max": 10
+ },
+ "memory": "58gb",
+ "storage": "2tb"
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dfce1be1d035aff0b8fdf4a8839f7795.asciidoc b/docs/examples/dfce1be1d035aff0b8fdf4a8839f7795.asciidoc
deleted file mode 100644
index a9d0b21b9..000000000
--- a/docs/examples/dfce1be1d035aff0b8fdf4a8839f7795.asciidoc
+++ /dev/null
@@ -1,16 +0,0 @@
-// ml/trained-models/apis/update-trained-model-deployment.asciidoc:115
-
-[source, python]
-----
-resp = client.ml.update_trained_model_deployment(
- model_id="elastic__distilbert-base-uncased-finetuned-conll03-english",
- body={
- "adaptive_allocations": {
- "enabled": True,
- "min_number_of_allocations": 3,
- "max_number_of_allocations": 10,
- }
- },
-)
-print(resp)
-----
\ No newline at end of file
diff --git a/docs/examples/dfdf82b8d99436582f150117695190b3.asciidoc b/docs/examples/dfdf82b8d99436582f150117695190b3.asciidoc
new file mode 100644
index 000000000..5f768b6f4
--- /dev/null
+++ b/docs/examples/dfdf82b8d99436582f150117695190b3.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/children-aggregation.asciidoc:39
+
+[source, python]
+----
+resp = client.index(
+ index="child_example",
+ id="1",
+ document={
+ "join": {
+ "name": "question"
+ },
+ "body": "I have Windows 2003 server and i bought a new Windows 2008 server...",
+ "title": "Whats the best way to file transfer my site from server to a newer one?",
+ "tags": [
+ "windows-server-2003",
+ "windows-server-2008",
+ "file-transfer"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/dff61a76d5ef9ca8cbe59a416269a84b.asciidoc b/docs/examples/dff61a76d5ef9ca8cbe59a416269a84b.asciidoc
new file mode 100644
index 000000000..50fae83d8
--- /dev/null
+++ b/docs/examples/dff61a76d5ef9ca8cbe59a416269a84b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/apis/delete-pipeline.asciidoc:28
+
+[source, python]
+----
+resp = client.ingest.delete_pipeline(
+ id="my-pipeline-id",
+)
+print(resp)
+----
diff --git a/docs/examples/dffbbdc4025e5777c647d8818847b960.asciidoc b/docs/examples/dffbbdc4025e5777c647d8818847b960.asciidoc
new file mode 100644
index 000000000..b0758980c
--- /dev/null
+++ b/docs/examples/dffbbdc4025e5777c647d8818847b960.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-api-keys.asciidoc:269
+
+[source, python]
+----
+resp = client.security.get_api_key(
+ id="VuaCfGcBCdbkQm-e5aOx",
+ owner=True,
+)
+print(resp)
+----
diff --git a/docs/examples/e0734215054e1ff5df712ce3a826cdba.asciidoc b/docs/examples/e0734215054e1ff5df712ce3a826cdba.asciidoc
new file mode 100644
index 000000000..f59721f38
--- /dev/null
+++ b/docs/examples/e0734215054e1ff5df712ce3a826cdba.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:604
+
+[source, python]
+----
+resp = client.indices.delete(
+ index="my-index",
+)
+print(resp)
+
+resp1 = client.indices.delete_data_stream(
+ name="logs-my_app-default",
+)
+print(resp1)
+----
diff --git a/docs/examples/e08fb1435dc659c24badf25b676efb68.asciidoc b/docs/examples/e08fb1435dc659c24badf25b676efb68.asciidoc
new file mode 100644
index 000000000..d758173bc
--- /dev/null
+++ b/docs/examples/e08fb1435dc659c24badf25b676efb68.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/index-prefixes.asciidoc:21
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "body_text": {
+ "type": "text",
+ "index_prefixes": {}
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e095fc96504efecc588f97673912e3d3.asciidoc b/docs/examples/e095fc96504efecc588f97673912e3d3.asciidoc
new file mode 100644
index 000000000..a735cbc54
--- /dev/null
+++ b/docs/examples/e095fc96504efecc588f97673912e3d3.asciidoc
@@ -0,0 +1,56 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/put-job.asciidoc:400
+
+[source, python]
+----
+resp = client.ml.put_job(
+ job_id="test-job1",
+ pretty=True,
+ analysis_config={
+ "bucket_span": "15m",
+ "detectors": [
+ {
+ "detector_description": "Sum of bytes",
+ "function": "sum",
+ "field_name": "bytes"
+ }
+ ]
+ },
+ data_description={
+ "time_field": "timestamp",
+ "time_format": "epoch_ms"
+ },
+ analysis_limits={
+ "model_memory_limit": "11MB"
+ },
+ model_plot_config={
+ "enabled": True,
+ "annotations_enabled": True
+ },
+ results_index_name="test-job1",
+ datafeed_config={
+ "indices": [
+ "kibana_sample_data_logs"
+ ],
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match_all": {}
+ }
+ ]
+ }
+ },
+ "runtime_mappings": {
+ "hour_of_day": {
+ "type": "long",
+ "script": {
+ "source": "emit(doc['timestamp'].value.getHour());"
+ }
+ }
+ },
+ "datafeed_id": "datafeed-test-job1"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e09d30195108bd6a1f6857394a6123ea.asciidoc b/docs/examples/e09d30195108bd6a1f6857394a6123ea.asciidoc
new file mode 100644
index 000000000..afd4ace63
--- /dev/null
+++ b/docs/examples/e09d30195108bd6a1f6857394a6123ea.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/reverse-tokenfilter.asciidoc:24
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "reverse"
+ ],
+ text="quick fox jumps",
+)
+print(resp)
+----
diff --git a/docs/examples/e09ee13ce253c7892dd5ef076fbfbba5.asciidoc b/docs/examples/e09ee13ce253c7892dd5ef076fbfbba5.asciidoc
new file mode 100644
index 000000000..efce51261
--- /dev/null
+++ b/docs/examples/e09ee13ce253c7892dd5ef076fbfbba5.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/remove-duplicates-tokenfilter.asciidoc:136
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_custom_analyzer": {
+ "tokenizer": "standard",
+ "filter": [
+ "keyword_repeat",
+ "stemmer",
+ "remove_duplicates"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e0a7c730ef0f22e3edffe9a254bc56e7.asciidoc b/docs/examples/e0a7c730ef0f22e3edffe9a254bc56e7.asciidoc
index 58114c373..acefd9f2b 100644
--- a/docs/examples/e0a7c730ef0f22e3edffe9a254bc56e7.asciidoc
+++ b/docs/examples/e0a7c730ef0f22e3edffe9a254bc56e7.asciidoc
@@ -1,26 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:234
[source, python]
----
resp = client.reindex(
- body={
- "source": {
- "index": "my-index-000001",
- "slice": {"id": 0, "max": 2},
- },
- "dest": {"index": "my-new-index-000001"},
+ source={
+ "index": "my-index-000001",
+ "slice": {
+ "id": 0,
+ "max": 2
+ }
+ },
+ dest={
+ "index": "my-new-index-000001"
},
)
print(resp)
-resp = client.reindex(
- body={
- "source": {
- "index": "my-index-000001",
- "slice": {"id": 1, "max": 2},
- },
- "dest": {"index": "my-new-index-000001"},
+resp1 = client.reindex(
+ source={
+ "index": "my-index-000001",
+ "slice": {
+ "id": 1,
+ "max": 2
+ }
+ },
+ dest={
+ "index": "my-new-index-000001"
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/e0b2f56c34e33ff52f8f9658be2f7ca1.asciidoc b/docs/examples/e0b2f56c34e33ff52f8f9658be2f7ca1.asciidoc
new file mode 100644
index 000000000..977bd87df
--- /dev/null
+++ b/docs/examples/e0b2f56c34e33ff52f8f9658be2f7ca1.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/stats.asciidoc:105
+
+[source, python]
+----
+resp = client.indices.stats(
+ index="index1,index2",
+)
+print(resp)
+----
diff --git a/docs/examples/e0bbfb368eae307e9508ab8d6e9cf23c.asciidoc b/docs/examples/e0bbfb368eae307e9508ab8d6e9cf23c.asciidoc
new file mode 100644
index 000000000..cfae9905a
--- /dev/null
+++ b/docs/examples/e0bbfb368eae307e9508ab8d6e9cf23c.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/fielddata.asciidoc:102
+
+[source, python]
+----
+resp = client.cat.fielddata(
+ v=True,
+ fields="body",
+)
+print(resp)
+----
diff --git a/docs/examples/e0d4a800de2d8f4062e69433586c38db.asciidoc b/docs/examples/e0d4a800de2d8f4062e69433586c38db.asciidoc
new file mode 100644
index 000000000..089cc5b46
--- /dev/null
+++ b/docs/examples/e0d4a800de2d8f4062e69433586c38db.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/saml-complete-logout-api.asciidoc:69
+
+[source, python]
+----
+resp = client.security.saml_complete_logout(
+ realm="saml1",
+ ids=[
+ "_1c368075e0b3..."
+ ],
+ query_string="SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK...",
+)
+print(resp)
+----
diff --git a/docs/examples/e0fcef99656799de6b88117d56f131e2.asciidoc b/docs/examples/e0fcef99656799de6b88117d56f131e2.asciidoc
new file mode 100644
index 000000000..2610b22e0
--- /dev/null
+++ b/docs/examples/e0fcef99656799de6b88117d56f131e2.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// search/explain.asciidoc:99
+
+[source, python]
+----
+resp = client.explain(
+ index="my-index-000001",
+ id="0",
+ query={
+ "match": {
+ "message": "elasticsearch"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e1220f2c28db6ef0233e26e6bd3866fa.asciidoc b/docs/examples/e1220f2c28db6ef0233e26e6bd3866fa.asciidoc
new file mode 100644
index 000000000..af30f82ea
--- /dev/null
+++ b/docs/examples/e1220f2c28db6ef0233e26e6bd3866fa.asciidoc
@@ -0,0 +1,47 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/tophits-aggregation.asciidoc:427
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "top_tags": {
+ "terms": {
+ "field": "type",
+ "size": 3
+ },
+ "aggs": {
+ "top_sales_hits": {
+ "top_hits": {
+ "sort": [
+ {
+ "date": {
+ "order": "desc"
+ }
+ }
+ ],
+ "_source": {
+ "includes": [
+ "date",
+ "price"
+ ]
+ },
+ "size": 1
+ }
+ },
+ "having.top_salary": {
+ "bucket_selector": {
+ "buckets_path": {
+ "tp": "top_sales_hits[_source.price]"
+ },
+ "script": "params.tp < 180"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e12f2d2ddca387630e7855a6db952da2.asciidoc b/docs/examples/e12f2d2ddca387630e7855a6db952da2.asciidoc
new file mode 100644
index 000000000..9b2fab571
--- /dev/null
+++ b/docs/examples/e12f2d2ddca387630e7855a6db952da2.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/range-aggregation.asciidoc:180
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ runtime_mappings={
+ "price.euros": {
+ "type": "double",
+ "script": {
+ "source": "\n emit(doc['price'].value * params.conversion_rate)\n ",
+ "params": {
+ "conversion_rate": 0.835526591
+ }
+ }
+ }
+ },
+ aggs={
+ "price_ranges": {
+ "range": {
+ "field": "price.euros",
+ "ranges": [
+ {
+ "to": 100
+ },
+ {
+ "from": 100,
+ "to": 200
+ },
+ {
+ "from": 200
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e1337c6b76defd5a46d05220f9d9c9fc.asciidoc b/docs/examples/e1337c6b76defd5a46d05220f9d9c9fc.asciidoc
new file mode 100644
index 000000000..d6324f804
--- /dev/null
+++ b/docs/examples/e1337c6b76defd5a46d05220f9d9c9fc.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-tokens.asciidoc:128
+
+[source, python]
+----
+resp = client.security.get_token(
+ grant_type="password",
+ username="test_admin",
+ password="x-pack-test-password",
+)
+print(resp)
+----
diff --git a/docs/examples/e14a5a5a1c880031486bfff43031fa3a.asciidoc b/docs/examples/e14a5a5a1c880031486bfff43031fa3a.asciidoc
new file mode 100644
index 000000000..12335ef7e
--- /dev/null
+++ b/docs/examples/e14a5a5a1c880031486bfff43031fa3a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/circuit-breaker-errors.asciidoc:64
+
+[source, python]
+----
+resp = client.nodes.stats(
+ metric="breaker",
+)
+print(resp)
+----
diff --git a/docs/examples/e16a353e619b935c5c70769b1b9fa100.asciidoc b/docs/examples/e16a353e619b935c5c70769b1b9fa100.asciidoc
new file mode 100644
index 000000000..e1bb066ee
--- /dev/null
+++ b/docs/examples/e16a353e619b935c5c70769b1b9fa100.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/composite-aggregation.asciidoc:458
+
+[source, python]
+----
+resp = client.search(
+ size=0,
+ aggs={
+ "my_buckets": {
+ "composite": {
+ "sources": [
+ {
+ "tile": {
+ "geotile_grid": {
+ "field": "location",
+ "precision": 8
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e1874cc7cd22b6860ca8b11bde3c70c1.asciidoc b/docs/examples/e1874cc7cd22b6860ca8b11bde3c70c1.asciidoc
new file mode 100644
index 000000000..8883df673
--- /dev/null
+++ b/docs/examples/e1874cc7cd22b6860ca8b11bde3c70c1.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/highlighting-multi-fields.asciidoc:227
+
+[source, python]
+----
+resp = client.search(
+ index="index2",
+ query={
+ "query_string": {
+ "query": "running with scissors",
+ "fields": [
+ "comment",
+ "comment.english"
+ ]
+ }
+ },
+ highlight={
+ "order": "score",
+ "fields": {
+ "comment": {
+ "type": "fvh"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e194e9cbe3eb2305f4f7cdda0cf529bd.asciidoc b/docs/examples/e194e9cbe3eb2305f4f7cdda0cf529bd.asciidoc
new file mode 100644
index 000000000..96fe3fa53
--- /dev/null
+++ b/docs/examples/e194e9cbe3eb2305f4f7cdda0cf529bd.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/misc.asciidoc:10
+
+[source, python]
+----
+resp = client.search(
+ typed_keys=True,
+ suggest={
+ "text": "some test mssage",
+ "my-first-suggester": {
+ "term": {
+ "field": "message"
+ }
+ },
+ "my-second-suggester": {
+ "phrase": {
+ "field": "message"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e19f5e3724d9f3f36a817b9a811ca42e.asciidoc b/docs/examples/e19f5e3724d9f3f36a817b9a811ca42e.asciidoc
new file mode 100644
index 000000000..49f8ceb44
--- /dev/null
+++ b/docs/examples/e19f5e3724d9f3f36a817b9a811ca42e.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline.asciidoc:62
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "my_date_histo": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "day"
+ },
+ "aggs": {
+ "the_sum": {
+ "sum": {
+ "field": "lemmings"
+ }
+ },
+ "the_deriv": {
+ "derivative": {
+ "buckets_path": "the_sum"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e1c08f5774e81da31cd75aa1bdc2c548.asciidoc b/docs/examples/e1c08f5774e81da31cd75aa1bdc2c548.asciidoc
new file mode 100644
index 000000000..6d6f4a99e
--- /dev/null
+++ b/docs/examples/e1c08f5774e81da31cd75aa1bdc2c548.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/percolate-query.asciidoc:688
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "bool": {
+ "should": [
+ {
+ "percolate": {
+ "field": "query",
+ "document": {
+ "message": "bonsai tree"
+ },
+ "name": "query1"
+ }
+ },
+ {
+ "percolate": {
+ "field": "query",
+ "document": {
+ "message": "tulip flower"
+ },
+ "name": "query2"
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e1d6ecab4148b09f4c605474157e7dbd.asciidoc b/docs/examples/e1d6ecab4148b09f4c605474157e7dbd.asciidoc
new file mode 100644
index 000000000..75fd178c1
--- /dev/null
+++ b/docs/examples/e1d6ecab4148b09f4c605474157e7dbd.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-settings.asciidoc:11
+
+[source, python]
+----
+resp = client.indices.get_settings(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/e1f20ee96ce80edcc35b647cef731e15.asciidoc b/docs/examples/e1f20ee96ce80edcc35b647cef731e15.asciidoc
new file mode 100644
index 000000000..1dba120c8
--- /dev/null
+++ b/docs/examples/e1f20ee96ce80edcc35b647cef731e15.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/match-enrich-policy-type-ex.asciidoc:101
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="my_id",
+ pipeline="user_lookup",
+ document={
+ "email": "mardy.brown@asciidocsmith.com"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e1f6ea7c0937cf7e6ea7e8209e52e8bb.asciidoc b/docs/examples/e1f6ea7c0937cf7e6ea7e8209e52e8bb.asciidoc
index d9dfc8702..5db4355cf 100644
--- a/docs/examples/e1f6ea7c0937cf7e6ea7e8209e52e8bb.asciidoc
+++ b/docs/examples/e1f6ea7c0937cf7e6ea7e8209e52e8bb.asciidoc
@@ -1,14 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/index-sorting.asciidoc:158
[source, python]
----
resp = client.search(
index="events",
- body={
- "size": 10,
- "sort": [{"timestamp": "desc"}],
- "track_total_hits": False,
- },
+ size=10,
+ sort=[
+ {
+ "timestamp": "desc"
+ }
+ ],
+ track_total_hits=False,
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e20037f66bf54bcac7d10f536f031f34.asciidoc b/docs/examples/e20037f66bf54bcac7d10f536f031f34.asciidoc
new file mode 100644
index 000000000..57dd81542
--- /dev/null
+++ b/docs/examples/e20037f66bf54bcac7d10f536f031f34.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// modules/cluster/disk_allocator.asciidoc:108
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my-index-000001",
+ settings={
+ "index.blocks.read_only_allow_delete": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e26c96978096ccc592849cca9db67ffc.asciidoc b/docs/examples/e26c96978096ccc592849cca9db67ffc.asciidoc
index 560b5c4b0..3e39921e1 100644
--- a/docs/examples/e26c96978096ccc592849cca9db67ffc.asciidoc
+++ b/docs/examples/e26c96978096ccc592849cca9db67ffc.asciidoc
@@ -1,10 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// modules/indices/request_cache.asciidoc:72
[source, python]
----
resp = client.indices.put_settings(
index="my-index-000001",
- body={"index.requests.cache.enable": True},
+ settings={
+ "index.requests.cache.enable": True
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e26e8bfa68aa4ab265b22304c38c3aef.asciidoc b/docs/examples/e26e8bfa68aa4ab265b22304c38c3aef.asciidoc
new file mode 100644
index 000000000..662ca57c5
--- /dev/null
+++ b/docs/examples/e26e8bfa68aa4ab265b22304c38c3aef.asciidoc
@@ -0,0 +1,90 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/esql/esql-getting-started-sample-data.asciidoc:7
+
+[source, python]
+----
+resp = client.indices.create(
+ index="sample_data",
+ mappings={
+ "properties": {
+ "client_ip": {
+ "type": "ip"
+ },
+ "message": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="sample_data",
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-10-23T12:15:03.360Z",
+ "client_ip": "172.21.2.162",
+ "message": "Connected to 10.1.0.3",
+ "event_duration": 3450233
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-10-23T12:27:28.948Z",
+ "client_ip": "172.21.2.113",
+ "message": "Connected to 10.1.0.2",
+ "event_duration": 2764889
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-10-23T13:33:34.937Z",
+ "client_ip": "172.21.0.5",
+ "message": "Disconnected",
+ "event_duration": 1232382
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-10-23T13:51:54.732Z",
+ "client_ip": "172.21.3.15",
+ "message": "Connection error",
+ "event_duration": 725448
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-10-23T13:52:55.015Z",
+ "client_ip": "172.21.3.15",
+ "message": "Connection error",
+ "event_duration": 8268153
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-10-23T13:53:55.832Z",
+ "client_ip": "172.21.3.15",
+ "message": "Connection error",
+ "event_duration": 5033755
+ },
+ {
+ "index": {}
+ },
+ {
+ "@timestamp": "2023-10-23T13:55:01.543Z",
+ "client_ip": "172.21.3.15",
+ "message": "Connected to 10.1.0.1",
+ "event_duration": 1756467
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/e270f3f721a5712cd11a5ca03554f5b0.asciidoc b/docs/examples/e270f3f721a5712cd11a5ca03554f5b0.asciidoc
index 91cb762bf..305c97921 100644
--- a/docs/examples/e270f3f721a5712cd11a5ca03554f5b0.asciidoc
+++ b/docs/examples/e270f3f721a5712cd11a5ca03554f5b0.asciidoc
@@ -1,18 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:171
[source, python]
----
resp = client.search(
- body={
- "query": {
- "multi_match": {
- "query": "Will Smith",
- "type": "best_fields",
- "fields": ["first_name", "last_name"],
- "operator": "and",
- }
+ query={
+ "multi_match": {
+ "query": "Will Smith",
+ "type": "best_fields",
+ "fields": [
+ "first_name",
+ "last_name"
+ ],
+ "operator": "and"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e273060a675c959fd5f3cde27c8aff07.asciidoc b/docs/examples/e273060a675c959fd5f3cde27c8aff07.asciidoc
new file mode 100644
index 000000000..c8a722ed0
--- /dev/null
+++ b/docs/examples/e273060a675c959fd5f3cde27c8aff07.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/disk-usage.asciidoc:14
+
+[source, python]
+----
+resp = client.indices.create(
+ index="index",
+ mappings={
+ "properties": {
+ "foo": {
+ "type": "integer",
+ "index": False
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e2750d69bcb6d4c7e16e704cd0fb3530.asciidoc b/docs/examples/e2750d69bcb6d4c7e16e704cd0fb3530.asciidoc
new file mode 100644
index 000000000..1248e2f46
--- /dev/null
+++ b/docs/examples/e2750d69bcb6d4c7e16e704cd0fb3530.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/rank-feature-query.asciidoc:67
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test",
+ mappings={
+ "properties": {
+ "pagerank": {
+ "type": "rank_feature"
+ },
+ "url_length": {
+ "type": "rank_feature",
+ "positive_score_impact": False
+ },
+ "topics": {
+ "type": "rank_features"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e2883c88b5ceca9fce1e70e716d80025.asciidoc b/docs/examples/e2883c88b5ceca9fce1e70e716d80025.asciidoc
index 844cc8fc0..5f75c7f5a 100644
--- a/docs/examples/e2883c88b5ceca9fce1e70e716d80025.asciidoc
+++ b/docs/examples/e2883c88b5ceca9fce1e70e716d80025.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/version.asciidoc:19
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"my_version": {"type": "version"}}}},
+ mappings={
+ "properties": {
+ "my_version": {
+ "type": "version"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e2a22c6fd58cc0becf4c383134a08f8b.asciidoc b/docs/examples/e2a22c6fd58cc0becf4c383134a08f8b.asciidoc
new file mode 100644
index 000000000..112f6dd18
--- /dev/null
+++ b/docs/examples/e2a22c6fd58cc0becf4c383134a08f8b.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/intervals-query.asciidoc:374
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "intervals": {
+ "my_text": {
+ "match": {
+ "query": "salty",
+ "filter": {
+ "contained_by": {
+ "match": {
+ "query": "hot porridge"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e2a753029b450942a3228e3003a55a7d.asciidoc b/docs/examples/e2a753029b450942a3228e3003a55a7d.asciidoc
new file mode 100644
index 000000000..1c1422a21
--- /dev/null
+++ b/docs/examples/e2a753029b450942a3228e3003a55a7d.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/apis/put-lifecycle.asciidoc:105
+
+[source, python]
+----
+resp = client.indices.put_data_lifecycle(
+ name="my-weather-sensor-data-stream",
+ downsampling=[
+ {
+ "after": "1d",
+ "fixed_interval": "10m"
+ },
+ {
+ "after": "7d",
+ "fixed_interval": "1d"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/e2a7d127b82ddebb690a959dcd0cbc09.asciidoc b/docs/examples/e2a7d127b82ddebb690a959dcd0cbc09.asciidoc
new file mode 100644
index 000000000..360bb3692
--- /dev/null
+++ b/docs/examples/e2a7d127b82ddebb690a959dcd0cbc09.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/elision-tokenfilter.asciidoc:96
+
+[source, python]
+----
+resp = client.indices.create(
+ index="elision_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "whitespace_elision": {
+ "tokenizer": "whitespace",
+ "filter": [
+ "elision"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e2b4867a9f72bda87ebaa3608d3fba4c.asciidoc b/docs/examples/e2b4867a9f72bda87ebaa3608d3fba4c.asciidoc
new file mode 100644
index 000000000..a0dc29348
--- /dev/null
+++ b/docs/examples/e2b4867a9f72bda87ebaa3608d3fba4c.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:354
+
+[source, python]
+----
+resp = client.render_search_template(
+ source={
+ "query": {
+ "range": {
+ "user.effective.date": {
+ "gte": "{{date.min}}",
+ "lte": "{{date.max}}",
+ "format": "{{#join delimiter='||'}}date.formats{{/join delimiter='||'}}"
+ }
+ }
+ }
+ },
+ params={
+ "date": {
+ "min": "2098",
+ "max": "06/05/2099",
+ "formats": [
+ "dd/MM/yyyy",
+ "yyyy"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e2bcc8f4ed2b4de82729e7a5a7c8f634.asciidoc b/docs/examples/e2bcc8f4ed2b4de82729e7a5a7c8f634.asciidoc
new file mode 100644
index 000000000..d266cb8a5
--- /dev/null
+++ b/docs/examples/e2bcc8f4ed2b4de82729e7a5a7c8f634.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// synonyms/apis/list-synonyms-sets.asciidoc:80
+
+[source, python]
+----
+resp = client.synonyms.get_synonyms_sets()
+print(resp)
+----
diff --git a/docs/examples/e2d8cf24a12053eb09fec7087cdab43a.asciidoc b/docs/examples/e2d8cf24a12053eb09fec7087cdab43a.asciidoc
new file mode 100644
index 000000000..b33206784
--- /dev/null
+++ b/docs/examples/e2d8cf24a12053eb09fec7087cdab43a.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/normalize-aggregation.asciidoc:95
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "percent_of_total_sales": {
+ "normalize": {
+ "buckets_path": "sales",
+ "method": "percent_of_sum",
+ "format": "00.00%"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e2ec9e867f7141b304b53ebc59098f2a.asciidoc b/docs/examples/e2ec9e867f7141b304b53ebc59098f2a.asciidoc
new file mode 100644
index 000000000..05f401af0
--- /dev/null
+++ b/docs/examples/e2ec9e867f7141b304b53ebc59098f2a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/update-api-key.asciidoc:252
+
+[source, python]
+----
+resp = client.security.update_api_key(
+ id="VuaCfGcBCdbkQm-e5aOx",
+)
+print(resp)
+----
diff --git a/docs/examples/e3019fd5f23458ae49ad9854c97d321c.asciidoc b/docs/examples/e3019fd5f23458ae49ad9854c97d321c.asciidoc
new file mode 100644
index 000000000..cc0793e90
--- /dev/null
+++ b/docs/examples/e3019fd5f23458ae49ad9854c97d321c.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/oidc-prepare-authentication-api.asciidoc:72
+
+[source, python]
+----
+resp = client.security.oidc_prepare_authentication(
+ body={
+ "realm": "oidc1"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e30ea6e3823a139d7693d8cce1920a06.asciidoc b/docs/examples/e30ea6e3823a139d7693d8cce1920a06.asciidoc
index 7e4da9694..6b08cc24f 100644
--- a/docs/examples/e30ea6e3823a139d7693d8cce1920a06.asciidoc
+++ b/docs/examples/e30ea6e3823a139d7693d8cce1920a06.asciidoc
@@ -1,16 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/multi-match-query.asciidoc:50
[source, python]
----
resp = client.search(
- body={
- "query": {
- "multi_match": {
- "query": "this is a test",
- "fields": ["subject^3", "message"],
- }
+ query={
+ "multi_match": {
+ "query": "this is a test",
+ "fields": [
+ "subject^3",
+ "message"
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e316271f668c9889bf548311fb421f1e.asciidoc b/docs/examples/e316271f668c9889bf548311fb421f1e.asciidoc
index 362979d8c..47dc9dee6 100644
--- a/docs/examples/e316271f668c9889bf548311fb421f1e.asciidoc
+++ b/docs/examples/e316271f668c9889bf548311fb421f1e.asciidoc
@@ -1,19 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:846
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "ip_addresses": {
- "terms": {
- "field": "destination_ip",
- "missing": "0.0.0.0",
- "value_type": "ip",
- }
+ aggs={
+ "ip_addresses": {
+ "terms": {
+ "field": "destination_ip",
+ "missing": "0.0.0.0",
+ "value_type": "ip"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e317a8380dfbc76c4e7f23d0997b3518.asciidoc b/docs/examples/e317a8380dfbc76c4e7f23d0997b3518.asciidoc
new file mode 100644
index 000000000..e3c6d48bd
--- /dev/null
+++ b/docs/examples/e317a8380dfbc76c4e7f23d0997b3518.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:524
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "action.destructive_requires_name": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e324ea1547635180c31c1adf77870ba2.asciidoc b/docs/examples/e324ea1547635180c31c1adf77870ba2.asciidoc
new file mode 100644
index 000000000..2f38e1a92
--- /dev/null
+++ b/docs/examples/e324ea1547635180c31c1adf77870ba2.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/tsds-reindex.asciidoc:249
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="destination_template",
+ template={
+ "settings": {
+ "index": {
+ "number_of_replicas": 2,
+ "number_of_shards": 2,
+ "mode": "time_series",
+ "routing_path": [
+ "metricset"
+ ]
+ }
+ },
+ "mappings": {
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ },
+ "metricset": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "k8s": {
+ "properties": {
+ "tx": {
+ "type": "long"
+ },
+ "rx": {
+ "type": "long"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e35abc9403e4aef7d538ab29ccc363b3.asciidoc b/docs/examples/e35abc9403e4aef7d538ab29ccc363b3.asciidoc
new file mode 100644
index 000000000..5bd24e6e3
--- /dev/null
+++ b/docs/examples/e35abc9403e4aef7d538ab29ccc363b3.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/prevalidate-node-removal.asciidoc:105
+
+[source, python]
+----
+resp = client.perform_request(
+ "POST",
+ "/_internal/prevalidate_node_removal",
+ params={
+ "names": "node1,node2"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e3678142aec988e2ff0ae5d934dc39e9.asciidoc b/docs/examples/e3678142aec988e2ff0ae5d934dc39e9.asciidoc
index 267ba78e5..9ca46dce2 100644
--- a/docs/examples/e3678142aec988e2ff0ae5d934dc39e9.asciidoc
+++ b/docs/examples/e3678142aec988e2ff0ae5d934dc39e9.asciidoc
@@ -1,76 +1,108 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-point.asciidoc:28
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"properties": {"location": {"type": "geo_point"}}}},
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_point"
+ }
+ }
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={
+ document={
"text": "Geopoint as an object using GeoJSON format",
- "location": {"type": "Point", "coordinates": [-71.34, 41.12]},
+ "location": {
+ "type": "Point",
+ "coordinates": [
+ -71.34,
+ 41.12
+ ]
+ }
},
)
-print(resp)
+print(resp1)
-resp = client.index(
+resp2 = client.index(
index="my-index-000001",
id="2",
- body={
+ document={
"text": "Geopoint as a WKT POINT primitive",
- "location": "POINT (-71.34 41.12)",
+ "location": "POINT (-71.34 41.12)"
},
)
-print(resp)
+print(resp2)
-resp = client.index(
+resp3 = client.index(
index="my-index-000001",
id="3",
- body={
+ document={
"text": "Geopoint as an object with 'lat' and 'lon' keys",
- "location": {"lat": 41.12, "lon": -71.34},
+ "location": {
+ "lat": 41.12,
+ "lon": -71.34
+ }
},
)
-print(resp)
+print(resp3)
-resp = client.index(
+resp4 = client.index(
index="my-index-000001",
id="4",
- body={"text": "Geopoint as an array", "location": [-71.34, 41.12]},
+ document={
+ "text": "Geopoint as an array",
+ "location": [
+ -71.34,
+ 41.12
+ ]
+ },
)
-print(resp)
+print(resp4)
-resp = client.index(
+resp5 = client.index(
index="my-index-000001",
id="5",
- body={"text": "Geopoint as a string", "location": "41.12,-71.34"},
+ document={
+ "text": "Geopoint as a string",
+ "location": "41.12,-71.34"
+ },
)
-print(resp)
+print(resp5)
-resp = client.index(
+resp6 = client.index(
index="my-index-000001",
id="6",
- body={"text": "Geopoint as a geohash", "location": "drm3btev3e86"},
+ document={
+ "text": "Geopoint as a geohash",
+ "location": "drm3btev3e86"
+ },
)
-print(resp)
+print(resp6)
-resp = client.search(
+resp7 = client.search(
index="my-index-000001",
- body={
- "query": {
- "geo_bounding_box": {
- "location": {
- "top_left": {"lat": 42, "lon": -72},
- "bottom_right": {"lat": 40, "lon": -74},
+ query={
+ "geo_bounding_box": {
+ "location": {
+ "top_left": {
+ "lat": 42,
+ "lon": -72
+ },
+ "bottom_right": {
+ "lat": 40,
+ "lon": -74
}
}
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp7)
+----
diff --git a/docs/examples/e39d51202913bf6d861e9e721570cdb8.asciidoc b/docs/examples/e39d51202913bf6d861e9e721570cdb8.asciidoc
deleted file mode 100644
index a5e0c6327..000000000
--- a/docs/examples/e39d51202913bf6d861e9e721570cdb8.asciidoc
+++ /dev/null
@@ -1,6 +0,0 @@
-// query-dsl/nested-query.asciidoc:365
-
-[source, python]
-----
-
-----
\ No newline at end of file
diff --git a/docs/examples/e3a6462ca79c101314da0680c97678cd.asciidoc b/docs/examples/e3a6462ca79c101314da0680c97678cd.asciidoc
new file mode 100644
index 000000000..0710d2cda
--- /dev/null
+++ b/docs/examples/e3a6462ca79c101314da0680c97678cd.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/retrieve-selected-fields.asciidoc:734
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match_all": {}
+ },
+ script_fields={
+ "test1": {
+ "script": {
+ "lang": "painless",
+ "source": "doc['price'].value * 2"
+ }
+ },
+ "test2": {
+ "script": {
+ "lang": "painless",
+ "source": "doc['price'].value * params.factor",
+ "params": {
+ "factor": 2
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e3b3a8ae12ab947ad3ba96eb228402ca.asciidoc b/docs/examples/e3b3a8ae12ab947ad3ba96eb228402ca.asciidoc
index a6fb60b56..51098d613 100644
--- a/docs/examples/e3b3a8ae12ab947ad3ba96eb228402ca.asciidoc
+++ b/docs/examples/e3b3a8ae12ab947ad3ba96eb228402ca.asciidoc
@@ -1,10 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/store.asciidoc:122
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"settings": {"index.store.preload": ["nvd", "dvd"]}},
+ settings={
+ "index.store.preload": [
+ "nvd",
+ "dvd"
+ ]
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e3f2f6ee3e312b8a90634827ae954d70.asciidoc b/docs/examples/e3f2f6ee3e312b8a90634827ae954d70.asciidoc
index f38cbc55d..1cfe1f1f4 100644
--- a/docs/examples/e3f2f6ee3e312b8a90634827ae954d70.asciidoc
+++ b/docs/examples/e3f2f6ee3e312b8a90634827ae954d70.asciidoc
@@ -1,21 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:422
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "GeometryCollection",
"geometries": [
- {"type": "Point", "coordinates": [100, 0]},
{
- "type": "LineString",
- "coordinates": [[101, 0], [102, 1]],
+ "type": "Point",
+ "coordinates": [
+ 100,
+ 0
+ ]
},
- ],
+ {
+ "type": "LineString",
+ "coordinates": [
+ [
+ 101,
+ 0
+ ],
+ [
+ 102,
+ 1
+ ]
+ ]
+ }
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e4193867485595c9c92f909a052d2a90.asciidoc b/docs/examples/e4193867485595c9c92f909a052d2a90.asciidoc
new file mode 100644
index 000000000..ccbdd65cf
--- /dev/null
+++ b/docs/examples/e4193867485595c9c92f909a052d2a90.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/has-parent-query.asciidoc:27
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "my-join-field": {
+ "type": "join",
+ "relations": {
+ "parent": "child"
+ }
+ },
+ "tag": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e41a9bac42d0c1cb103674ae9039b7af.asciidoc b/docs/examples/e41a9bac42d0c1cb103674ae9039b7af.asciidoc
index b848ea87d..02c6a1fcf 100644
--- a/docs/examples/e41a9bac42d0c1cb103674ae9039b7af.asciidoc
+++ b/docs/examples/e41a9bac42d0c1cb103674ae9039b7af.asciidoc
@@ -1,17 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/field-mapping.asciidoc:234
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"numeric_detection": True}},
+ mappings={
+ "numeric_detection": True
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"my_float": "1.0", "my_integer": "1"},
+ document={
+ "my_float": "1.0",
+ "my_integer": "1"
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/e441cb3be3c2f007621ee1f8c9a2e0ef.asciidoc b/docs/examples/e441cb3be3c2f007621ee1f8c9a2e0ef.asciidoc
new file mode 100644
index 000000000..88fa75db1
--- /dev/null
+++ b/docs/examples/e441cb3be3c2f007621ee1f8c9a2e0ef.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/matrix-stats-aggregation.asciidoc:45
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "statistics": {
+ "matrix_stats": {
+ "fields": [
+ "poverty",
+ "income"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e451900efbd8be50c2b8347a83816aa6.asciidoc b/docs/examples/e451900efbd8be50c2b8347a83816aa6.asciidoc
new file mode 100644
index 000000000..57dc336d8
--- /dev/null
+++ b/docs/examples/e451900efbd8be50c2b8347a83816aa6.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/extended-stats-bucket-aggregation.asciidoc:44
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "stats_monthly_sales": {
+ "extended_stats_bucket": {
+ "buckets_path": "sales_per_month>sales"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e46c83db1580e14be844079cd008f518.asciidoc b/docs/examples/e46c83db1580e14be844079cd008f518.asciidoc
new file mode 100644
index 000000000..779db373e
--- /dev/null
+++ b/docs/examples/e46c83db1580e14be844079cd008f518.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/enable-index-allocation.asciidoc:130
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="my-index-000001",
+ settings={
+ "index": {
+ "routing.allocation.enable": "all"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e47a71a2e314dbbee5db8142a23957ce.asciidoc b/docs/examples/e47a71a2e314dbbee5db8142a23957ce.asciidoc
new file mode 100644
index 000000000..c63f461cb
--- /dev/null
+++ b/docs/examples/e47a71a2e314dbbee5db8142a23957ce.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:621
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "set": {
+ "description": "Index the ingest timestamp as 'event.ingested'",
+ "field": "event.ingested",
+ "value": "{{{_ingest.timestamp}}}"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/e48e7da65c2b32d724fd7e3bfa175c6f.asciidoc b/docs/examples/e48e7da65c2b32d724fd7e3bfa175c6f.asciidoc
new file mode 100644
index 000000000..3d3a03d23
--- /dev/null
+++ b/docs/examples/e48e7da65c2b32d724fd7e3bfa175c6f.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-overall-buckets.asciidoc:130
+
+[source, python]
+----
+resp = client.ml.get_overall_buckets(
+ job_id="job-*",
+ overall_score=80,
+ start="1403532000000",
+)
+print(resp)
+----
diff --git a/docs/examples/e494162e83ce041c56b2e2bc29d33474.asciidoc b/docs/examples/e494162e83ce041c56b2e2bc29d33474.asciidoc
new file mode 100644
index 000000000..7ee03b02c
--- /dev/null
+++ b/docs/examples/e494162e83ce041c56b2e2bc29d33474.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:394
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n sequence by process.pid with maxspan=1h\n [ process where process.name == \"regsvr32.exe\" ]\n [ file where stringContains(file.name, \"scrobj.dll\") ]\n until [ process where event.type == \"termination\" ]\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/e4b2b5e0aaedf3cbbcde3d61eb1f13fc.asciidoc b/docs/examples/e4b2b5e0aaedf3cbbcde3d61eb1f13fc.asciidoc
new file mode 100644
index 000000000..1daca1080
--- /dev/null
+++ b/docs/examples/e4b2b5e0aaedf3cbbcde3d61eb1f13fc.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/refresh.asciidoc:108
+
+[source, python]
+----
+resp = client.index(
+ index="test",
+ id="4",
+ refresh="wait_for",
+ document={
+ "test": "test"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e4b64b8277af259a52c8d3940157b5fa.asciidoc b/docs/examples/e4b64b8277af259a52c8d3940157b5fa.asciidoc
new file mode 100644
index 000000000..096deae8c
--- /dev/null
+++ b/docs/examples/e4b64b8277af259a52c8d3940157b5fa.asciidoc
@@ -0,0 +1,51 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/painless-examples.asciidoc:397
+
+[source, python]
+----
+resp = client.transform.put_transform(
+ transform_id="data_log",
+ source={
+ "index": "kibana_sample_data_logs"
+ },
+ dest={
+ "index": "data-logs-by-client"
+ },
+ pivot={
+ "group_by": {
+ "machine.os": {
+ "terms": {
+ "field": "machine.os.keyword"
+ }
+ },
+ "machine.ip": {
+ "terms": {
+ "field": "clientip"
+ }
+ }
+ },
+ "aggregations": {
+ "time_frame.lte": {
+ "max": {
+ "field": "timestamp"
+ }
+ },
+ "time_frame.gte": {
+ "min": {
+ "field": "timestamp"
+ }
+ },
+ "time_length": {
+ "bucket_script": {
+ "buckets_path": {
+ "min": "time_frame.gte.value",
+ "max": "time_frame.lte.value"
+ },
+ "script": "params.max - params.min"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e4b6a6a921c97b4c0bbe97bd89f4cf33.asciidoc b/docs/examples/e4b6a6a921c97b4c0bbe97bd89f4cf33.asciidoc
new file mode 100644
index 000000000..dc93de433
--- /dev/null
+++ b/docs/examples/e4b6a6a921c97b4c0bbe97bd89f4cf33.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/promote-data-stream-api.asciidoc:22
+
+[source, python]
+----
+resp = client.indices.promote_data_stream(
+ name="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/e4be53736bcc02b03068fd72fdbfe271.asciidoc b/docs/examples/e4be53736bcc02b03068fd72fdbfe271.asciidoc
index 88590407f..990f57ccb 100644
--- a/docs/examples/e4be53736bcc02b03068fd72fdbfe271.asciidoc
+++ b/docs/examples/e4be53736bcc02b03068fd72fdbfe271.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:108
[source, python]
----
resp = client.indices.put_mapping(
index="publications",
- body={"properties": {"title": {"type": "text"}}},
+ properties={
+ "title": {
+ "type": "text"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e4d1f01c025fb797a1d87f372760eabf.asciidoc b/docs/examples/e4d1f01c025fb797a1d87f372760eabf.asciidoc
new file mode 100644
index 000000000..106dc3a6c
--- /dev/null
+++ b/docs/examples/e4d1f01c025fb797a1d87f372760eabf.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/hotspotting.asciidoc:265
+
+[source, python]
+----
+resp = client.tasks.list(
+ human=True,
+ detailed=True,
+)
+print(resp)
+----
diff --git a/docs/examples/e4de6035653e8202c43631f02d244661.asciidoc b/docs/examples/e4de6035653e8202c43631f02d244661.asciidoc
new file mode 100644
index 000000000..87ea9a017
--- /dev/null
+++ b/docs/examples/e4de6035653e8202c43631f02d244661.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-across-clusters.asciidoc:127
+
+[source, python]
+----
+resp = client.search(
+ index="cluster_one:my-index-000001",
+ size=1,
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ source=[
+ "user.id",
+ "message",
+ "http.response.status_code"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/e4ea514eb9a01716d9bbc5aa04ee0252.asciidoc b/docs/examples/e4ea514eb9a01716d9bbc5aa04ee0252.asciidoc
new file mode 100644
index 000000000..7cefee2b8
--- /dev/null
+++ b/docs/examples/e4ea514eb9a01716d9bbc5aa04ee0252.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/query-user.asciidoc:192
+
+[source, python]
+----
+resp = client.perform_request(
+ "POST",
+ "/_security/_query/user",
+ headers={"Content-Type": "application/json"},
+ body={
+ "query": {
+ "prefix": {
+ "roles": "other"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e51a86b666f447cda5f634547a8e1a4a.asciidoc b/docs/examples/e51a86b666f447cda5f634547a8e1a4a.asciidoc
new file mode 100644
index 000000000..78145f5de
--- /dev/null
+++ b/docs/examples/e51a86b666f447cda5f634547a8e1a4a.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/create-data-stream.asciidoc:22
+
+[source, python]
+----
+resp = client.indices.create_data_stream(
+ name="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/e551ea38a2d8f8deac110b33304200cc.asciidoc b/docs/examples/e551ea38a2d8f8deac110b33304200cc.asciidoc
new file mode 100644
index 000000000..a69bf2834
--- /dev/null
+++ b/docs/examples/e551ea38a2d8f8deac110b33304200cc.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/learning-to-rank-search-usage.asciidoc:17
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "multi_match": {
+ "fields": [
+ "title",
+ "content"
+ ],
+ "query": "the quick brown fox"
+ }
+ },
+ rescore={
+ "learning_to_rank": {
+ "model_id": "ltr-model",
+ "params": {
+ "query_text": "the quick brown fox"
+ }
+ },
+ "window_size": 100
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e566e898902e432bc7ea0568400f0c50.asciidoc b/docs/examples/e566e898902e432bc7ea0568400f0c50.asciidoc
index e348d0842..1d39f8a28 100644
--- a/docs/examples/e566e898902e432bc7ea0568400f0c50.asciidoc
+++ b/docs/examples/e566e898902e432bc7ea0568400f0c50.asciidoc
@@ -1,30 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/ip.asciidoc:170
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"ip": {"type": "ip"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "ip": {
+ "type": "ip"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={
+ document={
"ip": [
"192.168.0.1",
"192.168.0.1",
"10.10.12.123",
"2001:db8::1:0:0:1",
- "::afff:4567:890a",
+ "::afff:4567:890a"
]
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/e586d1d2a997133e039fd352a42a72b3.asciidoc b/docs/examples/e586d1d2a997133e039fd352a42a72b3.asciidoc
new file mode 100644
index 000000000..e78726d91
--- /dev/null
+++ b/docs/examples/e586d1d2a997133e039fd352a42a72b3.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/terms-set-query.asciidoc:136
+
+[source, python]
+----
+resp = client.search(
+ index="job-candidates",
+ query={
+ "terms_set": {
+ "programming_languages": {
+ "terms": [
+ "c++",
+ "java",
+ "php"
+ ],
+ "minimum_should_match_field": "required_matches"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e58833449d01379df20ad06dc28144d8.asciidoc b/docs/examples/e58833449d01379df20ad06dc28144d8.asciidoc
index d78f231c3..38181abf0 100644
--- a/docs/examples/e58833449d01379df20ad06dc28144d8.asciidoc
+++ b/docs/examples/e58833449d01379df20ad06dc28144d8.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update-by-query.asciidoc:325
[source, python]
@@ -5,7 +6,11 @@
resp = client.update_by_query(
index="my-index-000001",
conflicts="proceed",
- body={"query": {"term": {"user.id": "kimchy"}}},
+ query={
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e58b7965c3a314c34bc444c6db3b1b79.asciidoc b/docs/examples/e58b7965c3a314c34bc444c6db3b1b79.asciidoc
new file mode 100644
index 000000000..c11135e56
--- /dev/null
+++ b/docs/examples/e58b7965c3a314c34bc444c6db3b1b79.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/enable-index-allocation.asciidoc:104
+
+[source, python]
+----
+resp = client.indices.get_settings(
+ index="my-index-000001",
+ name="index.routing.allocation.enable",
+ flat_settings=True,
+)
+print(resp)
+----
diff --git a/docs/examples/e5901f48eb8a419b878fc2cb815d8691.asciidoc b/docs/examples/e5901f48eb8a419b878fc2cb815d8691.asciidoc
index 740c463d0..76d26ada5 100644
--- a/docs/examples/e5901f48eb8a419b878fc2cb815d8691.asciidoc
+++ b/docs/examples/e5901f48eb8a419b878fc2cb815d8691.asciidoc
@@ -1,9 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// cluster/update-settings.asciidoc:45
[source, python]
----
resp = client.cluster.put_settings(
- body={"persistent": {"indices.recovery.max_bytes_per_sec": "50mb"}},
+ persistent={
+ "indices.recovery.max_bytes_per_sec": "50mb"
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e5c710b08a545522d50b4ce35503bc46.asciidoc b/docs/examples/e5c710b08a545522d50b4ce35503bc46.asciidoc
new file mode 100644
index 000000000..41fc02d6a
--- /dev/null
+++ b/docs/examples/e5c710b08a545522d50b4ce35503bc46.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:230
+
+[source, python]
+----
+resp = client.index(
+ index="my-data-stream",
+ pipeline="my-pipeline",
+ document={
+ "@timestamp": "2099-03-07T11:04:05.000Z",
+ "my-keyword-field": "foo"
+ },
+)
+print(resp)
+
+resp1 = client.bulk(
+ index="my-data-stream",
+ pipeline="my-pipeline",
+ operations=[
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2099-03-07T11:04:06.000Z",
+ "my-keyword-field": "foo"
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2099-03-07T11:04:07.000Z",
+ "my-keyword-field": "bar"
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/e5f50b31f165462d883ecbff45f74985.asciidoc b/docs/examples/e5f50b31f165462d883ecbff45f74985.asciidoc
new file mode 100644
index 000000000..8fa533456
--- /dev/null
+++ b/docs/examples/e5f50b31f165462d883ecbff45f74985.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-index-template-v1.asciidoc:14
+
+[source, python]
+----
+resp = client.indices.put_template(
+ name="template_1",
+ index_patterns=[
+ "te*",
+ "bar*"
+ ],
+ settings={
+ "number_of_shards": 1
+ },
+ mappings={
+ "_source": {
+ "enabled": False
+ },
+ "properties": {
+ "host_name": {
+ "type": "keyword"
+ },
+ "created_at": {
+ "type": "date",
+ "format": "EEE MMM dd HH:mm:ss Z yyyy"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e5f89a04f50df707a0a53ec0f2eecbbd.asciidoc b/docs/examples/e5f89a04f50df707a0a53ec0f2eecbbd.asciidoc
index 64b6234ea..a4fc3d5f2 100644
--- a/docs/examples/e5f89a04f50df707a0a53ec0f2eecbbd.asciidoc
+++ b/docs/examples/e5f89a04f50df707a0a53ec0f2eecbbd.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:71
[source, python]
@@ -5,8 +6,8 @@
resp = client.get(
index="my-index-000001",
id="0",
- _source_includes="*.id",
- _source_excludes="entities",
+ source_includes="*.id",
+ source_excludes="entities",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e5f8f83df37ab2296dc4bfed95d7aba7.asciidoc b/docs/examples/e5f8f83df37ab2296dc4bfed95d7aba7.asciidoc
new file mode 100644
index 000000000..85ed9b88e
--- /dev/null
+++ b/docs/examples/e5f8f83df37ab2296dc4bfed95d7aba7.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/enable-cluster-allocation.asciidoc:112
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.enable": "all"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e608cd0c034f6c245ea87f425e09ce2f.asciidoc b/docs/examples/e608cd0c034f6c245ea87f425e09ce2f.asciidoc
new file mode 100644
index 000000000..61b2c90fe
--- /dev/null
+++ b/docs/examples/e608cd0c034f6c245ea87f425e09ce2f.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-term-query.asciidoc:10
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_term": {
+ "user.id": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e60b7f75ca806f2c74927c3d9409a986.asciidoc b/docs/examples/e60b7f75ca806f2c74927c3d9409a986.asciidoc
new file mode 100644
index 000000000..0935cf182
--- /dev/null
+++ b/docs/examples/e60b7f75ca806f2c74927c3d9409a986.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/create-role-mappings.asciidoc:160
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="mapping3",
+ roles=[
+ "ldap-user"
+ ],
+ enabled=True,
+ rules={
+ "field": {
+ "realm.name": "ldap1"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e60c2bf89fdf38187709d04dd1c55330.asciidoc b/docs/examples/e60c2bf89fdf38187709d04dd1c55330.asciidoc
new file mode 100644
index 000000000..d045cf18d
--- /dev/null
+++ b/docs/examples/e60c2bf89fdf38187709d04dd1c55330.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/mlt-query.asciidoc:19
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "more_like_this": {
+ "fields": [
+ "title",
+ "description"
+ ],
+ "like": "Once upon a time",
+ "min_term_freq": 1,
+ "max_query_terms": 12
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e60ded7becfd5b2ccaef5bad2aaa93f5.asciidoc b/docs/examples/e60ded7becfd5b2ccaef5bad2aaa93f5.asciidoc
index dc1e7364b..890600dc4 100644
--- a/docs/examples/e60ded7becfd5b2ccaef5bad2aaa93f5.asciidoc
+++ b/docs/examples/e60ded7becfd5b2ccaef5bad2aaa93f5.asciidoc
@@ -1,19 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:185
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "products": {
- "terms": {
- "field": "product",
- "size": 5,
- "show_term_doc_count_error": True,
- }
+ aggs={
+ "products": {
+ "terms": {
+ "field": "product",
+ "size": 5,
+ "show_term_doc_count_error": True
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e619e896ce3dad9dcfc6f8700438be98.asciidoc b/docs/examples/e619e896ce3dad9dcfc6f8700438be98.asciidoc
new file mode 100644
index 000000000..eea61bc74
--- /dev/null
+++ b/docs/examples/e619e896ce3dad9dcfc6f8700438be98.asciidoc
@@ -0,0 +1,64 @@
+// This file is autogenerated, DO NOT EDIT
+// query-rules/apis/put-query-ruleset.asciidoc:117
+
+[source, python]
+----
+resp = client.query_rules.put_ruleset(
+ ruleset_id="my-ruleset",
+ rules=[
+ {
+ "rule_id": "my-rule1",
+ "type": "pinned",
+ "criteria": [
+ {
+ "type": "contains",
+ "metadata": "user_query",
+ "values": [
+ "pugs",
+ "puggles"
+ ]
+ },
+ {
+ "type": "exact",
+ "metadata": "user_country",
+ "values": [
+ "us"
+ ]
+ }
+ ],
+ "actions": {
+ "ids": [
+ "id1",
+ "id2"
+ ]
+ }
+ },
+ {
+ "rule_id": "my-rule2",
+ "type": "pinned",
+ "criteria": [
+ {
+ "type": "fuzzy",
+ "metadata": "user_query",
+ "values": [
+ "rescue dogs"
+ ]
+ }
+ ],
+ "actions": {
+ "docs": [
+ {
+ "_index": "index1",
+ "_id": "id3"
+ },
+ {
+ "_index": "index2",
+ "_id": "id4"
+ }
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/e61b5abe85000cc954a42e2cd74f3a26.asciidoc b/docs/examples/e61b5abe85000cc954a42e2cd74f3a26.asciidoc
new file mode 100644
index 000000000..afc63dda5
--- /dev/null
+++ b/docs/examples/e61b5abe85000cc954a42e2cd74f3a26.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/put-calendar.asciidoc:44
+
+[source, python]
+----
+resp = client.ml.put_calendar(
+ calendar_id="planned-outages",
+)
+print(resp)
+----
diff --git a/docs/examples/e6369e7cef82d881af593d5526bf79bd.asciidoc b/docs/examples/e6369e7cef82d881af593d5526bf79bd.asciidoc
new file mode 100644
index 000000000..68a5565b4
--- /dev/null
+++ b/docs/examples/e6369e7cef82d881af593d5526bf79bd.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-term-query.asciidoc:22
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_term": {
+ "user.id": {
+ "value": "kimchy",
+ "boost": 2
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e63775a2ff22b945ab9d5f630b80c506.asciidoc b/docs/examples/e63775a2ff22b945ab9d5f630b80c506.asciidoc
index 021d8f261..44d2a08a1 100644
--- a/docs/examples/e63775a2ff22b945ab9d5f630b80c506.asciidoc
+++ b/docs/examples/e63775a2ff22b945ab9d5f630b80c506.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// cluster/health.asciidoc:192
[source, python]
@@ -7,4 +8,4 @@ resp = client.cluster.health(
level="shards",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e63cf08350e9381f519c2835843be7cd.asciidoc b/docs/examples/e63cf08350e9381f519c2835843be7cd.asciidoc
index 4bc711121..f331130b9 100644
--- a/docs/examples/e63cf08350e9381f519c2835843be7cd.asciidoc
+++ b/docs/examples/e63cf08350e9381f519c2835843be7cd.asciidoc
@@ -1,17 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/field-mapping.asciidoc:175
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"dynamic_date_formats": ["yyyy/MM||MM/dd/yyyy"]}},
+ mappings={
+ "dynamic_date_formats": [
+ "yyyy/MM||MM/dd/yyyy"
+ ]
+ },
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"create_date": "09/25/2015"},
+ document={
+ "create_date": "09/25/2015"
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/e642be44a62a89cf4afb2db28220c9a9.asciidoc b/docs/examples/e642be44a62a89cf4afb2db28220c9a9.asciidoc
new file mode 100644
index 000000000..446aadee6
--- /dev/null
+++ b/docs/examples/e642be44a62a89cf4afb2db28220c9a9.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:459
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "ingest.geoip.downloader.enabled": True,
+ "indices.lifecycle.history_index_enabled": True
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e650d73c57ab313e686fec01e3b0c90f.asciidoc b/docs/examples/e650d73c57ab313e686fec01e3b0c90f.asciidoc
index dd12d14ca..23631b956 100644
--- a/docs/examples/e650d73c57ab313e686fec01e3b0c90f.asciidoc
+++ b/docs/examples/e650d73c57ab313e686fec01e3b0c90f.asciidoc
@@ -1,19 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:909
[source, python]
----
resp = client.reindex(
- body={
- "source": {"index": "my-index-000001"},
- "dest": {
- "index": "my-new-index-000001",
- "version_type": "external",
- },
- "script": {
- "source": "if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}",
- "lang": "painless",
- },
+ source={
+ "index": "my-index-000001"
+ },
+ dest={
+ "index": "my-new-index-000001",
+ "version_type": "external"
+ },
+ script={
+ "source": "if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}",
+ "lang": "painless"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e697ef947f3fb7835f7fadb9125b1043.asciidoc b/docs/examples/e697ef947f3fb7835f7fadb9125b1043.asciidoc
new file mode 100644
index 000000000..2cb6c80d2
--- /dev/null
+++ b/docs/examples/e697ef947f3fb7835f7fadb9125b1043.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:375
+
+[source, python]
+----
+resp = client.sql.query(
+ format="txt",
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ filter={
+ "range": {
+ "page_count": {
+ "gte": 100,
+ "lte": 200
+ }
+ }
+ },
+ fetch_size=5,
+)
+print(resp)
+----
diff --git a/docs/examples/e6b972611c0ec8ab4c240f33f323d85b.asciidoc b/docs/examples/e6b972611c0ec8ab4c240f33f323d85b.asciidoc
index a90bb7bfc..155d8053d 100644
--- a/docs/examples/e6b972611c0ec8ab4c240f33f323d85b.asciidoc
+++ b/docs/examples/e6b972611c0ec8ab4c240f33f323d85b.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:418
[source, python]
@@ -5,17 +6,15 @@
resp = client.search(
index="my-index-000001",
size="0",
- body={
- "aggs": {
- "by_day": {
- "date_histogram": {
- "field": "date",
- "calendar_interval": "day",
- "time_zone": "-01:00",
- }
+ aggs={
+ "by_day": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "day",
+ "time_zone": "-01:00"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e6ccd979c34ba03007e625c6ec3e71a9.asciidoc b/docs/examples/e6ccd979c34ba03007e625c6ec3e71a9.asciidoc
new file mode 100644
index 000000000..4e2a2d9e7
--- /dev/null
+++ b/docs/examples/e6ccd979c34ba03007e625c6ec3e71a9.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:258
+
+[source, python]
+----
+resp = client.indices.get_alias()
+print(resp)
+----
diff --git a/docs/examples/e6dcc2911d2416a65eaec9846b956e15.asciidoc b/docs/examples/e6dcc2911d2416a65eaec9846b956e15.asciidoc
new file mode 100644
index 000000000..559139160
--- /dev/null
+++ b/docs/examples/e6dcc2911d2416a65eaec9846b956e15.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/refresh.asciidoc:13
+
+[source, python]
+----
+resp = client.indices.refresh(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/e6e47da87079a8b67f767a2a01878cf2.asciidoc b/docs/examples/e6e47da87079a8b67f767a2a01878cf2.asciidoc
new file mode 100644
index 000000000..ead4dc782
--- /dev/null
+++ b/docs/examples/e6e47da87079a8b67f767a2a01878cf2.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:578
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "set": {
+ "description": "Use geo_point dynamic template for address field",
+ "field": "_dynamic_templates",
+ "value": {
+ "address": "geo_point"
+ }
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/e6faae2e272ee57727f38e55a3de5bb2.asciidoc b/docs/examples/e6faae2e272ee57727f38e55a3de5bb2.asciidoc
new file mode 100644
index 000000000..5efa745d0
--- /dev/null
+++ b/docs/examples/e6faae2e272ee57727f38e55a3de5bb2.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:545
+
+[source, python]
+----
+resp = client.search(
+ highlight={
+ "fields": [
+ {
+ "title": {}
+ },
+ {
+ "text": {}
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e71d300cd87f09a9527cf45395dd7eb1.asciidoc b/docs/examples/e71d300cd87f09a9527cf45395dd7eb1.asciidoc
new file mode 100644
index 000000000..fdc0e6034
--- /dev/null
+++ b/docs/examples/e71d300cd87f09a9527cf45395dd7eb1.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// slm/apis/slm-execute-retention.asciidoc:34
+
+[source, python]
+----
+resp = client.slm.execute_retention()
+print(resp)
+----
diff --git a/docs/examples/e784fc00894635470adfd78a0c46b427.asciidoc b/docs/examples/e784fc00894635470adfd78a0c46b427.asciidoc
new file mode 100644
index 000000000..ee0c04115
--- /dev/null
+++ b/docs/examples/e784fc00894635470adfd78a0c46b427.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/put-component-template.asciidoc:13
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="template_1",
+ template={
+ "settings": {
+ "number_of_shards": 1
+ },
+ "mappings": {
+ "_source": {
+ "enabled": False
+ },
+ "properties": {
+ "host_name": {
+ "type": "keyword"
+ },
+ "created_at": {
+ "type": "date",
+ "format": "EEE MMM dd HH:mm:ss Z yyyy"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e7d819634d765cde269e2669e2dc677f.asciidoc b/docs/examples/e7d819634d765cde269e2669e2dc677f.asciidoc
new file mode 100644
index 000000000..6f60455fb
--- /dev/null
+++ b/docs/examples/e7d819634d765cde269e2669e2dc677f.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-api-keys.asciidoc:145
+
+[source, python]
+----
+resp = client.security.invalidate_api_key(
+ username="myuser",
+)
+print(resp)
+----
diff --git a/docs/examples/e7e95022867c72a6563137f066dd2973.asciidoc b/docs/examples/e7e95022867c72a6563137f066dd2973.asciidoc
new file mode 100644
index 000000000..62a9e9421
--- /dev/null
+++ b/docs/examples/e7e95022867c72a6563137f066dd2973.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significantterms-aggregation.asciidoc:207
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "hotspots": {
+ "geohash_grid": {
+ "field": "location",
+ "precision": 5
+ },
+ "aggs": {
+ "significant_crime_types": {
+ "significant_terms": {
+ "field": "crime_type"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e7eca57a5bf5a53cbbe2463bce11495b.asciidoc b/docs/examples/e7eca57a5bf5a53cbbe2463bce11495b.asciidoc
index 0326a638f..eeb653817 100644
--- a/docs/examples/e7eca57a5bf5a53cbbe2463bce11495b.asciidoc
+++ b/docs/examples/e7eca57a5bf5a53cbbe2463bce11495b.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/metrics/valuecount-aggregation.asciidoc:15
[source, python]
@@ -5,7 +6,13 @@
resp = client.search(
index="sales",
size="0",
- body={"aggs": {"types_count": {"value_count": {"field": "type"}}}},
+ aggs={
+ "types_count": {
+ "value_count": {
+ "field": "type"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e8211247c280a3fbbbdd32850b743b7b.asciidoc b/docs/examples/e8211247c280a3fbbbdd32850b743b7b.asciidoc
new file mode 100644
index 000000000..47c64fe27
--- /dev/null
+++ b/docs/examples/e8211247c280a3fbbbdd32850b743b7b.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/put-dfanalytics.asciidoc:717
+
+[source, python]
+----
+resp = client.ml.put_data_frame_analytics(
+ id="house_price_regression_analysis",
+ source={
+ "index": "houses_sold_last_10_yrs"
+ },
+ dest={
+ "index": "house_price_predictions"
+ },
+ analysis={
+ "regression": {
+ "dependent_variable": "price"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e821d27a8b810821707ba860e31f8b78.asciidoc b/docs/examples/e821d27a8b810821707ba860e31f8b78.asciidoc
index 64b2d235f..2e60eeb2f 100644
--- a/docs/examples/e821d27a8b810821707ba860e31f8b78.asciidoc
+++ b/docs/examples/e821d27a8b810821707ba860e31f8b78.asciidoc
@@ -1,17 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// indices/put-mapping.asciidoc:232
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "properties": {
- "city": {
- "type": "text",
- "fields": {"raw": {"type": "keyword"}},
+ properties={
+ "city": {
+ "type": "text",
+ "fields": {
+ "raw": {
+ "type": "keyword"
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e827a9040e137410d62d10bb3b3cbb71.asciidoc b/docs/examples/e827a9040e137410d62d10bb3b3cbb71.asciidoc
new file mode 100644
index 000000000..1b6b284b1
--- /dev/null
+++ b/docs/examples/e827a9040e137410d62d10bb3b3cbb71.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/get-watch.asciidoc:49
+
+[source, python]
+----
+resp = client.watcher.get_watch(
+ id="my_watch",
+)
+print(resp)
+----
diff --git a/docs/examples/e82c33def91faddcfeed7b02cd258605.asciidoc b/docs/examples/e82c33def91faddcfeed7b02cd258605.asciidoc
new file mode 100644
index 000000000..e3627e34e
--- /dev/null
+++ b/docs/examples/e82c33def91faddcfeed7b02cd258605.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/multi-terms-aggregation.asciidoc:248
+
+[source, python]
+----
+resp = client.search(
+ index="products",
+ aggs={
+ "genres_and_products": {
+ "multi_terms": {
+ "terms": [
+ {
+ "field": "genre"
+ },
+ {
+ "field": "product",
+ "missing": "Product Z"
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e84e23232c7ecc8d6377ec2c16a60269.asciidoc b/docs/examples/e84e23232c7ecc8d6377ec2c16a60269.asciidoc
index ba2798df6..ec4c69a47 100644
--- a/docs/examples/e84e23232c7ecc8d6377ec2c16a60269.asciidoc
+++ b/docs/examples/e84e23232c7ecc8d6377ec2c16a60269.asciidoc
@@ -1,18 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
// indices/create-index.asciidoc:192
[source, python]
----
resp = client.indices.create(
index="test",
- body={
- "aliases": {
- "alias_1": {},
- "alias_2": {
- "filter": {"term": {"user.id": "kimchy"}},
- "routing": "shard-1",
+ aliases={
+ "alias_1": {},
+ "alias_2": {
+ "filter": {
+ "term": {
+ "user.id": "kimchy"
+ }
},
+ "routing": "shard-1"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e88a057a13e191e4d5faa22edf2ae8ed.asciidoc b/docs/examples/e88a057a13e191e4d5faa22edf2ae8ed.asciidoc
new file mode 100644
index 000000000..addb56963
--- /dev/null
+++ b/docs/examples/e88a057a13e191e4d5faa22edf2ae8ed.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:368
+
+[source, python]
+----
+resp = client.cluster.get_settings(
+ filter_path="**.xpack.profiling.templates.enabled",
+ include_defaults=True,
+)
+print(resp)
+----
diff --git a/docs/examples/e891e1d4805172da45a81f62b6b44aca.asciidoc b/docs/examples/e891e1d4805172da45a81f62b6b44aca.asciidoc
index 918d59a2e..36ef1bfc0 100644
--- a/docs/examples/e891e1d4805172da45a81f62b6b44aca.asciidoc
+++ b/docs/examples/e891e1d4805172da45a81f62b6b44aca.asciidoc
@@ -1,18 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:464
[source, python]
----
resp = client.search(
- body={
- "size": 0,
- "runtime_mappings": {
- "normalized_genre": {
- "type": "keyword",
- "script": "\n String genre = doc['genre'].value;\n if (doc['product'].value.startsWith('Anthology')) {\n emit(genre + ' anthology');\n } else {\n emit(genre);\n }\n ",
+ size=0,
+ runtime_mappings={
+ "normalized_genre": {
+ "type": "keyword",
+ "script": "\n String genre = doc['genre'].value;\n if (doc['product'].value.startsWith('Anthology')) {\n emit(genre + ' anthology');\n } else {\n emit(genre);\n }\n "
+ }
+ },
+ aggs={
+ "genres": {
+ "terms": {
+ "field": "normalized_genre"
}
- },
- "aggs": {"genres": {"terms": {"field": "normalized_genre"}}},
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e89bf0d893b7bf43c2d9b44db6cfe21b.asciidoc b/docs/examples/e89bf0d893b7bf43c2d9b44db6cfe21b.asciidoc
new file mode 100644
index 000000000..5c45c7c30
--- /dev/null
+++ b/docs/examples/e89bf0d893b7bf43c2d9b44db6cfe21b.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/rank-feature-query.asciidoc:295
+
+[source, python]
+----
+resp = client.search(
+ index="test",
+ query={
+ "rank_feature": {
+ "field": "pagerank",
+ "log": {
+ "scaling_factor": 4
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e8a2726eea5545355d1d0835d4599f55.asciidoc b/docs/examples/e8a2726eea5545355d1d0835d4599f55.asciidoc
index 7f7a0458d..f44133cd4 100644
--- a/docs/examples/e8a2726eea5545355d1d0835d4599f55.asciidoc
+++ b/docs/examples/e8a2726eea5545355d1d0835d4599f55.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/ip.asciidoc:126
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={"query": {"term": {"ip_addr": "2001:db8::/48"}}},
+ query={
+ "term": {
+ "ip_addr": "2001:db8::/48"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e8bb5c57bdeff22be8e5f39a99dfe70e.asciidoc b/docs/examples/e8bb5c57bdeff22be8e5f39a99dfe70e.asciidoc
new file mode 100644
index 000000000..ace65f14e
--- /dev/null
+++ b/docs/examples/e8bb5c57bdeff22be8e5f39a99dfe70e.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/sampler-aggregation.asciidoc:22
+
+[source, python]
+----
+resp = client.search(
+ index="stackoverflow",
+ size="0",
+ query={
+ "query_string": {
+ "query": "tags:kibana OR tags:javascript"
+ }
+ },
+ aggs={
+ "sample": {
+ "sampler": {
+ "shard_size": 200
+ },
+ "aggs": {
+ "keywords": {
+ "significant_terms": {
+ "field": "tags",
+ "exclude": [
+ "kibana",
+ "javascript"
+ ]
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e8c348cabe15dfe58ab4c3cc13a963fe.asciidoc b/docs/examples/e8c348cabe15dfe58ab4c3cc13a963fe.asciidoc
new file mode 100644
index 000000000..e39eb924d
--- /dev/null
+++ b/docs/examples/e8c348cabe15dfe58ab4c3cc13a963fe.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-shards.asciidoc:71
+
+[source, python]
+----
+resp = client.search_shards(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/e8cbe2269f3dff6b231e73119e81511d.asciidoc b/docs/examples/e8cbe2269f3dff6b231e73119e81511d.asciidoc
index 2cffa2aaf..eeb67a89e 100644
--- a/docs/examples/e8cbe2269f3dff6b231e73119e81511d.asciidoc
+++ b/docs/examples/e8cbe2269f3dff6b231e73119e81511d.asciidoc
@@ -1,9 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/exists-query.asciidoc:20
[source, python]
----
resp = client.search(
- body={"query": {"exists": {"field": "user"}}},
+ query={
+ "exists": {
+ "field": "user"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e8ea65153d7775f25b08dfdfe6954498.asciidoc b/docs/examples/e8ea65153d7775f25b08dfdfe6954498.asciidoc
new file mode 100644
index 000000000..089cb7473
--- /dev/null
+++ b/docs/examples/e8ea65153d7775f25b08dfdfe6954498.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/simple-query-string-query.asciidoc:245
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "simple_query_string": {
+ "query": "Will Smith",
+ "fields": [
+ "title",
+ "*_name"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e8f1c9ee003d115ec8f55e57990df6e4.asciidoc b/docs/examples/e8f1c9ee003d115ec8f55e57990df6e4.asciidoc
new file mode 100644
index 000000000..d59f83d38
--- /dev/null
+++ b/docs/examples/e8f1c9ee003d115ec8f55e57990df6e4.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-category.asciidoc:148
+
+[source, python]
+----
+resp = client.ml.get_categories(
+ job_id="esxi_log",
+ page={
+ "size": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e905543b281e9c41395304da76ed2ea3.asciidoc b/docs/examples/e905543b281e9c41395304da76ed2ea3.asciidoc
new file mode 100644
index 000000000..865050d0d
--- /dev/null
+++ b/docs/examples/e905543b281e9c41395304da76ed2ea3.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/troubleshooting.asciidoc:29
+
+[source, python]
+----
+resp = client.indices.delete(
+ index=".watches",
+)
+print(resp)
+----
diff --git a/docs/examples/e930a572e8ddfdecc13498c04007b9e3.asciidoc b/docs/examples/e930a572e8ddfdecc13498c04007b9e3.asciidoc
new file mode 100644
index 000000000..021358129
--- /dev/null
+++ b/docs/examples/e930a572e8ddfdecc13498c04007b9e3.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-mapping.asciidoc:97
+
+[source, python]
+----
+resp = client.indices.create(
+ index="openai-embeddings",
+ mappings={
+ "properties": {
+ "content_embedding": {
+ "type": "dense_vector",
+ "dims": 1536,
+ "element_type": "float",
+ "similarity": "dot_product"
+ },
+ "content": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e93ff228ab3e63738e1c83fdfb7424b9.asciidoc b/docs/examples/e93ff228ab3e63738e1c83fdfb7424b9.asciidoc
new file mode 100644
index 000000000..daca718ee
--- /dev/null
+++ b/docs/examples/e93ff228ab3e63738e1c83fdfb7424b9.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:434
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "user.id": "kimchy"
+ }
+ },
+ highlight={
+ "pre_tags": [
+ ""
+ ],
+ "post_tags": [
+ ""
+ ],
+ "fields": {
+ "body": {}
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e944653610f311fa06148d5b0afdf697.asciidoc b/docs/examples/e944653610f311fa06148d5b0afdf697.asciidoc
new file mode 100644
index 000000000..79faa0c40
--- /dev/null
+++ b/docs/examples/e944653610f311fa06148d5b0afdf697.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/index-templates.asciidoc:83
+
+[source, python]
+----
+resp = client.cluster.put_component_template(
+ name="component_template1",
+ template={
+ "mappings": {
+ "properties": {
+ "@timestamp": {
+ "type": "date"
+ }
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.cluster.put_component_template(
+ name="runtime_component_template",
+ template={
+ "mappings": {
+ "runtime": {
+ "day_of_week": {
+ "type": "keyword",
+ "script": {
+ "source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/e95ba581b298cd7bb598374afbfed315.asciidoc b/docs/examples/e95ba581b298cd7bb598374afbfed315.asciidoc
new file mode 100644
index 000000000..6ccf79e1c
--- /dev/null
+++ b/docs/examples/e95ba581b298cd7bb598374afbfed315.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/frequent-item-sets-aggregation.asciidoc:173
+
+[source, python]
+----
+resp = client.async_search.get(
+ id="",
+)
+print(resp)
+----
diff --git a/docs/examples/e95e61988dc3073a007f7b7445dd233b.asciidoc b/docs/examples/e95e61988dc3073a007f7b7445dd233b.asciidoc
new file mode 100644
index 000000000..58ddd86d2
--- /dev/null
+++ b/docs/examples/e95e61988dc3073a007f7b7445dd233b.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/lifecycle/tutorial-migrate-data-stream-from-ilm-to-dsl.asciidoc:192
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="dsl-data-stream-template",
+ index_patterns=[
+ "dsl-data-stream*"
+ ],
+ data_stream={},
+ priority=500,
+ template={
+ "settings": {
+ "index.lifecycle.name": "pre-dsl-ilm-policy",
+ "index.lifecycle.prefer_ilm": False
+ },
+ "lifecycle": {
+ "data_retention": "7d"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e9738fe09a99080506a07945795e8eda.asciidoc b/docs/examples/e9738fe09a99080506a07945795e8eda.asciidoc
new file mode 100644
index 000000000..742cb20b5
--- /dev/null
+++ b/docs/examples/e9738fe09a99080506a07945795e8eda.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/stop-tokenfilter.asciidoc:31
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "stop"
+ ],
+ text="a quick fox jumps over the lazy dog",
+)
+print(resp)
+----
diff --git a/docs/examples/e99c45a47dc0ba7440aea8a9a99c84fa.asciidoc b/docs/examples/e99c45a47dc0ba7440aea8a9a99c84fa.asciidoc
new file mode 100644
index 000000000..3dad6be63
--- /dev/null
+++ b/docs/examples/e99c45a47dc0ba7440aea8a9a99c84fa.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significanttext-aggregation.asciidoc:39
+
+[source, python]
+----
+resp = client.search(
+ index="news",
+ query={
+ "match": {
+ "content": "Bird flu"
+ }
+ },
+ aggregations={
+ "my_sample": {
+ "sampler": {
+ "shard_size": 100
+ },
+ "aggregations": {
+ "keywords": {
+ "significant_text": {
+ "field": "content"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e9a0b450af6219772631703d602c7092.asciidoc b/docs/examples/e9a0b450af6219772631703d602c7092.asciidoc
new file mode 100644
index 000000000..9c1d7c061
--- /dev/null
+++ b/docs/examples/e9a0b450af6219772631703d602c7092.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/text-expansion-query.asciidoc:222
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "text_expansion": {
+ "ml.tokens": {
+ "model_id": ".elser_model_2",
+ "model_text": "How is the weather in Jamaica?",
+ "pruning_config": {
+ "tokens_freq_ratio_threshold": 5,
+ "tokens_weight_threshold": 0.4,
+ "only_score_pruned_tokens": False
+ }
+ }
+ }
+ },
+ rescore={
+ "window_size": 100,
+ "query": {
+ "rescore_query": {
+ "text_expansion": {
+ "ml.tokens": {
+ "model_id": ".elser_model_2",
+ "model_text": "How is the weather in Jamaica?",
+ "pruning_config": {
+ "tokens_freq_ratio_threshold": 5,
+ "tokens_weight_threshold": 0.4,
+ "only_score_pruned_tokens": True
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e9f9e184499a793828233e536fac0487.asciidoc b/docs/examples/e9f9e184499a793828233e536fac0487.asciidoc
index 4b8857073..534a69385 100644
--- a/docs/examples/e9f9e184499a793828233e536fac0487.asciidoc
+++ b/docs/examples/e9f9e184499a793828233e536fac0487.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/delete-by-query.asciidoc:412
[source, python]
@@ -5,7 +6,11 @@
resp = client.delete_by_query(
index="my-index-000001",
scroll_size="5000",
- body={"query": {"term": {"user.id": "kimchy"}}},
+ query={
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/e9fc47015922d51c2b05e502ce9c622e.asciidoc b/docs/examples/e9fc47015922d51c2b05e502ce9c622e.asciidoc
new file mode 100644
index 000000000..1e857e8bf
--- /dev/null
+++ b/docs/examples/e9fc47015922d51c2b05e502ce9c622e.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-google-ai-studio.asciidoc:77
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="completion",
+ inference_id="google_ai_studio_completion",
+ inference_config={
+ "service": "googleaistudio",
+ "service_settings": {
+ "api_key": "",
+ "model_id": ""
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/e9fe3b53b5b6e1ff9566b5237c0fa513.asciidoc b/docs/examples/e9fe3b53b5b6e1ff9566b5237c0fa513.asciidoc
new file mode 100644
index 000000000..569eeef0f
--- /dev/null
+++ b/docs/examples/e9fe3b53b5b6e1ff9566b5237c0fa513.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/children-aggregation.asciidoc:59
+
+[source, python]
+----
+resp = client.index(
+ index="child_example",
+ id="2",
+ routing="1",
+ document={
+ "join": {
+ "name": "answer",
+ "parent": "1"
+ },
+ "owner": {
+ "location": "Norfolk, United Kingdom",
+ "display_name": "Sam",
+ "id": 48
+ },
+ "body": "Unfortunately you're pretty much limited to FTP...",
+ "creation_date": "2009-05-04T13:45:37.030"
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="child_example",
+ id="3",
+ routing="1",
+ refresh=True,
+ document={
+ "join": {
+ "name": "answer",
+ "parent": "1"
+ },
+ "owner": {
+ "location": "Norfolk, United Kingdom",
+ "display_name": "Troll",
+ "id": 49
+ },
+ "body": "Use Linux...",
+ "creation_date": "2009-05-05T13:45:37.030"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/ea020ea32d5cd35e577c61a120f92451.asciidoc b/docs/examples/ea020ea32d5cd35e577c61a120f92451.asciidoc
new file mode 100644
index 000000000..d5651d0a0
--- /dev/null
+++ b/docs/examples/ea020ea32d5cd35e577c61a120f92451.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-a-data-stream.asciidoc:240
+
+[source, python]
+----
+resp = client.bulk(
+ index="my-data-stream",
+ operations=[
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2099-05-06T16:21:15.000Z",
+ "message": "192.0.2.42 - - [06/May/2099:16:21:15 +0000] \"GET /images/bg.jpg HTTP/1.0\" 200 24736"
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2099-05-06T16:25:42.000Z",
+ "message": "192.0.2.255 - - [06/May/2099:16:25:42 +0000] \"GET /favicon.ico HTTP/1.0\" 200 3638"
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-data-stream",
+ document={
+ "@timestamp": "2099-05-06T16:21:15.000Z",
+ "message": "192.0.2.42 - - [06/May/2099:16:21:15 +0000] \"GET /images/bg.jpg HTTP/1.0\" 200 24736"
+ },
+)
+print(resp1)
+----
diff --git a/docs/examples/ea29029884a5fd9a8d8830d25884bf07.asciidoc b/docs/examples/ea29029884a5fd9a8d8830d25884bf07.asciidoc
new file mode 100644
index 000000000..fe2a042b2
--- /dev/null
+++ b/docs/examples/ea29029884a5fd9a8d8830d25884bf07.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/parent-id-query.asciidoc:79
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "parent_id": {
+ "type": "my-child",
+ "id": "1"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ea313059c18d6edbd28c3f743a5e7c1c.asciidoc b/docs/examples/ea313059c18d6edbd28c3f743a5e7c1c.asciidoc
new file mode 100644
index 000000000..670ca91c4
--- /dev/null
+++ b/docs/examples/ea313059c18d6edbd28c3f743a5e7c1c.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/significantterms-aggregation.asciidoc:602
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "city": "madrid"
+ }
+ },
+ aggs={
+ "tags": {
+ "significant_terms": {
+ "field": "tag",
+ "background_filter": {
+ "term": {
+ "text": "spain"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ea5391267ced860c00214c096e08c8d4.asciidoc b/docs/examples/ea5391267ced860c00214c096e08c8d4.asciidoc
index e1d9a8887..b9988415e 100644
--- a/docs/examples/ea5391267ced860c00214c096e08c8d4.asciidoc
+++ b/docs/examples/ea5391267ced860c00214c096e08c8d4.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// indices/update-settings.asciidoc:13
[source, python]
----
resp = client.indices.put_settings(
index="my-index-000001",
- body={"index": {"number_of_replicas": 2}},
+ settings={
+ "index": {
+ "number_of_replicas": 2
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ea5b4d2d87fd4e040afad18903c44869.asciidoc b/docs/examples/ea5b4d2d87fd4e040afad18903c44869.asciidoc
new file mode 100644
index 000000000..30ba5c72a
--- /dev/null
+++ b/docs/examples/ea5b4d2d87fd4e040afad18903c44869.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-bounding-box-query.asciidoc:185
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_bounding_box": {
+ "pin.location": {
+ "top_left": {
+ "lat": 40.73,
+ "lon": -74.1
+ },
+ "bottom_right": {
+ "lat": 40.01,
+ "lon": -71.12
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ea61aa2531ea73ccc0acd2d41f0518eb.asciidoc b/docs/examples/ea61aa2531ea73ccc0acd2d41f0518eb.asciidoc
index 923f9eecb..1aef91de0 100644
--- a/docs/examples/ea61aa2531ea73ccc0acd2d41f0518eb.asciidoc
+++ b/docs/examples/ea61aa2531ea73ccc0acd2d41f0518eb.asciidoc
@@ -1,33 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/rank-feature.asciidoc:11
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "pagerank": {"type": "rank_feature"},
- "url_length": {
- "type": "rank_feature",
- "positive_score_impact": False,
- },
+ mappings={
+ "properties": {
+ "pagerank": {
+ "type": "rank_feature"
+ },
+ "url_length": {
+ "type": "rank_feature",
+ "positive_score_impact": False
}
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"pagerank": 8, "url_length": 22},
+ document={
+ "pagerank": 8,
+ "url_length": 22
+ },
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
- body={"query": {"rank_feature": {"field": "pagerank"}}},
+ query={
+ "rank_feature": {
+ "field": "pagerank"
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/ea66a620c23337545e409c120c4ed5d9.asciidoc b/docs/examples/ea66a620c23337545e409c120c4ed5d9.asciidoc
new file mode 100644
index 000000000..45cb83388
--- /dev/null
+++ b/docs/examples/ea66a620c23337545e409c120c4ed5d9.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/ilm-tutorial.asciidoc:207
+
+[source, python]
+----
+resp = client.ilm.explain_lifecycle(
+ index=".ds-timeseries-*",
+)
+print(resp)
+----
diff --git a/docs/examples/ea68e3428cc2ca3455bf312d09451489.asciidoc b/docs/examples/ea68e3428cc2ca3455bf312d09451489.asciidoc
new file mode 100644
index 000000000..cfee2236c
--- /dev/null
+++ b/docs/examples/ea68e3428cc2ca3455bf312d09451489.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:1080
+
+[source, python]
+----
+resp = client.indices.create(
+ index="product-index",
+ mappings={
+ "properties": {
+ "product-vector": {
+ "type": "dense_vector",
+ "dims": 5,
+ "index": False
+ },
+ "price": {
+ "type": "long"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ea690283f301c6ce957efad93d7d5c5d.asciidoc b/docs/examples/ea690283f301c6ce957efad93d7d5c5d.asciidoc
new file mode 100644
index 000000000..51e0a88f2
--- /dev/null
+++ b/docs/examples/ea690283f301c6ce957efad93d7d5c5d.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/length-tokenfilter.asciidoc:109
+
+[source, python]
+----
+resp = client.indices.create(
+ index="length_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_length": {
+ "tokenizer": "standard",
+ "filter": [
+ "length"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ea92390651e8ecad0c890658985343c5.asciidoc b/docs/examples/ea92390651e8ecad0c890658985343c5.asciidoc
new file mode 100644
index 000000000..4b3ff98dc
--- /dev/null
+++ b/docs/examples/ea92390651e8ecad0c890658985343c5.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:557
+
+[source, python]
+----
+resp = client.slm.put_lifecycle(
+ policy_id="hourly-snapshots",
+ name="",
+ schedule="0 0 * * * ?",
+ repository="my_repository",
+ config={
+ "indices": "*",
+ "include_global_state": True
+ },
+ retention={
+ "expire_after": "1d",
+ "min_count": 1,
+ "max_count": 24
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eab3cad0257c539c5efd2689aa52f242.asciidoc b/docs/examples/eab3cad0257c539c5efd2689aa52f242.asciidoc
new file mode 100644
index 000000000..922c22deb
--- /dev/null
+++ b/docs/examples/eab3cad0257c539c5efd2689aa52f242.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:111
+
+[source, python]
+----
+resp = client.indices.data_streams_stats(
+ name="my-data-stream",
+ human=True,
+)
+print(resp)
+----
diff --git a/docs/examples/eac3bc428d03eb4926fa51f74b9bc4d5.asciidoc b/docs/examples/eac3bc428d03eb4926fa51f74b9bc4d5.asciidoc
new file mode 100644
index 000000000..1e1e3bad5
--- /dev/null
+++ b/docs/examples/eac3bc428d03eb4926fa51f74b9bc4d5.asciidoc
@@ -0,0 +1,61 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/highlighting.asciidoc:342
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "match": {
+ "comment": {
+ "query": "foo bar"
+ }
+ }
+ },
+ rescore={
+ "window_size": 50,
+ "query": {
+ "rescore_query": {
+ "match_phrase": {
+ "comment": {
+ "query": "foo bar",
+ "slop": 1
+ }
+ }
+ },
+ "rescore_query_weight": 10
+ }
+ },
+ source=False,
+ highlight={
+ "order": "score",
+ "fields": {
+ "comment": {
+ "fragment_size": 150,
+ "number_of_fragments": 3,
+ "highlight_query": {
+ "bool": {
+ "must": {
+ "match": {
+ "comment": {
+ "query": "foo bar"
+ }
+ }
+ },
+ "should": {
+ "match_phrase": {
+ "comment": {
+ "query": "foo bar",
+ "slop": 1,
+ "boost": 10
+ }
+ }
+ },
+ "minimum_should_match": 0
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ead4d875877d618594d0cdbdd9b7998b.asciidoc b/docs/examples/ead4d875877d618594d0cdbdd9b7998b.asciidoc
index 10fff719e..b216a1bd0 100644
--- a/docs/examples/ead4d875877d618594d0cdbdd9b7998b.asciidoc
+++ b/docs/examples/ead4d875877d618594d0cdbdd9b7998b.asciidoc
@@ -1,6 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// setup/add-nodes.asciidoc:170
[source, python]
----
+resp = client.cluster.delete_voting_config_exclusions()
+print(resp)
-----
\ No newline at end of file
+resp1 = client.cluster.delete_voting_config_exclusions(
+ wait_for_removal=False,
+)
+print(resp1)
+----
diff --git a/docs/examples/eada8af6588584ac88f1e5b15f4a5c2a.asciidoc b/docs/examples/eada8af6588584ac88f1e5b15f4a5c2a.asciidoc
index aced2c895..4ee339ffd 100644
--- a/docs/examples/eada8af6588584ac88f1e5b15f4a5c2a.asciidoc
+++ b/docs/examples/eada8af6588584ac88f1e5b15f4a5c2a.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/metrics/valuecount-aggregation.asciidoc:97
[source, python]
@@ -5,37 +6,63 @@
resp = client.index(
index="metrics_index",
id="1",
- body={
+ document={
"network.name": "net-1",
"latency_histo": {
- "values": [0.1, 0.2, 0.3, 0.4, 0.5],
- "counts": [3, 7, 23, 12, 6],
- },
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 3,
+ 7,
+ 23,
+ 12,
+ 6
+ ]
+ }
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="metrics_index",
id="2",
- body={
+ document={
"network.name": "net-2",
"latency_histo": {
- "values": [0.1, 0.2, 0.3, 0.4, 0.5],
- "counts": [8, 17, 8, 7, 6],
- },
+ "values": [
+ 0.1,
+ 0.2,
+ 0.3,
+ 0.4,
+ 0.5
+ ],
+ "counts": [
+ 8,
+ 17,
+ 8,
+ 7,
+ 6
+ ]
+ }
},
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="metrics_index",
size="0",
- body={
- "aggs": {
- "total_requests": {"value_count": {"field": "latency_histo"}}
+ aggs={
+ "total_requests": {
+ "value_count": {
+ "field": "latency_histo"
+ }
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/eae8931d01b3b878dd0c45214121e662.asciidoc b/docs/examples/eae8931d01b3b878dd0c45214121e662.asciidoc
new file mode 100644
index 000000000..ac3bae88a
--- /dev/null
+++ b/docs/examples/eae8931d01b3b878dd0c45214121e662.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-bounding-box-query.asciidoc:329
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "geo_bounding_box": {
+ "pin.location": {
+ "top_left": "dr",
+ "bottom_right": "dr"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eaf53b05959cc6b7fb09579baf34de68.asciidoc b/docs/examples/eaf53b05959cc6b7fb09579baf34de68.asciidoc
new file mode 100644
index 000000000..edec0e1f1
--- /dev/null
+++ b/docs/examples/eaf53b05959cc6b7fb09579baf34de68.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline.asciidoc:127
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sale_type": {
+ "terms": {
+ "field": "type"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ }
+ }
+ },
+ "hat_vs_bag_ratio": {
+ "bucket_script": {
+ "buckets_path": {
+ "hats": "sale_type['hat']>sales",
+ "bags": "sale_type['bag']>sales"
+ },
+ "script": "params.hats / params.bags"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eaf6a846ded090fd6ac48269ad2b328b.asciidoc b/docs/examples/eaf6a846ded090fd6ac48269ad2b328b.asciidoc
new file mode 100644
index 000000000..4089b179d
--- /dev/null
+++ b/docs/examples/eaf6a846ded090fd6ac48269ad2b328b.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-rollover.asciidoc:38
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "index.lifecycle.name": "my_policy",
+ "index.lifecycle.rollover_alias": "my_data"
+ },
+ aliases={
+ "my_data": {
+ "is_write_index": True
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eafdabe80b21b90495555fa6d9089412.asciidoc b/docs/examples/eafdabe80b21b90495555fa6d9089412.asciidoc
new file mode 100644
index 000000000..fb29b3198
--- /dev/null
+++ b/docs/examples/eafdabe80b21b90495555fa6d9089412.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-service-token-caches.asciidoc:62
+
+[source, python]
+----
+resp = client.security.clear_cached_service_tokens(
+ namespace="elastic",
+ service="fleet-server",
+ name="token1,token2",
+)
+print(resp)
+----
diff --git a/docs/examples/eb09235533a1c65a0627ba05f7d4ad4d.asciidoc b/docs/examples/eb09235533a1c65a0627ba05f7d4ad4d.asciidoc
new file mode 100644
index 000000000..6b5be886a
--- /dev/null
+++ b/docs/examples/eb09235533a1c65a0627ba05f7d4ad4d.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/context-suggest.asciidoc:253
+
+[source, python]
+----
+resp = client.index(
+ index="place",
+ id="1",
+ document={
+ "suggest": {
+ "input": "timmy's",
+ "contexts": {
+ "location": [
+ {
+ "lat": 43.6624803,
+ "lon": -79.3863353
+ },
+ {
+ "lat": 43.6624718,
+ "lon": -79.3873227
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eb141f8df8ead40ff7440b623ea92267.asciidoc b/docs/examples/eb141f8df8ead40ff7440b623ea92267.asciidoc
new file mode 100644
index 000000000..95af71672
--- /dev/null
+++ b/docs/examples/eb141f8df8ead40ff7440b623ea92267.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/copy-to.asciidoc:94
+
+[source, python]
+----
+resp = client.indices.create(
+ index="good_example_index",
+ mappings={
+ "properties": {
+ "field_1": {
+ "type": "text",
+ "copy_to": [
+ "field_2",
+ "field_3"
+ ]
+ },
+ "field_2": {
+ "type": "text"
+ },
+ "field_3": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eb14cedd3bdda9ffef3c118f3d528dcd.asciidoc b/docs/examples/eb14cedd3bdda9ffef3c118f3d528dcd.asciidoc
index 56d4c5206..63e6844bc 100644
--- a/docs/examples/eb14cedd3bdda9ffef3c118f3d528dcd.asciidoc
+++ b/docs/examples/eb14cedd3bdda9ffef3c118f3d528dcd.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:172
[source, python]
@@ -5,7 +6,7 @@
resp = client.update(
index="test",
id="1",
- body={"script": "ctx._source.new_field = 'value_of_new_field'"},
+ script="ctx._source.new_field = 'value_of_new_field'",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/eb33a7e5a0fe83fdaa0f79354f659428.asciidoc b/docs/examples/eb33a7e5a0fe83fdaa0f79354f659428.asciidoc
index 2b29be190..991140145 100644
--- a/docs/examples/eb33a7e5a0fe83fdaa0f79354f659428.asciidoc
+++ b/docs/examples/eb33a7e5a0fe83fdaa0f79354f659428.asciidoc
@@ -1,19 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:740
[source, python]
----
resp = client.indices.put_mapping(
index="my-index-000001",
- body={
- "runtime": {
- "client_ip": {
- "type": "ip",
- "script": {
- "source": 'String m = doc["message"].value; int end = m.indexOf(" "); emit(m.substring(0, end));'
- },
+ runtime={
+ "client_ip": {
+ "type": "ip",
+ "script": {
+ "source": "String m = doc[\"message\"].value; int end = m.indexOf(\" \"); emit(m.substring(0, end));"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/eb4e43b47867b54214a8630172dd0e21.asciidoc b/docs/examples/eb4e43b47867b54214a8630172dd0e21.asciidoc
new file mode 100644
index 000000000..71fc1718f
--- /dev/null
+++ b/docs/examples/eb4e43b47867b54214a8630172dd0e21.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/delete-forecast.asciidoc:69
+
+[source, python]
+----
+resp = client.ml.delete_forecast(
+ job_id="total-requests",
+ forecast_id="_all",
+)
+print(resp)
+----
diff --git a/docs/examples/eb54506fbc71a7d250e86b22d0600114.asciidoc b/docs/examples/eb54506fbc71a7d250e86b22d0600114.asciidoc
new file mode 100644
index 000000000..e4e933248
--- /dev/null
+++ b/docs/examples/eb54506fbc71a7d250e86b22d0600114.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/list-connectors-api.asciidoc:107
+
+[source, python]
+----
+resp = client.connector.list(
+ service_type="sharepoint_online,google_drive",
+)
+print(resp)
+----
diff --git a/docs/examples/eb5486d2fe4283475bf9e0e09280be16.asciidoc b/docs/examples/eb5486d2fe4283475bf9e0e09280be16.asciidoc
new file mode 100644
index 000000000..58286364c
--- /dev/null
+++ b/docs/examples/eb5486d2fe4283475bf9e0e09280be16.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-forcemerge.asciidoc:64
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "warm": {
+ "actions": {
+ "forcemerge": {
+ "max_num_segments": 1
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eb5987b58dae90c3a8a1609410be0570.asciidoc b/docs/examples/eb5987b58dae90c3a8a1609410be0570.asciidoc
new file mode 100644
index 000000000..89a76c387
--- /dev/null
+++ b/docs/examples/eb5987b58dae90c3a8a1609410be0570.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1092
+
+[source, python]
+----
+resp = client.indices.create(
+ index="indonesian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "indonesian_stop": {
+ "type": "stop",
+ "stopwords": "_indonesian_"
+ },
+ "indonesian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "contoh"
+ ]
+ },
+ "indonesian_stemmer": {
+ "type": "stemmer",
+ "language": "indonesian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_indonesian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "indonesian_stop",
+ "indonesian_keywords",
+ "indonesian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eb6d62f1d855a8e8fe9eab2656d47504.asciidoc b/docs/examples/eb6d62f1d855a8e8fe9eab2656d47504.asciidoc
new file mode 100644
index 000000000..513a70952
--- /dev/null
+++ b/docs/examples/eb6d62f1d855a8e8fe9eab2656d47504.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/phrase-suggest.asciidoc:410
+
+[source, python]
+----
+resp = client.search(
+ index="test",
+ suggest={
+ "text": "obel prize",
+ "simple_phrase": {
+ "phrase": {
+ "field": "title.trigram",
+ "size": 1,
+ "direct_generator": [
+ {
+ "field": "title.trigram",
+ "suggest_mode": "always"
+ },
+ {
+ "field": "title.reverse",
+ "suggest_mode": "always",
+ "pre_filter": "reverse",
+ "post_filter": "reverse"
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eb964d8d7f27c057a4542448ba5b74e4.asciidoc b/docs/examples/eb964d8d7f27c057a4542448ba5b74e4.asciidoc
new file mode 100644
index 000000000..8fde55ac3
--- /dev/null
+++ b/docs/examples/eb964d8d7f27c057a4542448ba5b74e4.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/get-snapshot-api.asciidoc:482
+
+[source, python]
+----
+resp = client.snapshot.get(
+ repository="my_repository",
+ snapshot="snapshot*",
+ size="2",
+ sort="name",
+ after="c25hcHNob3RfMixteV9yZXBvc2l0b3J5LHNuYXBzaG90XzI=",
+)
+print(resp)
+----
diff --git a/docs/examples/eb96d7dd5f3116a50f7a86b729f1a934.asciidoc b/docs/examples/eb96d7dd5f3116a50f7a86b729f1a934.asciidoc
new file mode 100644
index 000000000..8f52a9370
--- /dev/null
+++ b/docs/examples/eb96d7dd5f3116a50f7a86b729f1a934.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-scheduling-api.asciidoc:119
+
+[source, python]
+----
+resp = client.connector.update_scheduling(
+ connector_id="my-connector",
+ scheduling={
+ "full": {
+ "enabled": True,
+ "interval": "0 10 0 * * ?"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eb9a41f7fc8bdf5559bb9db822ae3a65.asciidoc b/docs/examples/eb9a41f7fc8bdf5559bb9db822ae3a65.asciidoc
new file mode 100644
index 000000000..62fa7fdbc
--- /dev/null
+++ b/docs/examples/eb9a41f7fc8bdf5559bb9db822ae3a65.asciidoc
@@ -0,0 +1,92 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/bulk-create-roles.asciidoc:217
+
+[source, python]
+----
+resp = client.security.bulk_put_role(
+ roles={
+ "my_admin_role": {
+ "cluster": [
+ "bad_cluster_privilege"
+ ],
+ "indices": [
+ {
+ "names": [
+ "index1",
+ "index2"
+ ],
+ "privileges": [
+ "all"
+ ],
+ "field_security": {
+ "grant": [
+ "title",
+ "body"
+ ]
+ },
+ "query": "{\"match\": {\"title\": \"foo\"}}"
+ }
+ ],
+ "applications": [
+ {
+ "application": "myapp",
+ "privileges": [
+ "admin",
+ "read"
+ ],
+ "resources": [
+ "*"
+ ]
+ }
+ ],
+ "run_as": [
+ "other_user"
+ ],
+ "metadata": {
+ "version": 1
+ }
+ },
+ "my_user_role": {
+ "cluster": [
+ "all"
+ ],
+ "indices": [
+ {
+ "names": [
+ "index1"
+ ],
+ "privileges": [
+ "read"
+ ],
+ "field_security": {
+ "grant": [
+ "title",
+ "body"
+ ]
+ },
+ "query": "{\"match\": {\"title\": \"foo\"}}"
+ }
+ ],
+ "applications": [
+ {
+ "application": "myapp",
+ "privileges": [
+ "admin",
+ "read"
+ ],
+ "resources": [
+ "*"
+ ]
+ }
+ ],
+ "run_as": [
+ "other_user"
+ ],
+ "metadata": {
+ "version": 1
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ebb1c7554e91adb4552599f3e5de1865.asciidoc b/docs/examples/ebb1c7554e91adb4552599f3e5de1865.asciidoc
new file mode 100644
index 000000000..eeaf1d1f8
--- /dev/null
+++ b/docs/examples/ebb1c7554e91adb4552599f3e5de1865.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/split-index.asciidoc:84
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "index": {
+ "number_of_routing_shards": 30
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ebd76a45e153c4656c5871e23b7b5508.asciidoc b/docs/examples/ebd76a45e153c4656c5871e23b7b5508.asciidoc
new file mode 100644
index 000000000..65636068e
--- /dev/null
+++ b/docs/examples/ebd76a45e153c4656c5871e23b7b5508.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/delete-app-privileges.asciidoc:41
+
+[source, python]
+----
+resp = client.security.delete_privileges(
+ application="myapp",
+ name="read",
+)
+print(resp)
+----
diff --git a/docs/examples/ebef3dc8ed1766d433a5cffc40fde7ae.asciidoc b/docs/examples/ebef3dc8ed1766d433a5cffc40fde7ae.asciidoc
new file mode 100644
index 000000000..3d468357e
--- /dev/null
+++ b/docs/examples/ebef3dc8ed1766d433a5cffc40fde7ae.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/set-up-lifecycle-policy.asciidoc:289
+
+[source, python]
+----
+resp = client.ilm.remove_policy(
+ index="logs-my_app-default",
+)
+print(resp)
+----
diff --git a/docs/examples/ec0e50f78390b8622cef4e0b0cd45967.asciidoc b/docs/examples/ec0e50f78390b8622cef4e0b0cd45967.asciidoc
new file mode 100644
index 000000000..494db9504
--- /dev/null
+++ b/docs/examples/ec0e50f78390b8622cef4e0b0cd45967.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql-search-api.asciidoc:533
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ query="\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/ec195297eb804cba1cb19c9926773059.asciidoc b/docs/examples/ec195297eb804cba1cb19c9926773059.asciidoc
new file mode 100644
index 000000000..a0815c187
--- /dev/null
+++ b/docs/examples/ec195297eb804cba1cb19c9926773059.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/set-up-lifecycle-policy.asciidoc:265
+
+[source, python]
+----
+resp = client.indices.put_settings(
+ index="mylogs-pre-ilm*",
+ settings={
+ "index": {
+ "lifecycle": {
+ "name": "mylogs_policy_existing"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ec420b28e327f332c9e99d6040c4eb3f.asciidoc b/docs/examples/ec420b28e327f332c9e99d6040c4eb3f.asciidoc
new file mode 100644
index 000000000..f8ff9c8a7
--- /dev/null
+++ b/docs/examples/ec420b28e327f332c9e99d6040c4eb3f.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/geo-match-enrich-policy-type-ex.asciidoc:117
+
+[source, python]
+----
+resp = client.index(
+ index="users",
+ id="0",
+ pipeline="postal_lookup",
+ document={
+ "first_name": "Mardy",
+ "last_name": "Brown",
+ "geo_location": "POINT (13.5 52.5)"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ec44999b6618ac6bbacb23eb08c0fa88.asciidoc b/docs/examples/ec44999b6618ac6bbacb23eb08c0fa88.asciidoc
new file mode 100644
index 000000000..7d8fa608c
--- /dev/null
+++ b/docs/examples/ec44999b6618ac6bbacb23eb08c0fa88.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/common-script-uses.asciidoc:324
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ runtime_mappings={
+ "gc_size": {
+ "type": "keyword",
+ "script": "\n Map gc=dissect('[%{@timestamp}][%{code}][%{desc}] %{ident} used %{usize}, capacity %{csize}, committed %{comsize}, reserved %{rsize}').extract(doc[\"gc.keyword\"].value);\n if (gc != null) emit(\"used\" + ' ' + gc.usize + ', ' + \"capacity\" + ' ' + gc.csize + ', ' + \"committed\" + ' ' + gc.comsize);\n "
+ }
+ },
+ size=1,
+ aggs={
+ "sizes": {
+ "terms": {
+ "field": "gc_size",
+ "size": 10
+ }
+ }
+ },
+ fields=[
+ "gc_size"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/ec5a2ce156c36aaa267fa31dd9367307.asciidoc b/docs/examples/ec5a2ce156c36aaa267fa31dd9367307.asciidoc
new file mode 100644
index 000000000..08b09c56b
--- /dev/null
+++ b/docs/examples/ec5a2ce156c36aaa267fa31dd9367307.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/checkpoints.asciidoc:80
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="set_ingest_time",
+ description="Set ingest timestamp.",
+ processors=[
+ {
+ "set": {
+ "field": "event.ingested",
+ "value": "{{{_ingest.timestamp}}}"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/ec69543e39c1f6afb5aff6fb9adc400d.asciidoc b/docs/examples/ec69543e39c1f6afb5aff6fb9adc400d.asciidoc
new file mode 100644
index 000000000..5af31967a
--- /dev/null
+++ b/docs/examples/ec69543e39c1f6afb5aff6fb9adc400d.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/highlighting-multi-fields.asciidoc:29
+
+[source, python]
+----
+resp = client.bulk(
+ index="index1",
+ refresh=True,
+ operations=[
+ {
+ "index": {
+ "_id": "doc1"
+ }
+ },
+ {
+ "comment": "run with scissors"
+ },
+ {
+ "index": {
+ "_id": "doc2"
+ }
+ },
+ {
+ "comment": "running with scissors"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/ec736c31f49c54e5424efa2e53b22906.asciidoc b/docs/examples/ec736c31f49c54e5424efa2e53b22906.asciidoc
new file mode 100644
index 000000000..4dd636b9a
--- /dev/null
+++ b/docs/examples/ec736c31f49c54e5424efa2e53b22906.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/user-agent.asciidoc:31
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="user_agent",
+ description="Add user agent information",
+ processors=[
+ {
+ "user_agent": {
+ "field": "agent"
+ }
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="my_id",
+ pipeline="user_agent",
+ document={
+ "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
+ },
+)
+print(resp1)
+
+resp2 = client.get(
+ index="my-index-000001",
+ id="my_id",
+)
+print(resp2)
+----
diff --git a/docs/examples/ec8f176ebf436d5719bdeca4a9ea8220.asciidoc b/docs/examples/ec8f176ebf436d5719bdeca4a9ea8220.asciidoc
new file mode 100644
index 000000000..ea05c77da
--- /dev/null
+++ b/docs/examples/ec8f176ebf436d5719bdeca4a9ea8220.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/multi-terms-aggregation.asciidoc:172
+
+[source, python]
+----
+resp = client.search(
+ index="products",
+ runtime_mappings={
+ "genre.length": {
+ "type": "long",
+ "script": "emit(doc['genre'].value.length())"
+ }
+ },
+ aggs={
+ "genres_and_products": {
+ "multi_terms": {
+ "terms": [
+ {
+ "field": "genre.length"
+ },
+ {
+ "field": "product"
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ecc57597f6b791d1151ad79d9f4ce67b.asciidoc b/docs/examples/ecc57597f6b791d1151ad79d9f4ce67b.asciidoc
index 483bfbae0..6738e3ba3 100644
--- a/docs/examples/ecc57597f6b791d1151ad79d9f4ce67b.asciidoc
+++ b/docs/examples/ecc57597f6b791d1151ad79d9f4ce67b.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:643
[source, python]
@@ -5,18 +6,16 @@
resp = client.search(
index="sales",
size="0",
- body={
- "aggs": {
- "sales_over_time": {
- "date_histogram": {
- "field": "date",
- "calendar_interval": "1M",
- "format": "yyyy-MM-dd",
- "keyed": True,
- }
+ aggs={
+ "sales_over_time": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "1M",
+ "format": "yyyy-MM-dd",
+ "keyed": True
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ece01f9382e450f669c0e0925e5b30e5.asciidoc b/docs/examples/ece01f9382e450f669c0e0925e5b30e5.asciidoc
new file mode 100644
index 000000000..a34f7f61b
--- /dev/null
+++ b/docs/examples/ece01f9382e450f669c0e0925e5b30e5.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/daterange-aggregation.asciidoc:305
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ aggs={
+ "range": {
+ "date_range": {
+ "field": "date",
+ "format": "MM-yyy",
+ "ranges": [
+ {
+ "to": "now-10M/M"
+ },
+ {
+ "from": "now-10M/M"
+ }
+ ],
+ "keyed": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ecfd0d94dd14ef05dfa861f22544b388.asciidoc b/docs/examples/ecfd0d94dd14ef05dfa861f22544b388.asciidoc
new file mode 100644
index 000000000..39218d68e
--- /dev/null
+++ b/docs/examples/ecfd0d94dd14ef05dfa861f22544b388.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-error-api.asciidoc:80
+
+[source, python]
+----
+resp = client.connector.update_error(
+ connector_id="my-connector",
+ error="Houston, we have a problem!",
+)
+print(resp)
+----
diff --git a/docs/examples/ed01b542bb56b1521ea8d5a3c67aa891.asciidoc b/docs/examples/ed01b542bb56b1521ea8d5a3c67aa891.asciidoc
new file mode 100644
index 000000000..1b1aa3200
--- /dev/null
+++ b/docs/examples/ed01b542bb56b1521ea8d5a3c67aa891.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/repository-gcs.asciidoc:142
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_gcs_repository",
+ repository={
+ "type": "gcs",
+ "settings": {
+ "bucket": "my_bucket",
+ "client": "my_alternate_client"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ed01d27b8f80bb4ea54bf4e32b8d6258.asciidoc b/docs/examples/ed01d27b8f80bb4ea54bf4e32b8d6258.asciidoc
new file mode 100644
index 000000000..b8c81f125
--- /dev/null
+++ b/docs/examples/ed01d27b8f80bb4ea54bf4e32b8d6258.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/geodistance-aggregation.asciidoc:203
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggs={
+ "rings_around_amsterdam": {
+ "geo_distance": {
+ "field": "location",
+ "origin": "POINT (4.894 52.3760)",
+ "ranges": [
+ {
+ "to": 100000,
+ "key": "first_ring"
+ },
+ {
+ "from": 100000,
+ "to": 300000,
+ "key": "second_ring"
+ },
+ {
+ "from": 300000,
+ "key": "third_ring"
+ }
+ ],
+ "keyed": True
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ed09432c6069e41409f0a5e0d1d3842a.asciidoc b/docs/examples/ed09432c6069e41409f0a5e0d1d3842a.asciidoc
new file mode 100644
index 000000000..d056e9d33
--- /dev/null
+++ b/docs/examples/ed09432c6069e41409f0a5e0d1d3842a.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/apis/reload-analyzers.asciidoc:10
+
+[source, python]
+----
+resp = client.indices.reload_search_analyzers(
+ index="my-index-000001",
+)
+print(resp)
+
+resp1 = client.indices.clear_cache(
+ index="my-index-000001",
+ request=True,
+)
+print(resp1)
+----
diff --git a/docs/examples/ed12eeadb4e530b53c4975dadaa06054.asciidoc b/docs/examples/ed12eeadb4e530b53c4975dadaa06054.asciidoc
new file mode 100644
index 000000000..eb1a52136
--- /dev/null
+++ b/docs/examples/ed12eeadb4e530b53c4975dadaa06054.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/grok.asciidoc:281
+
+[source, python]
+----
+resp = client.ingest.processor_grok(
+ ecs_compatibility="v1",
+)
+print(resp)
+----
diff --git a/docs/examples/ed250b74bc77c15bb794f55a12d762c3.asciidoc b/docs/examples/ed250b74bc77c15bb794f55a12d762c3.asciidoc
index db9e20cce..e690f0bd4 100644
--- a/docs/examples/ed250b74bc77c15bb794f55a12d762c3.asciidoc
+++ b/docs/examples/ed250b74bc77c15bb794f55a12d762c3.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// setup/sysconfig/swap.asciidoc:77
[source, python]
@@ -6,4 +7,4 @@ resp = client.nodes.info(
filter_path="**.mlockall",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ed27843eff311f3011b679e97e6fda50.asciidoc b/docs/examples/ed27843eff311f3011b679e97e6fda50.asciidoc
new file mode 100644
index 000000000..ed9584bd8
--- /dev/null
+++ b/docs/examples/ed27843eff311f3011b679e97e6fda50.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:647
+
+[source, python]
+----
+resp = client.snapshot.restore(
+ repository="my_repository",
+ snapshot="my_snapshot_2099.05.06",
+ indices="my-index,logs-my_app-default",
+ index_settings={
+ "index.number_of_replicas": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ed3bdf4d6799b43526851e92b6a60c55.asciidoc b/docs/examples/ed3bdf4d6799b43526851e92b6a60c55.asciidoc
new file mode 100644
index 000000000..fa96997d3
--- /dev/null
+++ b/docs/examples/ed3bdf4d6799b43526851e92b6a60c55.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-field-mapping.asciidoc:129
+
+[source, python]
+----
+resp = client.indices.get_field_mapping(
+ index="publications",
+ fields="author.id,abstract,name",
+)
+print(resp)
+----
diff --git a/docs/examples/ed5bfa68d01e079aac94de78dc5caddf.asciidoc b/docs/examples/ed5bfa68d01e079aac94de78dc5caddf.asciidoc
new file mode 100644
index 000000000..85db15e13
--- /dev/null
+++ b/docs/examples/ed5bfa68d01e079aac94de78dc5caddf.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/master.asciidoc:51
+
+[source, python]
+----
+resp = client.cat.master(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/ed5c3b45e8de912faba44507d827eb93.asciidoc b/docs/examples/ed5c3b45e8de912faba44507d827eb93.asciidoc
new file mode 100644
index 000000000..a099a031c
--- /dev/null
+++ b/docs/examples/ed5c3b45e8de912faba44507d827eb93.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:499
+
+[source, python]
+----
+resp = client.search(
+ sort=[
+ {
+ "_geo_distance": {
+ "pin.location": "POINT (-70 40)",
+ "order": "asc",
+ "unit": "km"
+ }
+ }
+ ],
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ed60daeaec351fc8b3f39a3dfad6fc4e.asciidoc b/docs/examples/ed60daeaec351fc8b3f39a3dfad6fc4e.asciidoc
new file mode 100644
index 000000000..00daf5cbe
--- /dev/null
+++ b/docs/examples/ed60daeaec351fc8b3f39a3dfad6fc4e.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/inference-api/infer-api-mapping.asciidoc:242
+
+[source, python]
+----
+resp = client.indices.create(
+ index="amazon-bedrock-embeddings",
+ mappings={
+ "properties": {
+ "content_embedding": {
+ "type": "dense_vector",
+ "dims": 1024,
+ "element_type": "float",
+ "similarity": "dot_product"
+ },
+ "content": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ed688d86eeaa4d7969acb0f574eb917f.asciidoc b/docs/examples/ed688d86eeaa4d7969acb0f574eb917f.asciidoc
index b9da3bc32..8768c213f 100644
--- a/docs/examples/ed688d86eeaa4d7969acb0f574eb917f.asciidoc
+++ b/docs/examples/ed688d86eeaa4d7969acb0f574eb917f.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:495
[source, python]
@@ -5,8 +6,14 @@
resp = client.index(
index="my_queries1",
id="1",
- refresh="true",
- body={"query": {"term": {"my_field.prefix": "abc"}}},
+ refresh=True,
+ document={
+ "query": {
+ "term": {
+ "my_field.prefix": "abc"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ed6b996ea389e0955a01c2e67f4c8339.asciidoc b/docs/examples/ed6b996ea389e0955a01c2e67f4c8339.asciidoc
new file mode 100644
index 000000000..f8e15574b
--- /dev/null
+++ b/docs/examples/ed6b996ea389e0955a01c2e67f4c8339.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:101
+
+[source, python]
+----
+resp = client.field_caps(
+ index="my-index-000001",
+ fields="my-field",
+)
+print(resp)
+----
diff --git a/docs/examples/ed7fa1971ac322aeccd6391ab32d0490.asciidoc b/docs/examples/ed7fa1971ac322aeccd6391ab32d0490.asciidoc
new file mode 100644
index 000000000..f16cf2fe0
--- /dev/null
+++ b/docs/examples/ed7fa1971ac322aeccd6391ab32d0490.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/disk/increase-master-node-capacity.asciidoc:83
+
+[source, python]
+----
+resp = client.cat.nodes(
+ v=True,
+ h="name,master,node.role,disk.used_percent,disk.used,disk.avail,disk.total",
+)
+print(resp)
+----
diff --git a/docs/examples/ed85ed833bec7286a0dfbe64077c5715.asciidoc b/docs/examples/ed85ed833bec7286a0dfbe64077c5715.asciidoc
new file mode 100644
index 000000000..d56086d95
--- /dev/null
+++ b/docs/examples/ed85ed833bec7286a0dfbe64077c5715.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:530
+
+[source, python]
+----
+resp = client.indices.create(
+ index="danish_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "danish_stop": {
+ "type": "stop",
+ "stopwords": "_danish_"
+ },
+ "danish_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "eksempel"
+ ]
+ },
+ "danish_stemmer": {
+ "type": "stemmer",
+ "language": "danish"
+ }
+ },
+ "analyzer": {
+ "rebuilt_danish": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "danish_stop",
+ "danish_keywords",
+ "danish_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/edae616e1244babf6032aecc6aaaf836.asciidoc b/docs/examples/edae616e1244babf6032aecc6aaaf836.asciidoc
new file mode 100644
index 000000000..342dde9e2
--- /dev/null
+++ b/docs/examples/edae616e1244babf6032aecc6aaaf836.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:472
+
+[source, python]
+----
+resp = client.search(
+ sort=[
+ {
+ "_geo_distance": {
+ "pin.location": {
+ "lat": 40,
+ "lon": -70
+ },
+ "order": "asc",
+ "unit": "km"
+ }
+ }
+ ],
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/edb25dc0162b039d477cb06aed2d6275.asciidoc b/docs/examples/edb25dc0162b039d477cb06aed2d6275.asciidoc
new file mode 100644
index 000000000..fa681946d
--- /dev/null
+++ b/docs/examples/edb25dc0162b039d477cb06aed2d6275.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/sparse-vector-query.asciidoc:147
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "bool": {
+ "should": [
+ {
+ "sparse_vector": {
+ "field": "ml.inference.title_expanded.predicted_value",
+ "inference_id": "my-elser-model",
+ "query": "How is the weather in Jamaica?",
+ "boost": 1
+ }
+ },
+ {
+ "sparse_vector": {
+ "field": "ml.inference.description_expanded.predicted_value",
+ "inference_id": "my-elser-model",
+ "query": "How is the weather in Jamaica?",
+ "boost": 1
+ }
+ },
+ {
+ "multi_match": {
+ "query": "How is the weather in Jamaica?",
+ "fields": [
+ "title",
+ "description"
+ ],
+ "boost": 4
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/edb5cad890208014ecd91f3f739ce193.asciidoc b/docs/examples/edb5cad890208014ecd91f3f739ce193.asciidoc
new file mode 100644
index 000000000..c5a960cc1
--- /dev/null
+++ b/docs/examples/edb5cad890208014ecd91f3f739ce193.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/set-up-tsds.asciidoc:276
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="metrics-weather_sensors-dev",
+)
+print(resp)
+----
diff --git a/docs/examples/edcfadbfb14d97a2f5e6e21ef7039818.asciidoc b/docs/examples/edcfadbfb14d97a2f5e6e21ef7039818.asciidoc
index ceb01cb32..907b6c261 100644
--- a/docs/examples/edcfadbfb14d97a2f5e6e21ef7039818.asciidoc
+++ b/docs/examples/edcfadbfb14d97a2f5e6e21ef7039818.asciidoc
@@ -1,28 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/function-score-query.asciidoc:41
[source, python]
----
resp = client.search(
- body={
- "query": {
- "function_score": {
- "query": {"match_all": {}},
- "boost": "5",
- "functions": [
- {
- "filter": {"match": {"test": "bar"}},
- "random_score": {},
- "weight": 23,
+ query={
+ "function_score": {
+ "query": {
+ "match_all": {}
+ },
+ "boost": "5",
+ "functions": [
+ {
+ "filter": {
+ "match": {
+ "test": "bar"
+ }
},
- {"filter": {"match": {"test": "cat"}}, "weight": 42},
- ],
- "max_boost": 42,
- "score_mode": "max",
- "boost_mode": "multiply",
- "min_score": 42,
- }
+ "random_score": {},
+ "weight": 23
+ },
+ {
+ "filter": {
+ "match": {
+ "test": "cat"
+ }
+ },
+ "weight": 42
+ }
+ ],
+ "max_boost": 42,
+ "score_mode": "max",
+ "boost_mode": "multiply",
+ "min_score": 42
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ee08328cd157d547de19b4abe867b23e.asciidoc b/docs/examples/ee08328cd157d547de19b4abe867b23e.asciidoc
new file mode 100644
index 000000000..b149f81c4
--- /dev/null
+++ b/docs/examples/ee08328cd157d547de19b4abe867b23e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// alias.asciidoc:275
+
+[source, python]
+----
+resp = client.indices.get_alias(
+ name="logs",
+)
+print(resp)
+----
diff --git a/docs/examples/ee0fd67acc807f1bddf5e9807c06e7eb.asciidoc b/docs/examples/ee0fd67acc807f1bddf5e9807c06e7eb.asciidoc
new file mode 100644
index 000000000..aff5c231f
--- /dev/null
+++ b/docs/examples/ee0fd67acc807f1bddf5e9807c06e7eb.asciidoc
@@ -0,0 +1,95 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/weighted-tokens-query.asciidoc:86
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ query={
+ "weighted_tokens": {
+ "query_expansion_field": {
+ "tokens": {
+ "2161": 0.4679,
+ "2621": 0.307,
+ "2782": 0.1299,
+ "2851": 0.1056,
+ "3088": 0.3041,
+ "3376": 0.1038,
+ "3467": 0.4873,
+ "3684": 0.8958,
+ "4380": 0.334,
+ "4542": 0.4636,
+ "4633": 2.2805,
+ "4785": 1.2628,
+ "4860": 1.0655,
+ "5133": 1.0709,
+ "7139": 1.0016,
+ "7224": 0.2486,
+ "7387": 0.0985,
+ "7394": 0.0542,
+ "8915": 0.369,
+ "9156": 2.8947,
+ "10505": 0.2771,
+ "11464": 0.3996,
+ "13525": 0.0088,
+ "14178": 0.8161,
+ "16893": 0.1376,
+ "17851": 1.5348,
+ "19939": 0.6012
+ },
+ "pruning_config": {
+ "tokens_freq_ratio_threshold": 5,
+ "tokens_weight_threshold": 0.4,
+ "only_score_pruned_tokens": False
+ }
+ }
+ }
+ },
+ rescore={
+ "window_size": 100,
+ "query": {
+ "rescore_query": {
+ "weighted_tokens": {
+ "query_expansion_field": {
+ "tokens": {
+ "2161": 0.4679,
+ "2621": 0.307,
+ "2782": 0.1299,
+ "2851": 0.1056,
+ "3088": 0.3041,
+ "3376": 0.1038,
+ "3467": 0.4873,
+ "3684": 0.8958,
+ "4380": 0.334,
+ "4542": 0.4636,
+ "4633": 2.2805,
+ "4785": 1.2628,
+ "4860": 1.0655,
+ "5133": 1.0709,
+ "7139": 1.0016,
+ "7224": 0.2486,
+ "7387": 0.0985,
+ "7394": 0.0542,
+ "8915": 0.369,
+ "9156": 2.8947,
+ "10505": 0.2771,
+ "11464": 0.3996,
+ "13525": 0.0088,
+ "14178": 0.8161,
+ "16893": 0.1376,
+ "17851": 1.5348,
+ "19939": 0.6012
+ },
+ "pruning_config": {
+ "tokens_freq_ratio_threshold": 5,
+ "tokens_weight_threshold": 0.4,
+ "only_score_pruned_tokens": True
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ee223e604bb695cad2517d28ae63ac34.asciidoc b/docs/examples/ee223e604bb695cad2517d28ae63ac34.asciidoc
new file mode 100644
index 000000000..18240246e
--- /dev/null
+++ b/docs/examples/ee223e604bb695cad2517d28ae63ac34.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// search/rrf.asciidoc:51
+
+[source, python]
+----
+resp = client.search(
+ index="example-index",
+ retriever={
+ "rrf": {
+ "retrievers": [
+ {
+ "standard": {
+ "query": {
+ "term": {
+ "text": "shoes"
+ }
+ }
+ }
+ },
+ {
+ "knn": {
+ "field": "vector",
+ "query_vector": [
+ 1.25,
+ 2,
+ 3.5
+ ],
+ "k": 50,
+ "num_candidates": 100
+ }
+ }
+ ],
+ "rank_window_size": 50,
+ "rank_constant": 20
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ee2d97090d617ed8aa2a87ea33556dd7.asciidoc b/docs/examples/ee2d97090d617ed8aa2a87ea33556dd7.asciidoc
new file mode 100644
index 000000000..37de9ec93
--- /dev/null
+++ b/docs/examples/ee2d97090d617ed8aa2a87ea33556dd7.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/truncate-tokenfilter.asciidoc:24
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="whitespace",
+ filter=[
+ "truncate"
+ ],
+ text="the quinquennial extravaganza carried on",
+)
+print(resp)
+----
diff --git a/docs/examples/ee577c4c7cc723e99569ea2d1137adba.asciidoc b/docs/examples/ee577c4c7cc723e99569ea2d1137adba.asciidoc
new file mode 100644
index 000000000..51d611002
--- /dev/null
+++ b/docs/examples/ee577c4c7cc723e99569ea2d1137adba.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-roles-cache.asciidoc:42
+
+[source, python]
+----
+resp = client.security.clear_cached_roles(
+ name="my_admin_role",
+)
+print(resp)
+----
diff --git a/docs/examples/ee634d59def6302134d24fa90e18b609.asciidoc b/docs/examples/ee634d59def6302134d24fa90e18b609.asciidoc
new file mode 100644
index 000000000..424726c8e
--- /dev/null
+++ b/docs/examples/ee634d59def6302134d24fa90e18b609.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/deciders/machine-learning-decider.asciidoc:48
+
+[source, python]
+----
+resp = client.autoscaling.put_autoscaling_policy(
+ name="my_autoscaling_policy",
+ policy={
+ "roles": [
+ "ml"
+ ],
+ "deciders": {
+ "ml": {
+ "num_anomaly_jobs_in_queue": 5,
+ "num_analytics_jobs_in_queue": 3,
+ "down_scale_delay": "30m"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ee90d1fb22b59d30da339d825303b912.asciidoc b/docs/examples/ee90d1fb22b59d30da339d825303b912.asciidoc
new file mode 100644
index 000000000..52d677d20
--- /dev/null
+++ b/docs/examples/ee90d1fb22b59d30da339d825303b912.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/put-app-privileges.asciidoc:130
+
+[source, python]
+----
+resp = client.security.put_privileges(
+ privileges={
+ "app01": {
+ "read": {
+ "actions": [
+ "action:login",
+ "data:read/*"
+ ]
+ },
+ "write": {
+ "actions": [
+ "action:login",
+ "data:write/*"
+ ]
+ }
+ },
+ "app02": {
+ "all": {
+ "actions": [
+ "*"
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eeb35b759bd239bb773c8ebd5fe63d05.asciidoc b/docs/examples/eeb35b759bd239bb773c8ebd5fe63d05.asciidoc
new file mode 100644
index 000000000..9ac55a2d3
--- /dev/null
+++ b/docs/examples/eeb35b759bd239bb773c8ebd5fe63d05.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/geocentroid-aggregation.asciidoc:79
+
+[source, python]
+----
+resp = client.search(
+ index="museums",
+ size="0",
+ aggs={
+ "cities": {
+ "terms": {
+ "field": "city.keyword"
+ },
+ "aggs": {
+ "centroid": {
+ "geo_centroid": {
+ "field": "location"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eec051555c8050d017d3fe38ea59e3a0.asciidoc b/docs/examples/eec051555c8050d017d3fe38ea59e3a0.asciidoc
index 12c64a679..cab93affd 100644
--- a/docs/examples/eec051555c8050d017d3fe38ea59e3a0.asciidoc
+++ b/docs/examples/eec051555c8050d017d3fe38ea59e3a0.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// search/search.asciidoc:907
[source, python]
@@ -6,7 +7,11 @@ resp = client.search(
index="my-index-000001",
from_="40",
size="20",
- body={"query": {"term": {"user.id": "kimchy"}}},
+ query={
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/eed37703cfe8fec093ed5a42210a6ffd.asciidoc b/docs/examples/eed37703cfe8fec093ed5a42210a6ffd.asciidoc
new file mode 100644
index 000000000..c1d78b141
--- /dev/null
+++ b/docs/examples/eed37703cfe8fec093ed5a42210a6ffd.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/rollup-getting-started.asciidoc:38
+
+[source, python]
+----
+resp = client.rollup.put_job(
+ id="sensor",
+ index_pattern="sensor-*",
+ rollup_index="sensor_rollup",
+ cron="*/30 * * * * ?",
+ page_size=1000,
+ groups={
+ "date_histogram": {
+ "field": "timestamp",
+ "fixed_interval": "60m"
+ },
+ "terms": {
+ "fields": [
+ "node"
+ ]
+ }
+ },
+ metrics=[
+ {
+ "field": "temperature",
+ "metrics": [
+ "min",
+ "max",
+ "sum"
+ ]
+ },
+ {
+ "field": "voltage",
+ "metrics": [
+ "avg"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc b/docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc
new file mode 100644
index 000000000..a342f7ada
--- /dev/null
+++ b/docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-hugging-face.asciidoc:81
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="text_embedding",
+ inference_id="hugging-face-embeddings",
+ inference_config={
+ "service": "hugging_face",
+ "service_settings": {
+ "api_key": "",
+ "url": ""
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/eef9deff7f9799d1f7657bb7e2afb7f1.asciidoc b/docs/examples/eef9deff7f9799d1f7657bb7e2afb7f1.asciidoc
new file mode 100644
index 000000000..999a5502e
--- /dev/null
+++ b/docs/examples/eef9deff7f9799d1f7657bb7e2afb7f1.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/restore-snapshot.asciidoc:429
+
+[source, python]
+----
+resp = client.indices.delete(
+ index="*",
+ expand_wildcards="all",
+)
+print(resp)
+----
diff --git a/docs/examples/ef10e8d07d9fae945e035d5dee1e9754.asciidoc b/docs/examples/ef10e8d07d9fae945e035d5dee1e9754.asciidoc
new file mode 100644
index 000000000..fd86870f5
--- /dev/null
+++ b/docs/examples/ef10e8d07d9fae945e035d5dee1e9754.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/flatten-graph-tokenfilter.asciidoc:118
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ {
+ "type": "synonym_graph",
+ "synonyms": [
+ "dns, domain name system"
+ ]
+ },
+ "flatten_graph"
+ ],
+ text="domain name system is fragile",
+)
+print(resp)
+----
diff --git a/docs/examples/ef22234b97cc06d7dd620b4ce7c97b31.asciidoc b/docs/examples/ef22234b97cc06d7dd620b4ce7c97b31.asciidoc
index f15b999cc..7235ecc06 100644
--- a/docs/examples/ef22234b97cc06d7dd620b4ce7c97b31.asciidoc
+++ b/docs/examples/ef22234b97cc06d7dd620b4ce7c97b31.asciidoc
@@ -1,13 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:694
[source, python]
----
resp = client.reindex(
- body={
- "max_docs": 1,
- "source": {"index": "my-index-000001"},
- "dest": {"index": "my-new-index-000001"},
+ max_docs=1,
+ source={
+ "index": "my-index-000001"
+ },
+ dest={
+ "index": "my-new-index-000001"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ef33b3b373f7040b874146599db5d557.asciidoc b/docs/examples/ef33b3b373f7040b874146599db5d557.asciidoc
new file mode 100644
index 000000000..97a18cef8
--- /dev/null
+++ b/docs/examples/ef33b3b373f7040b874146599db5d557.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:173
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="keyword",
+ filter=[
+ "lowercase"
+ ],
+ text="this is a test",
+)
+print(resp)
+----
diff --git a/docs/examples/ef3666b5d288faefbcbc4a25e8f506da.asciidoc b/docs/examples/ef3666b5d288faefbcbc4a25e8f506da.asciidoc
new file mode 100644
index 000000000..dcb68cab8
--- /dev/null
+++ b/docs/examples/ef3666b5d288faefbcbc4a25e8f506da.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/troubleshooting-searches.asciidoc:84
+
+[source, python]
+----
+resp = client.count(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/ef779b87b3b0fb6e6bae9c8875e3a1cf.asciidoc b/docs/examples/ef779b87b3b0fb6e6bae9c8875e3a1cf.asciidoc
index ea871d67d..6b83548e3 100644
--- a/docs/examples/ef779b87b3b0fb6e6bae9c8875e3a1cf.asciidoc
+++ b/docs/examples/ef779b87b3b0fb6e6bae9c8875e3a1cf.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:699
[source, python]
@@ -5,22 +6,20 @@
resp = client.search(
index="sales",
size="0",
- body={
- "runtime_mappings": {
- "date.promoted_is_tomorrow": {
- "type": "date",
- "script": "\n long date = doc['date'].value.toInstant().toEpochMilli();\n if (doc['promoted'].value) {\n date += 86400;\n }\n emit(date);\n ",
- }
- },
- "aggs": {
- "sales_over_time": {
- "date_histogram": {
- "field": "date.promoted_is_tomorrow",
- "calendar_interval": "1M",
- }
+ runtime_mappings={
+ "date.promoted_is_tomorrow": {
+ "type": "date",
+ "script": "\n long date = doc['date'].value.toInstant().toEpochMilli();\n if (doc['promoted'].value) {\n date += 86400;\n }\n emit(date);\n "
+ }
+ },
+ aggs={
+ "sales_over_time": {
+ "date_histogram": {
+ "field": "date.promoted_is_tomorrow",
+ "calendar_interval": "1M"
}
- },
+ }
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ef867e563cbffe7866769a096b5d7a92.asciidoc b/docs/examples/ef867e563cbffe7866769a096b5d7a92.asciidoc
new file mode 100644
index 000000000..e093b9095
--- /dev/null
+++ b/docs/examples/ef867e563cbffe7866769a096b5d7a92.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/cumulative-sum-aggregation.asciidoc:40
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size=0,
+ aggs={
+ "sales_per_month": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "month"
+ },
+ "aggs": {
+ "sales": {
+ "sum": {
+ "field": "price"
+ }
+ },
+ "cumulative_sales": {
+ "cumulative_sum": {
+ "buckets_path": "sales"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ef8f30e85e12e9a5a8817d28977598e4.asciidoc b/docs/examples/ef8f30e85e12e9a5a8817d28977598e4.asciidoc
new file mode 100644
index 000000000..0ad324105
--- /dev/null
+++ b/docs/examples/ef8f30e85e12e9a5a8817d28977598e4.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/range-aggregation.asciidoc:13
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ aggs={
+ "price_ranges": {
+ "range": {
+ "field": "price",
+ "ranges": [
+ {
+ "to": 100
+ },
+ {
+ "from": 100,
+ "to": 200
+ },
+ {
+ "from": 200
+ }
+ ]
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ef9c29759459904fef162acd223462c4.asciidoc b/docs/examples/ef9c29759459904fef162acd223462c4.asciidoc
new file mode 100644
index 000000000..d205709ff
--- /dev/null
+++ b/docs/examples/ef9c29759459904fef162acd223462c4.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/nodes-stats.asciidoc:2441
+
+[source, python]
+----
+resp = client.nodes.stats(
+ metric="ingest",
+ filter_path="nodes.*.ingest",
+)
+print(resp)
+----
diff --git a/docs/examples/efa146bf81a9351ba42b92a6decbcfee.asciidoc b/docs/examples/efa146bf81a9351ba42b92a6decbcfee.asciidoc
new file mode 100644
index 000000000..a60c26c54
--- /dev/null
+++ b/docs/examples/efa146bf81a9351ba42b92a6decbcfee.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/common-script-uses.asciidoc:173
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my-index",
+ runtime={
+ "http.response": {
+ "type": "long",
+ "script": "\n String response=dissect('%{clientip} %{ident} %{auth} [%{@timestamp}] \"%{verb} %{request} HTTP/%{httpversion}\" %{response} %{size}').extract(doc[\"message\"].value)?.response;\n if (response != null) emit(Integer.parseInt(response));\n "
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/efa924638043f3a6b23ccb824d757eba.asciidoc b/docs/examples/efa924638043f3a6b23ccb824d757eba.asciidoc
new file mode 100644
index 000000000..5c967681c
--- /dev/null
+++ b/docs/examples/efa924638043f3a6b23ccb824d757eba.asciidoc
@@ -0,0 +1,35 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/multivalued-fields.asciidoc:11
+
+[source, python]
+----
+resp = client.bulk(
+ index="mv",
+ refresh=True,
+ operations=[
+ {
+ "index": {}
+ },
+ {
+ "a": 1,
+ "b": [
+ 2,
+ 1
+ ]
+ },
+ {
+ "index": {}
+ },
+ {
+ "a": 2,
+ "b": 3
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.esql.query(
+ query="FROM mv | LIMIT 2",
+)
+print(resp1)
+----
diff --git a/docs/examples/eff2fc92d46eb3c8f4d424eed18f54a2.asciidoc b/docs/examples/eff2fc92d46eb3c8f4d424eed18f54a2.asciidoc
index 6194e50b6..edf2e4ce0 100644
--- a/docs/examples/eff2fc92d46eb3c8f4d424eed18f54a2.asciidoc
+++ b/docs/examples/eff2fc92d46eb3c8f4d424eed18f54a2.asciidoc
@@ -1,18 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/function-score-query.asciidoc:19
[source, python]
----
resp = client.search(
- body={
- "query": {
- "function_score": {
- "query": {"match_all": {}},
- "boost": "5",
- "random_score": {},
- "boost_mode": "multiply",
- }
+ query={
+ "function_score": {
+ "query": {
+ "match_all": {}
+ },
+ "boost": "5",
+ "random_score": {},
+ "boost_mode": "multiply"
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/eff8ecaed1ed084909c64450fc363a20.asciidoc b/docs/examples/eff8ecaed1ed084909c64450fc363a20.asciidoc
index b4c4142ca..b87269ad4 100644
--- a/docs/examples/eff8ecaed1ed084909c64450fc363a20.asciidoc
+++ b/docs/examples/eff8ecaed1ed084909c64450fc363a20.asciidoc
@@ -1,9 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// cluster/update-settings.asciidoc:96
[source, python]
----
resp = client.cluster.put_settings(
- body={"transient": {"indices.recovery.max_bytes_per_sec": None}},
+ transient={
+ "indices.recovery.max_bytes_per_sec": None
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f04e1284d09ceb4443d67b2ef9c7f476.asciidoc b/docs/examples/f04e1284d09ceb4443d67b2ef9c7f476.asciidoc
new file mode 100644
index 000000000..7b8b3092d
--- /dev/null
+++ b/docs/examples/f04e1284d09ceb4443d67b2ef9c7f476.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/delete-snapshot-api.asciidoc:30
+
+[source, python]
+----
+resp = client.snapshot.delete(
+ repository="my_repository",
+ snapshot="my_snapshot",
+)
+print(resp)
+----
diff --git a/docs/examples/f0816beb8ac21cb0940858b72f6b1946.asciidoc b/docs/examples/f0816beb8ac21cb0940858b72f6b1946.asciidoc
new file mode 100644
index 000000000..903a04c6c
--- /dev/null
+++ b/docs/examples/f0816beb8ac21cb0940858b72f6b1946.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/fielddata.asciidoc:126
+
+[source, python]
+----
+resp = client.cat.fielddata(
+ fields="body,soul",
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/f097c02541056f3c0fc855e7bbeef8a8.asciidoc b/docs/examples/f097c02541056f3c0fc855e7bbeef8a8.asciidoc
new file mode 100644
index 000000000..373fbf824
--- /dev/null
+++ b/docs/examples/f097c02541056f3c0fc855e7bbeef8a8.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:1745
+
+[source, python]
+----
+resp = client.indices.create(
+ index="swedish_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "swedish_stop": {
+ "type": "stop",
+ "stopwords": "_swedish_"
+ },
+ "swedish_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "exempel"
+ ]
+ },
+ "swedish_stemmer": {
+ "type": "stemmer",
+ "language": "swedish"
+ }
+ },
+ "analyzer": {
+ "rebuilt_swedish": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "swedish_stop",
+ "swedish_keywords",
+ "swedish_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f09817fd13ff3dce52eb79d0722409c3.asciidoc b/docs/examples/f09817fd13ff3dce52eb79d0722409c3.asciidoc
index 352f0078b..d91f4381f 100644
--- a/docs/examples/f09817fd13ff3dce52eb79d0722409c3.asciidoc
+++ b/docs/examples/f09817fd13ff3dce52eb79d0722409c3.asciidoc
@@ -1,33 +1,49 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/percolator.asciidoc:115
[source, python]
----
resp = client.indices.create(
index="new_index",
- body={
- "mappings": {
- "properties": {
- "query": {"type": "percolator"},
- "body": {"type": "text"},
+ mappings={
+ "properties": {
+ "query": {
+ "type": "percolator"
+ },
+ "body": {
+ "type": "text"
}
}
},
)
print(resp)
-resp = client.reindex(
- refresh="true",
- body={"source": {"index": "index"}, "dest": {"index": "new_index"}},
+resp1 = client.reindex(
+ refresh=True,
+ source={
+ "index": "index"
+ },
+ dest={
+ "index": "new_index"
+ },
)
-print(resp)
+print(resp1)
-resp = client.indices.update_aliases(
- body={
- "actions": [
- {"remove": {"index": "index", "alias": "queries"}},
- {"add": {"index": "new_index", "alias": "queries"}},
- ]
- },
+resp2 = client.indices.update_aliases(
+ actions=[
+ {
+ "remove": {
+ "index": "index",
+ "alias": "queries"
+ }
+ },
+ {
+ "add": {
+ "index": "new_index",
+ "alias": "queries"
+ }
+ }
+ ],
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/f0bfc8d7ab4eb94ea5fdf2e087d8cf5b.asciidoc b/docs/examples/f0bfc8d7ab4eb94ea5fdf2e087d8cf5b.asciidoc
new file mode 100644
index 000000000..c70f80a96
--- /dev/null
+++ b/docs/examples/f0bfc8d7ab4eb94ea5fdf2e087d8cf5b.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/boxplot-aggregation.asciidoc:83
+
+[source, python]
+----
+resp = client.search(
+ index="latency",
+ size=0,
+ runtime_mappings={
+ "load_time.seconds": {
+ "type": "long",
+ "script": {
+ "source": "emit(doc['load_time'].value / params.timeUnit)",
+ "params": {
+ "timeUnit": 1000
+ }
+ }
+ }
+ },
+ aggs={
+ "load_time_boxplot": {
+ "boxplot": {
+ "field": "load_time.seconds"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f0c3235d8fce641d6ff8ce90ab7b7b8b.asciidoc b/docs/examples/f0c3235d8fce641d6ff8ce90ab7b7b8b.asciidoc
new file mode 100644
index 000000000..752590041
--- /dev/null
+++ b/docs/examples/f0c3235d8fce641d6ff8ce90ab7b7b8b.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/multi-termvectors.asciidoc:120
+
+[source, python]
+----
+resp = client.mtermvectors(
+ index="my-index-000001",
+ ids=[
+ "1",
+ "2"
+ ],
+ parameters={
+ "fields": [
+ "message"
+ ],
+ "term_statistics": True
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f10ab582387b2c157917a60205c993f7.asciidoc b/docs/examples/f10ab582387b2c157917a60205c993f7.asciidoc
new file mode 100644
index 000000000..2b9489a61
--- /dev/null
+++ b/docs/examples/f10ab582387b2c157917a60205c993f7.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/meta.asciidoc:9
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "latency": {
+ "type": "long",
+ "meta": {
+ "unit": "ms"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f128a9dff5051b47efe2c53c4454a68f.asciidoc b/docs/examples/f128a9dff5051b47efe2c53c4454a68f.asciidoc
new file mode 100644
index 000000000..9a2bc95e0
--- /dev/null
+++ b/docs/examples/f128a9dff5051b47efe2c53c4454a68f.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/rollover-index.asciidoc:255
+
+[source, python]
+----
+resp = client.indices.rollover(
+ alias="my-data-stream",
+ conditions={
+ "max_age": "7d",
+ "max_docs": 1000,
+ "max_primary_shard_size": "50gb",
+ "max_primary_shard_docs": "2000"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f14d0e4a280fee540e8e5f0fc4d0e9f1.asciidoc b/docs/examples/f14d0e4a280fee540e8e5f0fc4d0e9f1.asciidoc
new file mode 100644
index 000000000..1f492dd28
--- /dev/null
+++ b/docs/examples/f14d0e4a280fee540e8e5f0fc4d0e9f1.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-grid-query.asciidoc:174
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ size=0,
+ aggs={
+ "grouped": {
+ "geotile_grid": {
+ "field": "location",
+ "precision": 6
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f1508a2221152842894819e762e63491.asciidoc b/docs/examples/f1508a2221152842894819e762e63491.asciidoc
new file mode 100644
index 000000000..4162ec024
--- /dev/null
+++ b/docs/examples/f1508a2221152842894819e762e63491.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:696
+
+[source, python]
+----
+resp = client.sql.query(
+ format="json",
+ keep_on_completion=True,
+ wait_for_completion_timeout="2s",
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=5,
+)
+print(resp)
+----
diff --git a/docs/examples/f160561efab38e40c2feebf5a2542ab5.asciidoc b/docs/examples/f160561efab38e40c2feebf5a2542ab5.asciidoc
new file mode 100644
index 000000000..e205a5802
--- /dev/null
+++ b/docs/examples/f160561efab38e40c2feebf5a2542ab5.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/nodes-stats.asciidoc:2449
+
+[source, python]
+----
+resp = client.nodes.stats(
+ metric="ingest",
+ filter_path="nodes.*.ingest.pipelines",
+)
+print(resp)
+----
diff --git a/docs/examples/f18248c181690b81d090275b072f0070.asciidoc b/docs/examples/f18248c181690b81d090275b072f0070.asciidoc
new file mode 100644
index 000000000..314ee5bdc
--- /dev/null
+++ b/docs/examples/f18248c181690b81d090275b072f0070.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1351
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ keep_alive="2d",
+ wait_for_completion_timeout="2s",
+ query="\n process where process.name == \"cmd.exe\"\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/f187ac2dc35425cb0ef48f328cc7e435.asciidoc b/docs/examples/f187ac2dc35425cb0ef48f328cc7e435.asciidoc
new file mode 100644
index 000000000..3bdd2d751
--- /dev/null
+++ b/docs/examples/f187ac2dc35425cb0ef48f328cc7e435.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/remote-clusters-privileges-cert.asciidoc:195
+
+[source, python]
+----
+resp = client.security.put_user(
+ username="cross-search-user",
+ password="l0ng-r4nd0m-p@ssw0rd",
+ roles=[
+ "remote-search"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc b/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc
index 476ec000d..2464c2786 100644
--- a/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc
+++ b/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// inference/post-inference.asciidoc:137
[source, python]
@@ -5,10 +6,16 @@
resp = client.inference.inference(
task_type="rerank",
inference_id="cohere_rerank",
- body={
- "input": ["luke", "like", "leia", "chewy", "r2d2", "star", "wars"],
- "query": "star wars main character",
- },
+ input=[
+ "luke",
+ "like",
+ "leia",
+ "chewy",
+ "r2d2",
+ "star",
+ "wars"
+ ],
+ query="star wars main character",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f1bf3edbd9e6c7e01b00c74c99a58b61.asciidoc b/docs/examples/f1bf3edbd9e6c7e01b00c74c99a58b61.asciidoc
new file mode 100644
index 000000000..3ad7e4e83
--- /dev/null
+++ b/docs/examples/f1bf3edbd9e6c7e01b00c74c99a58b61.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1454
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster": {
+ "remote": {
+ "cluster_one": {
+ "seeds": [
+ "127.0.0.1:9300"
+ ]
+ },
+ "cluster_two": {
+ "seeds": [
+ "127.0.0.1:9301"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f1d2b8169160adfd27f32988113f0f9f.asciidoc b/docs/examples/f1d2b8169160adfd27f32988113f0f9f.asciidoc
new file mode 100644
index 000000000..f6653e8fa
--- /dev/null
+++ b/docs/examples/f1d2b8169160adfd27f32988113f0f9f.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/word-delimiter-tokenfilter.asciidoc:148
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_analyzer": {
+ "tokenizer": "keyword",
+ "filter": [
+ "word_delimiter"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f1dc6f69453867ffafe86e998dd464d9.asciidoc b/docs/examples/f1dc6f69453867ffafe86e998dd464d9.asciidoc
new file mode 100644
index 000000000..5b42de18f
--- /dev/null
+++ b/docs/examples/f1dc6f69453867ffafe86e998dd464d9.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/pathhierarchy-tokenizer.asciidoc:309
+
+[source, python]
+----
+resp = client.search(
+ index="file-path-test",
+ query={
+ "term": {
+ "file_path.tree_reversed": {
+ "value": "my_photo1.jpg"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f1e2af6dbb30fc5335e7d0b5507a2a93.asciidoc b/docs/examples/f1e2af6dbb30fc5335e7d0b5507a2a93.asciidoc
new file mode 100644
index 000000000..075670f1c
--- /dev/null
+++ b/docs/examples/f1e2af6dbb30fc5335e7d0b5507a2a93.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/reset-job.asciidoc:56
+
+[source, python]
+----
+resp = client.ml.reset_job(
+ job_id="total-requests",
+)
+print(resp)
+----
diff --git a/docs/examples/f2175feadc2abe545899889e6d4ffcad.asciidoc b/docs/examples/f2175feadc2abe545899889e6d4ffcad.asciidoc
new file mode 100644
index 000000000..bcfa55c34
--- /dev/null
+++ b/docs/examples/f2175feadc2abe545899889e6d4ffcad.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// slm/apis/slm-get.asciidoc:71
+
+[source, python]
+----
+resp = client.slm.get_lifecycle(
+ policy_id="daily-snapshots",
+ human=True,
+)
+print(resp)
+----
diff --git a/docs/examples/f235544a883fd04bed2dc369b0c450f3.asciidoc b/docs/examples/f235544a883fd04bed2dc369b0c450f3.asciidoc
new file mode 100644
index 000000000..826f46c86
--- /dev/null
+++ b/docs/examples/f235544a883fd04bed2dc369b0c450f3.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:409
+
+[source, python]
+----
+resp = client.sql.query(
+ format="txt",
+ query="SELECT * FROM library",
+ filter={
+ "terms": {
+ "_routing": [
+ "abc"
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f2359acfb6eaa919125463cc1d3a7cd1.asciidoc b/docs/examples/f2359acfb6eaa919125463cc1d3a7cd1.asciidoc
new file mode 100644
index 000000000..8b4e55f04
--- /dev/null
+++ b/docs/examples/f2359acfb6eaa919125463cc1d3a7cd1.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authorization/mapping-roles.asciidoc:138
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="admins",
+ roles=[
+ "monitoring",
+ "user"
+ ],
+ rules={
+ "field": {
+ "groups": "cn=admins,dc=example,dc=com"
+ }
+ },
+ enabled=True,
+)
+print(resp)
+----
diff --git a/docs/examples/f268416813befd13c604642c6fe6eda9.asciidoc b/docs/examples/f268416813befd13c604642c6fe6eda9.asciidoc
new file mode 100644
index 000000000..13348d6e2
--- /dev/null
+++ b/docs/examples/f268416813befd13c604642c6fe6eda9.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/lowercase-tokenfilter.asciidoc:131
+
+[source, python]
+----
+resp = client.indices.create(
+ index="custom_lowercase_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "greek_lowercase_example": {
+ "type": "custom",
+ "tokenizer": "standard",
+ "filter": [
+ "greek_lowercase"
+ ]
+ }
+ },
+ "filter": {
+ "greek_lowercase": {
+ "type": "lowercase",
+ "language": "greek"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f27c28ddbf4c266b5f42d14da837b8de.asciidoc b/docs/examples/f27c28ddbf4c266b5f42d14da837b8de.asciidoc
index 1bbd6f4e4..cf0fa265f 100644
--- a/docs/examples/f27c28ddbf4c266b5f42d14da837b8de.asciidoc
+++ b/docs/examples/f27c28ddbf4c266b5f42d14da837b8de.asciidoc
@@ -1,7 +1,8 @@
-// setup/restart-cluster.asciidoc:189
+// This file is autogenerated, DO NOT EDIT
+// indices/flush.asciidoc:141
[source, python]
----
resp = client.indices.flush()
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f281ff50b2cdb67ac0ece93f1594fa95.asciidoc b/docs/examples/f281ff50b2cdb67ac0ece93f1594fa95.asciidoc
new file mode 100644
index 000000000..c8ee85ee2
--- /dev/null
+++ b/docs/examples/f281ff50b2cdb67ac0ece93f1594fa95.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-shape-query.asciidoc:111
+
+[source, python]
+----
+resp = client.search(
+ index="example_points",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_shape": {
+ "location": {
+ "shape": {
+ "type": "envelope",
+ "coordinates": [
+ [
+ 13,
+ 53
+ ],
+ [
+ 14,
+ 52
+ ]
+ ]
+ },
+ "relation": "intersects"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f298c4eb50ea97b34c57f8756eb350d3.asciidoc b/docs/examples/f298c4eb50ea97b34c57f8756eb350d3.asciidoc
new file mode 100644
index 000000000..1fbfb3e2a
--- /dev/null
+++ b/docs/examples/f298c4eb50ea97b34c57f8756eb350d3.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cat/pending_tasks.asciidoc:52
+
+[source, python]
+----
+resp = client.cat.pending_tasks(
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/f29a28fffa7ec604a33a838f48f7ea79.asciidoc b/docs/examples/f29a28fffa7ec604a33a838f48f7ea79.asciidoc
index 1cee07f06..db0efa4a5 100644
--- a/docs/examples/f29a28fffa7ec604a33a838f48f7ea79.asciidoc
+++ b/docs/examples/f29a28fffa7ec604a33a838f48f7ea79.asciidoc
@@ -1,22 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query_filter_context.asciidoc:62
[source, python]
----
resp = client.search(
- body={
- "query": {
- "bool": {
- "must": [
- {"match": {"title": "Search"}},
- {"match": {"content": "Elasticsearch"}},
- ],
- "filter": [
- {"term": {"status": "published"}},
- {"range": {"publish_date": {"gte": "2015-01-01"}}},
- ],
- }
+ query={
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "title": "Search"
+ }
+ },
+ {
+ "match": {
+ "content": "Elasticsearch"
+ }
+ }
+ ],
+ "filter": [
+ {
+ "term": {
+ "status": "published"
+ }
+ },
+ {
+ "range": {
+ "publish_date": {
+ "gte": "2015-01-01"
+ }
+ }
+ }
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f29b2674299ddf51a25ed87619025ede.asciidoc b/docs/examples/f29b2674299ddf51a25ed87619025ede.asciidoc
new file mode 100644
index 000000000..1c6f7e551
--- /dev/null
+++ b/docs/examples/f29b2674299ddf51a25ed87619025ede.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/rollup-search.asciidoc:115
+
+[source, python]
+----
+resp = client.rollup.rollup_search(
+ index="sensor_rollup",
+ size=0,
+ aggregations={
+ "max_temperature": {
+ "max": {
+ "field": "temperature"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc b/docs/examples/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc
new file mode 100644
index 000000000..5f93f7a79
--- /dev/null
+++ b/docs/examples/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/get-connector-api.asciidoc:64
+
+[source, python]
+----
+resp = client.connector.get(
+ connector_id="my-connector",
+)
+print(resp)
+----
diff --git a/docs/examples/f2b2d62bc0a44940ad14fca57d6d008a.asciidoc b/docs/examples/f2b2d62bc0a44940ad14fca57d6d008a.asciidoc
new file mode 100644
index 000000000..1bf38b69b
--- /dev/null
+++ b/docs/examples/f2b2d62bc0a44940ad14fca57d6d008a.asciidoc
@@ -0,0 +1,106 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/examples.asciidoc:215
+
+[source, python]
+----
+resp = client.transform.put_transform(
+ transform_id="suspicious_client_ips",
+ source={
+ "index": "kibana_sample_data_logs"
+ },
+ dest={
+ "index": "sample_weblogs_by_clientip"
+ },
+ sync={
+ "time": {
+ "field": "timestamp",
+ "delay": "60s"
+ }
+ },
+ pivot={
+ "group_by": {
+ "clientip": {
+ "terms": {
+ "field": "clientip"
+ }
+ }
+ },
+ "aggregations": {
+ "url_dc": {
+ "cardinality": {
+ "field": "url.keyword"
+ }
+ },
+ "bytes_sum": {
+ "sum": {
+ "field": "bytes"
+ }
+ },
+ "geo.src_dc": {
+ "cardinality": {
+ "field": "geo.src"
+ }
+ },
+ "agent_dc": {
+ "cardinality": {
+ "field": "agent.keyword"
+ }
+ },
+ "geo.dest_dc": {
+ "cardinality": {
+ "field": "geo.dest"
+ }
+ },
+ "responses.total": {
+ "value_count": {
+ "field": "timestamp"
+ }
+ },
+ "success": {
+ "filter": {
+ "term": {
+ "response": "200"
+ }
+ }
+ },
+ "error404": {
+ "filter": {
+ "term": {
+ "response": "404"
+ }
+ }
+ },
+ "error5xx": {
+ "filter": {
+ "range": {
+ "response": {
+ "gte": 500,
+ "lt": 600
+ }
+ }
+ }
+ },
+ "timestamp.min": {
+ "min": {
+ "field": "timestamp"
+ }
+ },
+ "timestamp.max": {
+ "max": {
+ "field": "timestamp"
+ }
+ },
+ "timestamp.duration_ms": {
+ "bucket_script": {
+ "buckets_path": {
+ "min_time": "timestamp.min.value",
+ "max_time": "timestamp.max.value"
+ },
+ "script": "(params.max_time - params.min_time)"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f2c9afd052878b2ec00908739b0d0f74.asciidoc b/docs/examples/f2c9afd052878b2ec00908739b0d0f74.asciidoc
new file mode 100644
index 000000000..00f46287c
--- /dev/null
+++ b/docs/examples/f2c9afd052878b2ec00908739b0d0f74.asciidoc
@@ -0,0 +1,39 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:697
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "rename": {
+ "description": "Rename 'provider' to 'cloud.provider'",
+ "field": "provider",
+ "target_field": "cloud.provider",
+ "on_failure": [
+ {
+ "set": {
+ "description": "Set 'error.message'",
+ "field": "error.message",
+ "value": "Field 'provider' does not exist. Cannot rename to 'cloud.provider'",
+ "override": False,
+ "on_failure": [
+ {
+ "set": {
+ "description": "Set 'error.message.multi'",
+ "field": "error.message.multi",
+ "value": "Document encountered multiple ingest errors",
+ "override": True
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/f2e854b6c99659ccc1824e86c096e433.asciidoc b/docs/examples/f2e854b6c99659ccc1824e86c096e433.asciidoc
new file mode 100644
index 000000000..580ae0c8f
--- /dev/null
+++ b/docs/examples/f2e854b6c99659ccc1824e86c096e433.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/auto-follow/resume-auto-follow-pattern.asciidoc:80
+
+[source, python]
+----
+resp = client.ccr.resume_auto_follow_pattern(
+ name="my_auto_follow_pattern",
+)
+print(resp)
+----
diff --git a/docs/examples/f2ec53c0ef5025de8890d0ff8ec287a0.asciidoc b/docs/examples/f2ec53c0ef5025de8890d0ff8ec287a0.asciidoc
new file mode 100644
index 000000000..9fb946dc7
--- /dev/null
+++ b/docs/examples/f2ec53c0ef5025de8890d0ff8ec287a0.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// search/rank-eval.asciidoc:353
+
+[source, python]
+----
+resp = client.rank_eval(
+ index="my-index-000001",
+ requests=[
+ {
+ "id": "JFK query",
+ "request": {
+ "query": {
+ "match_all": {}
+ }
+ },
+ "ratings": []
+ }
+ ],
+ metric={
+ "mean_reciprocal_rank": {
+ "k": 20,
+ "relevant_rating_threshold": 1
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f2f1cae094855a45fd8f73478bec8e70.asciidoc b/docs/examples/f2f1cae094855a45fd8f73478bec8e70.asciidoc
new file mode 100644
index 000000000..2a5e63f3e
--- /dev/null
+++ b/docs/examples/f2f1cae094855a45fd8f73478bec8e70.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/split-index.asciidoc:203
+
+[source, python]
+----
+resp = client.indices.split(
+ index="my_source_index",
+ target="my_target_index",
+ settings={
+ "index.number_of_shards": 5
+ },
+ aliases={
+ "my_search_indices": {}
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f329242d7c8406297eff9bf609870c37.asciidoc b/docs/examples/f329242d7c8406297eff9bf609870c37.asciidoc
new file mode 100644
index 000000000..ab1e4c38d
--- /dev/null
+++ b/docs/examples/f329242d7c8406297eff9bf609870c37.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/suggesters/completion-suggest.asciidoc:304
+
+[source, python]
+----
+resp = client.search(
+ index="music",
+ pretty=True,
+ suggest={
+ "song-suggest": {
+ "prefix": "nor",
+ "completion": {
+ "field": "suggest",
+ "fuzzy": {
+ "fuzziness": 2
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f32f0c19b42de3b87dd764fe4ca17e7c.asciidoc b/docs/examples/f32f0c19b42de3b87dd764fe4ca17e7c.asciidoc
index 13ead280a..34cd44cc4 100644
--- a/docs/examples/f32f0c19b42de3b87dd764fe4ca17e7c.asciidoc
+++ b/docs/examples/f32f0c19b42de3b87dd764fe4ca17e7c.asciidoc
@@ -1,17 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/query-string-query.asciidoc:420
[source, python]
----
resp = client.search(
- body={
- "query": {
- "query_string": {
- "default_field": "title",
- "query": "ny city",
- "auto_generate_synonyms_phrase_query": False,
- }
+ query={
+ "query_string": {
+ "default_field": "title",
+ "query": "ny city",
+ "auto_generate_synonyms_phrase_query": False
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f342465c65ba76383dedbb334b57b616.asciidoc b/docs/examples/f342465c65ba76383dedbb334b57b616.asciidoc
new file mode 100644
index 000000000..89f40ae5f
--- /dev/null
+++ b/docs/examples/f342465c65ba76383dedbb334b57b616.asciidoc
@@ -0,0 +1,42 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/index-options.asciidoc:32
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ mappings={
+ "properties": {
+ "text": {
+ "type": "text",
+ "index_options": "offsets"
+ }
+ }
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "text": "Quick brown fox"
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="my-index-000001",
+ query={
+ "match": {
+ "text": "brown fox"
+ }
+ },
+ highlight={
+ "fields": {
+ "text": {}
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/f34c02351662481dd61a5c2a3e206c60.asciidoc b/docs/examples/f34c02351662481dd61a5c2a3e206c60.asciidoc
new file mode 100644
index 000000000..8ccaf0bcd
--- /dev/null
+++ b/docs/examples/f34c02351662481dd61a5c2a3e206c60.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/hyphenation-decompounder-tokenfilter.asciidoc:25
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ {
+ "type": "hyphenation_decompounder",
+ "hyphenation_patterns_path": "analysis/hyphenation_patterns.xml",
+ "word_list": [
+ "Kaffee",
+ "zucker",
+ "tasse"
+ ]
+ }
+ ],
+ text="Kaffeetasse",
+)
+print(resp)
+----
diff --git a/docs/examples/f3574cfee3971d98417b8dc574a91be0.asciidoc b/docs/examples/f3574cfee3971d98417b8dc574a91be0.asciidoc
index 9d0bf459c..0d23bbd06 100644
--- a/docs/examples/f3574cfee3971d98417b8dc574a91be0.asciidoc
+++ b/docs/examples/f3574cfee3971d98417b8dc574a91be0.asciidoc
@@ -1,30 +1,44 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/flattened.asciidoc:367
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"flattened": {"type": "flattened"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "flattened": {
+ "type": "flattened"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={
+ document={
"flattened": {
"field": [
- {"id": 1, "name": "foo"},
- {"id": 2, "name": "bar"},
- {"id": 3, "name": "baz"},
+ {
+ "id": 1,
+ "name": "foo"
+ },
+ {
+ "id": 2,
+ "name": "bar"
+ },
+ {
+ "id": 3,
+ "name": "baz"
+ }
]
}
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/f3594de7ef39ab09b0bb12c1e76bfe6b.asciidoc b/docs/examples/f3594de7ef39ab09b0bb12c1e76bfe6b.asciidoc
new file mode 100644
index 000000000..5f7cd0dd9
--- /dev/null
+++ b/docs/examples/f3594de7ef39ab09b0bb12c1e76bfe6b.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/shrink-index.asciidoc:119
+
+[source, python]
+----
+resp = client.indices.shrink(
+ index="my_source_index",
+ target="my_target_index",
+ settings={
+ "index.routing.allocation.require._name": None,
+ "index.blocks.write": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f3697682a886ab129530f3e5c1b30632.asciidoc b/docs/examples/f3697682a886ab129530f3e5c1b30632.asciidoc
new file mode 100644
index 000000000..bee2d347e
--- /dev/null
+++ b/docs/examples/f3697682a886ab129530f3e5c1b30632.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/termvectors.asciidoc:10
+
+[source, python]
+----
+resp = client.termvectors(
+ index="my-index-000001",
+ id="1",
+)
+print(resp)
+----
diff --git a/docs/examples/f37173a75cd1b0d683c6f67819dd1de3.asciidoc b/docs/examples/f37173a75cd1b0d683c6f67819dd1de3.asciidoc
index 3894e149a..3d3d9027a 100644
--- a/docs/examples/f37173a75cd1b0d683c6f67819dd1de3.asciidoc
+++ b/docs/examples/f37173a75cd1b0d683c6f67819dd1de3.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:794
[source, python]
@@ -7,4 +8,4 @@ resp = client.get(
id="1",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f38262ef72f73816ec35fa4c9c85760d.asciidoc b/docs/examples/f38262ef72f73816ec35fa4c9c85760d.asciidoc
index e6b0775eb..9de3a3deb 100644
--- a/docs/examples/f38262ef72f73816ec35fa4c9c85760d.asciidoc
+++ b/docs/examples/f38262ef72f73816ec35fa4c9c85760d.asciidoc
@@ -1,29 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/range.asciidoc:254
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"my_range": {"type": "long_range"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "my_range": {
+ "type": "long_range"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={
+ document={
"my_range": [
- {"gte": 200, "lte": 300},
- {"gte": 1, "lte": 100},
- {"gte": 200, "lte": 300},
- {"gte": 200, "lte": 500},
+ {
+ "gte": 200,
+ "lte": 300
+ },
+ {
+ "gte": 1,
+ "lte": 100
+ },
+ {
+ "gte": 200,
+ "lte": 300
+ },
+ {
+ "gte": 200,
+ "lte": 500
+ }
]
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/f388e571224dd6850f8c9f9f08fca3da.asciidoc b/docs/examples/f388e571224dd6850f8c9f9f08fca3da.asciidoc
new file mode 100644
index 000000000..b062c34a7
--- /dev/null
+++ b/docs/examples/f388e571224dd6850f8c9f9f08fca3da.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/invalidate-api-keys.asciidoc:123
+
+[source, python]
+----
+resp = client.security.invalidate_api_key(
+ name="my-api-key",
+)
+print(resp)
+----
diff --git a/docs/examples/f3942d9b34138dfca79dff707af270b7.asciidoc b/docs/examples/f3942d9b34138dfca79dff707af270b7.asciidoc
new file mode 100644
index 000000000..59b84c5a4
--- /dev/null
+++ b/docs/examples/f3942d9b34138dfca79dff707af270b7.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:1169
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-data-stream",
+ timestamp_field="file.accessed",
+ event_category_field="file.type",
+ query="\n file where (file.size > 1 and file.type == \"file\")\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/f39512478cae2db8f4566a1e4af9e8f5.asciidoc b/docs/examples/f39512478cae2db8f4566a1e4af9e8f5.asciidoc
new file mode 100644
index 000000000..271a51425
--- /dev/null
+++ b/docs/examples/f39512478cae2db8f4566a1e4af9e8f5.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/rollup-getting-started.asciidoc:213
+
+[source, python]
+----
+resp = client.rollup.rollup_search(
+ index="sensor_rollup",
+ size=0,
+ aggregations={
+ "timeline": {
+ "date_histogram": {
+ "field": "timestamp",
+ "fixed_interval": "7d"
+ },
+ "aggs": {
+ "nodes": {
+ "terms": {
+ "field": "node"
+ },
+ "aggs": {
+ "max_temperature": {
+ "max": {
+ "field": "temperature"
+ }
+ },
+ "avg_voltage": {
+ "avg": {
+ "field": "voltage"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f3ab820e1f2f54ea718017aeae865742.asciidoc b/docs/examples/f3ab820e1f2f54ea718017aeae865742.asciidoc
new file mode 100644
index 000000000..736b86088
--- /dev/null
+++ b/docs/examples/f3ab820e1f2f54ea718017aeae865742.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/oidc-guide.asciidoc:470
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="oidc-finance",
+ roles=[
+ "finance_data"
+ ],
+ enabled=True,
+ rules={
+ "all": [
+ {
+ "field": {
+ "realm.name": "oidc1"
+ }
+ },
+ {
+ "field": {
+ "groups": "finance-team"
+ }
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f3b185131f40687c25d2f85e1231d8bd.asciidoc b/docs/examples/f3b185131f40687c25d2f85e1231d8bd.asciidoc
new file mode 100644
index 000000000..96ab82784
--- /dev/null
+++ b/docs/examples/f3b185131f40687c25d2f85e1231d8bd.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// search/validate.asciidoc:99
+
+[source, python]
+----
+resp = client.indices.validate_query(
+ index="my-index-000001",
+ q="user.id:kimchy",
+)
+print(resp)
+----
diff --git a/docs/examples/f3b4ddce8ff21fc1a76a7c0d9c36650e.asciidoc b/docs/examples/f3b4ddce8ff21fc1a76a7c0d9c36650e.asciidoc
new file mode 100644
index 000000000..316275700
--- /dev/null
+++ b/docs/examples/f3b4ddce8ff21fc1a76a7c0d9c36650e.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-shrink.asciidoc:65
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "warm": {
+ "actions": {
+ "shrink": {
+ "number_of_shards": 1
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f3c696cd63a3f042e62cbb94b75c2427.asciidoc b/docs/examples/f3c696cd63a3f042e62cbb94b75c2427.asciidoc
index c266926b1..bf7d72947 100644
--- a/docs/examples/f3c696cd63a3f042e62cbb94b75c2427.asciidoc
+++ b/docs/examples/f3c696cd63a3f042e62cbb94b75c2427.asciidoc
@@ -1,10 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
// upgrade/archived-settings.asciidoc:24
[source, python]
----
resp = client.cluster.get_settings(
- flat_settings="true",
+ flat_settings=True,
filter_path="persistent.archived*",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f3e1dfe1c440e3590be26f265e19425d.asciidoc b/docs/examples/f3e1dfe1c440e3590be26f265e19425d.asciidoc
new file mode 100644
index 000000000..2c2627b12
--- /dev/null
+++ b/docs/examples/f3e1dfe1c440e3590be26f265e19425d.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// vectors/vector-functions.asciidoc:235
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "script_score": {
+ "query": {
+ "bool": {
+ "filter": {
+ "term": {
+ "status": "published"
+ }
+ }
+ }
+ },
+ "script": {
+ "source": "1 / (1 + l2norm(params.queryVector, 'my_dense_vector'))",
+ "params": {
+ "queryVector": [
+ 4,
+ 3.4,
+ -0.2
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f3fb3cba44988b6e9fee93316138b2cf.asciidoc b/docs/examples/f3fb3cba44988b6e9fee93316138b2cf.asciidoc
new file mode 100644
index 000000000..eaaa1b0ec
--- /dev/null
+++ b/docs/examples/f3fb3cba44988b6e9fee93316138b2cf.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-privileges-cache.asciidoc:50
+
+[source, python]
+----
+resp = client.security.clear_cached_privileges(
+ application="myapp,my-other-app",
+)
+print(resp)
+----
diff --git a/docs/examples/f3fb52680482925c202c2e2f8af6f044.asciidoc b/docs/examples/f3fb52680482925c202c2e2f8af6f044.asciidoc
new file mode 100644
index 000000000..225b43453
--- /dev/null
+++ b/docs/examples/f3fb52680482925c202c2e2f8af6f044.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/size-your-shards.asciidoc:457
+
+[source, python]
+----
+resp = client.cat.count(
+ index="my-index-000001",
+ v=True,
+)
+print(resp)
+----
diff --git a/docs/examples/f3fe2012557ebbce1ebad4fc997c092d.asciidoc b/docs/examples/f3fe2012557ebbce1ebad4fc997c092d.asciidoc
new file mode 100644
index 000000000..db8e1b5cb
--- /dev/null
+++ b/docs/examples/f3fe2012557ebbce1ebad4fc997c092d.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/register-fs-repo.asciidoc:32
+
+[source, python]
+----
+resp = client.snapshot.create_repository(
+ name="my_fs_backup",
+ repository={
+ "type": "fs",
+ "settings": {
+ "location": "my_fs_backup_location"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f43d551aaaad73d979adf1b86533e6a3.asciidoc b/docs/examples/f43d551aaaad73d979adf1b86533e6a3.asciidoc
index ec5dce6cc..12cf1dac2 100644
--- a/docs/examples/f43d551aaaad73d979adf1b86533e6a3.asciidoc
+++ b/docs/examples/f43d551aaaad73d979adf1b86533e6a3.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:216
[source, python]
@@ -5,13 +6,14 @@
resp = client.search(
index="sales",
size="0",
- body={
- "aggs": {
- "sales_over_time": {
- "date_histogram": {"field": "date", "fixed_interval": "2w"}
+ aggs={
+ "sales_over_time": {
+ "date_histogram": {
+ "field": "date",
+ "fixed_interval": "2w"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f43ec4041e3b72bbde063452990bfc4b.asciidoc b/docs/examples/f43ec4041e3b72bbde063452990bfc4b.asciidoc
new file mode 100644
index 000000000..b1c76f31a
--- /dev/null
+++ b/docs/examples/f43ec4041e3b72bbde063452990bfc4b.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/clearcache.asciidoc:142
+
+[source, python]
+----
+resp = client.indices.clear_cache(
+ index="my-index-000001,my-index-000002",
+)
+print(resp)
+----
diff --git a/docs/examples/f44d287c6937785eb09b91353c1deb1e.asciidoc b/docs/examples/f44d287c6937785eb09b91353c1deb1e.asciidoc
new file mode 100644
index 000000000..8d7c695cc
--- /dev/null
+++ b/docs/examples/f44d287c6937785eb09b91353c1deb1e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-datafeed-stats.asciidoc:177
+
+[source, python]
+----
+resp = client.ml.get_datafeed_stats(
+ datafeed_id="datafeed-high_sum_total_sales",
+)
+print(resp)
+----
diff --git a/docs/examples/f453e14bcf30853e57618bf12f83e148.asciidoc b/docs/examples/f453e14bcf30853e57618bf12f83e148.asciidoc
new file mode 100644
index 000000000..42b01c6ee
--- /dev/null
+++ b/docs/examples/f453e14bcf30853e57618bf12f83e148.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/pattern-analyzer.asciidoc:385
+
+[source, python]
+----
+resp = client.indices.create(
+ index="pattern_example",
+ settings={
+ "analysis": {
+ "tokenizer": {
+ "split_on_non_word": {
+ "type": "pattern",
+ "pattern": "\\W+"
+ }
+ },
+ "analyzer": {
+ "rebuilt_pattern": {
+ "tokenizer": "split_on_non_word",
+ "filter": [
+ "lowercase"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f454e3f8ad5f5bd82a4a25af7dee9ca1.asciidoc b/docs/examples/f454e3f8ad5f5bd82a4a25af7dee9ca1.asciidoc
index 038287668..8f571685d 100644
--- a/docs/examples/f454e3f8ad5f5bd82a4a25af7dee9ca1.asciidoc
+++ b/docs/examples/f454e3f8ad5f5bd82a4a25af7dee9ca1.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/array.asciidoc:42
[source, python]
@@ -5,31 +6,47 @@
resp = client.index(
index="my-index-000001",
id="1",
- body={
+ document={
"message": "some arrays in this document...",
- "tags": ["elasticsearch", "wow"],
- "lists": [
- {"name": "prog_list", "description": "programming list"},
- {"name": "cool_list", "description": "cool stuff list"},
+ "tags": [
+ "elasticsearch",
+ "wow"
],
+ "lists": [
+ {
+ "name": "prog_list",
+ "description": "programming list"
+ },
+ {
+ "name": "cool_list",
+ "description": "cool stuff list"
+ }
+ ]
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="2",
- body={
+ document={
"message": "no arrays in this document...",
"tags": "elasticsearch",
- "lists": {"name": "prog_list", "description": "programming list"},
+ "lists": {
+ "name": "prog_list",
+ "description": "programming list"
+ }
},
)
-print(resp)
+print(resp1)
-resp = client.search(
+resp2 = client.search(
index="my-index-000001",
- body={"query": {"match": {"tags": "elasticsearch"}}},
+ query={
+ "match": {
+ "tags": "elasticsearch"
+ }
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp2)
+----
diff --git a/docs/examples/f45990264f8755b96b11c69c12c90ff4.asciidoc b/docs/examples/f45990264f8755b96b11c69c12c90ff4.asciidoc
new file mode 100644
index 000000000..df8d497cf
--- /dev/null
+++ b/docs/examples/f45990264f8755b96b11c69c12c90ff4.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/indices-exists.asciidoc:10
+
+[source, python]
+----
+resp = client.indices.exists(
+ index="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/f495f9c99916a05e3b28166d31955fad.asciidoc b/docs/examples/f495f9c99916a05e3b28166d31955fad.asciidoc
index 66fa23f1f..7506d9ee1 100644
--- a/docs/examples/f495f9c99916a05e3b28166d31955fad.asciidoc
+++ b/docs/examples/f495f9c99916a05e3b28166d31955fad.asciidoc
@@ -1,21 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:292
[source, python]
----
resp = client.search(
- body={
- "aggs": {
- "genres": {
- "terms": {
- "field": "genre",
- "order": {"playback_stats.max": "desc"},
- },
- "aggs": {
- "playback_stats": {"stats": {"field": "play_count"}}
- },
+ aggs={
+ "genres": {
+ "terms": {
+ "field": "genre",
+ "order": {
+ "playback_stats.max": "desc"
+ }
+ },
+ "aggs": {
+ "playback_stats": {
+ "stats": {
+ "field": "play_count"
+ }
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f49ac80f0130cae8d0ea6f4472a149dd.asciidoc b/docs/examples/f49ac80f0130cae8d0ea6f4472a149dd.asciidoc
new file mode 100644
index 000000000..df68fc906
--- /dev/null
+++ b/docs/examples/f49ac80f0130cae8d0ea6f4472a149dd.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/knn-query.asciidoc:17
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-image-index",
+ mappings={
+ "properties": {
+ "image-vector": {
+ "type": "dense_vector",
+ "dims": 3,
+ "index": True,
+ "similarity": "l2_norm"
+ },
+ "file-type": {
+ "type": "keyword"
+ },
+ "title": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f4ae3f3fbf07a7d39122ac5ac20b9c03.asciidoc b/docs/examples/f4ae3f3fbf07a7d39122ac5ac20b9c03.asciidoc
new file mode 100644
index 000000000..d2d7d75f1
--- /dev/null
+++ b/docs/examples/f4ae3f3fbf07a7d39122ac5ac20b9c03.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/knn-search.asciidoc:280
+
+[source, python]
+----
+resp = client.indices.create(
+ index="quantized-image-index",
+ mappings={
+ "properties": {
+ "image-vector": {
+ "type": "dense_vector",
+ "element_type": "float",
+ "dims": 2,
+ "index": True,
+ "index_options": {
+ "type": "int8_hnsw"
+ }
+ },
+ "title": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f4b9baed3c6a82be3672cbc8999c2368.asciidoc b/docs/examples/f4b9baed3c6a82be3672cbc8999c2368.asciidoc
new file mode 100644
index 000000000..5ad334f01
--- /dev/null
+++ b/docs/examples/f4b9baed3c6a82be3672cbc8999c2368.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// search/terms-enum.asciidoc:13
+
+[source, python]
+----
+resp = client.terms_enum(
+ index="stackoverflow",
+ field="tags",
+ string="kiba",
+)
+print(resp)
+----
diff --git a/docs/examples/f4c194628761a4cf2a01453a96bbcc3c.asciidoc b/docs/examples/f4c194628761a4cf2a01453a96bbcc3c.asciidoc
index 9654b7b3d..b645e7ea4 100644
--- a/docs/examples/f4c194628761a4cf2a01453a96bbcc3c.asciidoc
+++ b/docs/examples/f4c194628761a4cf2a01453a96bbcc3c.asciidoc
@@ -1,41 +1,87 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:344
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "multipolygon",
"coordinates": [
[
[
- [1002, 200],
- [1003, 200],
- [1003, 300],
- [1002, 300],
- [1002, 200],
+ [
+ 1002,
+ 200
+ ],
+ [
+ 1003,
+ 200
+ ],
+ [
+ 1003,
+ 300
+ ],
+ [
+ 1002,
+ 300
+ ],
+ [
+ 1002,
+ 200
+ ]
]
],
[
[
- [1000, 200],
- [1001, 100],
- [1001, 100],
- [1000, 100],
- [1000, 100],
+ [
+ 1000,
+ 200
+ ],
+ [
+ 1001,
+ 100
+ ],
+ [
+ 1001,
+ 100
+ ],
+ [
+ 1000,
+ 100
+ ],
+ [
+ 1000,
+ 100
+ ]
],
[
- [1000.2, 200.2],
- [1000.8, 100.2],
- [1000.8, 100.8],
- [1000.2, 100.8],
- [1000.2, 100.2],
- ],
- ],
- ],
+ [
+ 1000.2,
+ 200.2
+ ],
+ [
+ 1000.8,
+ 100.2
+ ],
+ [
+ 1000.8,
+ 100.8
+ ],
+ [
+ 1000.2,
+ 100.8
+ ],
+ [
+ 1000.2,
+ 100.2
+ ]
+ ]
+ ]
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f4d0ef2e0f76babee83d999fe35127f2.asciidoc b/docs/examples/f4d0ef2e0f76babee83d999fe35127f2.asciidoc
new file mode 100644
index 000000000..9a29988d0
--- /dev/null
+++ b/docs/examples/f4d0ef2e0f76babee83d999fe35127f2.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/attachment.asciidoc:267
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="attachment",
+ description="Extract attachment information",
+ processors=[
+ {
+ "attachment": {
+ "field": "data",
+ "indexed_chars": 11,
+ "indexed_chars_field": "max_size",
+ "remove_binary": False
+ }
+ }
+ ],
+)
+print(resp)
+
+resp1 = client.index(
+ index="my-index-000001",
+ id="my_id_2",
+ pipeline="attachment",
+ document={
+ "data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=",
+ "max_size": 5
+ },
+)
+print(resp1)
+
+resp2 = client.get(
+ index="my-index-000001",
+ id="my_id_2",
+)
+print(resp2)
+----
diff --git a/docs/examples/f4dc1286d0a2f8d1fde64fbf12fd9f8d.asciidoc b/docs/examples/f4dc1286d0a2f8d1fde64fbf12fd9f8d.asciidoc
new file mode 100644
index 000000000..cbec63443
--- /dev/null
+++ b/docs/examples/f4dc1286d0a2f8d1fde64fbf12fd9f8d.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// troubleshooting/common-issues/disk-usage-exceeded.asciidoc:85
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster.routing.allocation.disk.watermark.low": None,
+ "cluster.routing.allocation.disk.watermark.low.max_headroom": None,
+ "cluster.routing.allocation.disk.watermark.high": None,
+ "cluster.routing.allocation.disk.watermark.high.max_headroom": None,
+ "cluster.routing.allocation.disk.watermark.flood_stage": None,
+ "cluster.routing.allocation.disk.watermark.flood_stage.max_headroom": None,
+ "cluster.routing.allocation.disk.watermark.flood_stage.frozen": None,
+ "cluster.routing.allocation.disk.watermark.flood_stage.frozen.max_headroom": None
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f4f557716049b23f8840d58d71e748f0.asciidoc b/docs/examples/f4f557716049b23f8840d58d71e748f0.asciidoc
index c4dfe1464..087424acd 100644
--- a/docs/examples/f4f557716049b23f8840d58d71e748f0.asciidoc
+++ b/docs/examples/f4f557716049b23f8840d58d71e748f0.asciidoc
@@ -1,10 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// indices/update-settings.asciidoc:115
[source, python]
----
resp = client.indices.put_settings(
index="my-index-000001",
- body={"index": {"refresh_interval": "-1"}},
+ settings={
+ "index": {
+ "refresh_interval": "-1"
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f4fdfe52ecba65eec6beb30d8deb8bbf.asciidoc b/docs/examples/f4fdfe52ecba65eec6beb30d8deb8bbf.asciidoc
new file mode 100644
index 000000000..ceca7cc8a
--- /dev/null
+++ b/docs/examples/f4fdfe52ecba65eec6beb30d8deb8bbf.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/post-forget-follower.asciidoc:35
+
+[source, python]
+----
+resp = client.ccr.forget_follower(
+ index="",
+ follower_cluster="",
+ follower_index="",
+ follower_index_uuid="",
+ leader_remote_cluster="",
+)
+print(resp)
+----
diff --git a/docs/examples/f5013174f77868da4dc40cdd745d4ea4.asciidoc b/docs/examples/f5013174f77868da4dc40cdd745d4ea4.asciidoc
new file mode 100644
index 000000000..cbbea4985
--- /dev/null
+++ b/docs/examples/f5013174f77868da4dc40cdd745d4ea4.asciidoc
@@ -0,0 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/rare-terms-aggregation.asciidoc:130
+
+[source, python]
+----
+resp = client.search(
+ aggs={
+ "genres": {
+ "rare_terms": {
+ "field": "genre",
+ "max_doc_count": 2
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f5140f08f56c64b5789357539f8b9ba8.asciidoc b/docs/examples/f5140f08f56c64b5789357539f8b9ba8.asciidoc
new file mode 100644
index 000000000..f0e6a2bcd
--- /dev/null
+++ b/docs/examples/f5140f08f56c64b5789357539f8b9ba8.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/delete-alias.asciidoc:10
+
+[source, python]
+----
+resp = client.indices.delete_alias(
+ index="my-data-stream",
+ name="my-alias",
+)
+print(resp)
+----
diff --git a/docs/examples/f545bb95214769aca993c1632a71ad2c.asciidoc b/docs/examples/f545bb95214769aca993c1632a71ad2c.asciidoc
new file mode 100644
index 000000000..90e5c9e69
--- /dev/null
+++ b/docs/examples/f545bb95214769aca993c1632a71ad2c.asciidoc
@@ -0,0 +1,61 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:785
+
+[source, python]
+----
+resp = client.indices.create(
+ index="french_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "french_elision": {
+ "type": "elision",
+ "articles_case": True,
+ "articles": [
+ "l",
+ "m",
+ "t",
+ "qu",
+ "n",
+ "s",
+ "j",
+ "d",
+ "c",
+ "jusqu",
+ "quoiqu",
+ "lorsqu",
+ "puisqu"
+ ]
+ },
+ "french_stop": {
+ "type": "stop",
+ "stopwords": "_french_"
+ },
+ "french_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "Example"
+ ]
+ },
+ "french_stemmer": {
+ "type": "stemmer",
+ "language": "light_french"
+ }
+ },
+ "analyzer": {
+ "rebuilt_french": {
+ "tokenizer": "standard",
+ "filter": [
+ "french_elision",
+ "lowercase",
+ "french_stop",
+ "french_keywords",
+ "french_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f54f6d06163221f2c7aff6e8db942be3.asciidoc b/docs/examples/f54f6d06163221f2c7aff6e8db942be3.asciidoc
new file mode 100644
index 000000000..e9f55c6e6
--- /dev/null
+++ b/docs/examples/f54f6d06163221f2c7aff6e8db942be3.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/take-snapshot.asciidoc:579
+
+[source, python]
+----
+resp = client.slm.put_lifecycle(
+ policy_id="daily-snapshots",
+ name="",
+ schedule="0 45 23 * * ?",
+ repository="my_repository",
+ config={
+ "indices": "*",
+ "include_global_state": True
+ },
+ retention={
+ "expire_after": "30d",
+ "min_count": 1,
+ "max_count": 31
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f57ce7de0946e9416ddb9150e95f4b74.asciidoc b/docs/examples/f57ce7de0946e9416ddb9150e95f4b74.asciidoc
new file mode 100644
index 000000000..47691a06e
--- /dev/null
+++ b/docs/examples/f57ce7de0946e9416ddb9150e95f4b74.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// inference/service-azure-openai.asciidoc:139
+
+[source, python]
+----
+resp = client.inference.put(
+ task_type="completion",
+ inference_id="azure_openai_completion",
+ inference_config={
+ "service": "azureopenai",
+ "service_settings": {
+ "api_key": "",
+ "resource_name": "",
+ "deployment_id": "",
+ "api_version": "2024-02-01"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f5815d573cee0447910c9668003887b8.asciidoc b/docs/examples/f5815d573cee0447910c9668003887b8.asciidoc
index 1d2c30486..3828ec863 100644
--- a/docs/examples/f5815d573cee0447910c9668003887b8.asciidoc
+++ b/docs/examples/f5815d573cee0447910c9668003887b8.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/datehistogram-aggregation.asciidoc:122
[source, python]
@@ -5,16 +6,14 @@
resp = client.search(
index="sales",
size="0",
- body={
- "aggs": {
- "sales_over_time": {
- "date_histogram": {
- "field": "date",
- "calendar_interval": "2d",
- }
+ aggs={
+ "sales_over_time": {
+ "date_histogram": {
+ "field": "date",
+ "calendar_interval": "2d"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f58969ac405db85f439c5940d014964b.asciidoc b/docs/examples/f58969ac405db85f439c5940d014964b.asciidoc
new file mode 100644
index 000000000..b3dca266b
--- /dev/null
+++ b/docs/examples/f58969ac405db85f439c5940d014964b.asciidoc
@@ -0,0 +1,24 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-bounding-box-query.asciidoc:271
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_bounding_box": {
+ "pin.location": {
+ "wkt": "BBOX (-74.1, -71.12, 40.73, 40.01)"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f58fd031597e2c3df78bf0efd07206e3.asciidoc b/docs/examples/f58fd031597e2c3df78bf0efd07206e3.asciidoc
new file mode 100644
index 000000000..a2222067f
--- /dev/null
+++ b/docs/examples/f58fd031597e2c3df78bf0efd07206e3.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// licensing/start-basic.asciidoc:62
+
+[source, python]
+----
+resp = client.license.post_start_basic(
+ acknowledge=True,
+)
+print(resp)
+----
diff --git a/docs/examples/f5bf2526af19d964f8c4c59d4795cffc.asciidoc b/docs/examples/f5bf2526af19d964f8c4c59d4795cffc.asciidoc
new file mode 100644
index 000000000..728ef33e7
--- /dev/null
+++ b/docs/examples/f5bf2526af19d964f8c4c59d4795cffc.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/mlt-query.asciidoc:121
+
+[source, python]
+----
+resp = client.indices.create(
+ index="imdb",
+ mappings={
+ "properties": {
+ "title": {
+ "type": "text",
+ "term_vector": "yes"
+ },
+ "description": {
+ "type": "text"
+ },
+ "tags": {
+ "type": "text",
+ "fields": {
+ "raw": {
+ "type": "text",
+ "analyzer": "keyword",
+ "term_vector": "yes"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f5cbbb60ca26867a5d2da625a68a6e65.asciidoc b/docs/examples/f5cbbb60ca26867a5d2da625a68a6e65.asciidoc
new file mode 100644
index 000000000..ce08681b4
--- /dev/null
+++ b/docs/examples/f5cbbb60ca26867a5d2da625a68a6e65.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// transform/ecommerce-tutorial.asciidoc:337
+
+[source, python]
+----
+resp = client.indices.create(
+ index="ecommerce-customers",
+ mappings={
+ "properties": {
+ "total_quantity.sum": {
+ "type": "double"
+ },
+ "total_quantity": {
+ "type": "object"
+ },
+ "taxless_total_price": {
+ "type": "object"
+ },
+ "taxless_total_price.sum": {
+ "type": "double"
+ },
+ "order_id.cardinality": {
+ "type": "long"
+ },
+ "customer_id": {
+ "type": "keyword"
+ },
+ "total_quantity.max": {
+ "type": "integer"
+ },
+ "order_id": {
+ "type": "object"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f5e50fe8a60467adb2c5ee9e0f2d88da.asciidoc b/docs/examples/f5e50fe8a60467adb2c5ee9e0f2d88da.asciidoc
new file mode 100644
index 000000000..a9e0c0591
--- /dev/null
+++ b/docs/examples/f5e50fe8a60467adb2c5ee9e0f2d88da.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:348
+
+[source, python]
+----
+resp = client.sql.clear_cursor(
+ cursor="sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8=",
+)
+print(resp)
+----
diff --git a/docs/examples/f5e6378cc41ddf5326fe4084396c59b2.asciidoc b/docs/examples/f5e6378cc41ddf5326fe4084396c59b2.asciidoc
new file mode 100644
index 000000000..f8e964251
--- /dev/null
+++ b/docs/examples/f5e6378cc41ddf5326fe4084396c59b2.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/specify-analyzer.asciidoc:186
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "default": {
+ "type": "simple"
+ },
+ "default_search": {
+ "type": "whitespace"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f5eed3f2e3558a238487bc85305b7a71.asciidoc b/docs/examples/f5eed3f2e3558a238487bc85305b7a71.asciidoc
index 1a23d66e8..206271e47 100644
--- a/docs/examples/f5eed3f2e3558a238487bc85305b7a71.asciidoc
+++ b/docs/examples/f5eed3f2e3558a238487bc85305b7a71.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:242
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0))"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f5ef80dd92c67059ca353a833e6b7b5e.asciidoc b/docs/examples/f5ef80dd92c67059ca353a833e6b7b5e.asciidoc
new file mode 100644
index 000000000..a53389ed6
--- /dev/null
+++ b/docs/examples/f5ef80dd92c67059ca353a833e6b7b5e.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/sum-aggregation.asciidoc:14
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ query={
+ "constant_score": {
+ "filter": {
+ "match": {
+ "type": "hat"
+ }
+ }
+ }
+ },
+ aggs={
+ "hat_prices": {
+ "sum": {
+ "field": "price"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f63f6343e74bd5c844854272e746de14.asciidoc b/docs/examples/f63f6343e74bd5c844854272e746de14.asciidoc
new file mode 100644
index 000000000..00f67f60f
--- /dev/null
+++ b/docs/examples/f63f6343e74bd5c844854272e746de14.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/deactivate-watch.asciidoc:82
+
+[source, python]
+----
+resp = client.watcher.deactivate_watch(
+ watch_id="my_watch",
+)
+print(resp)
+----
diff --git a/docs/examples/f642b64e592131f37209a5100fe161cc.asciidoc b/docs/examples/f642b64e592131f37209a5100fe161cc.asciidoc
index 9305917b6..b5286b85d 100644
--- a/docs/examples/f642b64e592131f37209a5100fe161cc.asciidoc
+++ b/docs/examples/f642b64e592131f37209a5100fe161cc.asciidoc
@@ -1,38 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/dynamic/templates.asciidoc:425
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "dynamic_templates": [
- {
- "named_analyzers": {
- "match_mapping_type": "string",
- "match": "*",
- "mapping": {"type": "text", "analyzer": "{name}"},
+ mappings={
+ "dynamic_templates": [
+ {
+ "named_analyzers": {
+ "match_mapping_type": "string",
+ "match": "*",
+ "mapping": {
+ "type": "text",
+ "analyzer": "{name}"
}
- },
- {
- "no_doc_values": {
- "match_mapping_type": "*",
- "mapping": {
- "type": "{dynamic_type}",
- "doc_values": False,
- },
+ }
+ },
+ {
+ "no_doc_values": {
+ "match_mapping_type": "*",
+ "mapping": {
+ "type": "{dynamic_type}",
+ "doc_values": False
}
- },
- ]
- }
+ }
+ }
+ ]
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="my-index-000001",
id="1",
- body={"english": "Some English text", "count": 5},
+ document={
+ "english": "Some English text",
+ "count": 5
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/f6566395f85d3afe917228643d7318d6.asciidoc b/docs/examples/f6566395f85d3afe917228643d7318d6.asciidoc
new file mode 100644
index 000000000..7c9ef09c7
--- /dev/null
+++ b/docs/examples/f6566395f85d3afe917228643d7318d6.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/size-your-shards.asciidoc:467
+
+[source, python]
+----
+resp = client.indices.delete(
+ index="my-index-000001",
+)
+print(resp)
+----
diff --git a/docs/examples/f656c1e64268293ecc8ebd8065628faa.asciidoc b/docs/examples/f656c1e64268293ecc8ebd8065628faa.asciidoc
new file mode 100644
index 000000000..1b4e85d1d
--- /dev/null
+++ b/docs/examples/f656c1e64268293ecc8ebd8065628faa.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-service-token-caches.asciidoc:70
+
+[source, python]
+----
+resp = client.security.clear_cached_service_tokens(
+ namespace="elastic",
+ service="fleet-server",
+ name="*",
+)
+print(resp)
+----
diff --git a/docs/examples/f65abb38dd0cfedeb06e0cef206fbdab.asciidoc b/docs/examples/f65abb38dd0cfedeb06e0cef206fbdab.asciidoc
new file mode 100644
index 000000000..74bd79c88
--- /dev/null
+++ b/docs/examples/f65abb38dd0cfedeb06e0cef206fbdab.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/ngram-tokenfilter.asciidoc:30
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "ngram"
+ ],
+ text="Quick fox",
+)
+print(resp)
+----
diff --git a/docs/examples/f66643c54999426c5afa6d5a87435d4e.asciidoc b/docs/examples/f66643c54999426c5afa6d5a87435d4e.asciidoc
new file mode 100644
index 000000000..767b7ced6
--- /dev/null
+++ b/docs/examples/f66643c54999426c5afa6d5a87435d4e.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-api-key-cache.asciidoc:43
+
+[source, python]
+----
+resp = client.security.clear_api_key_cache(
+ ids="yVGMr3QByxdh1MSaicYx",
+)
+print(resp)
+----
diff --git a/docs/examples/f67d8aab9106ad24b1d2c771d3840ed1.asciidoc b/docs/examples/f67d8aab9106ad24b1d2c771d3840ed1.asciidoc
new file mode 100644
index 000000000..c543eb50a
--- /dev/null
+++ b/docs/examples/f67d8aab9106ad24b1d2c771d3840ed1.asciidoc
@@ -0,0 +1,70 @@
+// This file is autogenerated, DO NOT EDIT
+// watcher/actions.asciidoc:276
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="log_event_watch",
+ trigger={
+ "schedule": {
+ "interval": "5m"
+ }
+ },
+ input={
+ "search": {
+ "request": {
+ "indices": "log-events",
+ "body": {
+ "size": 0,
+ "query": {
+ "match": {
+ "status": "error"
+ }
+ }
+ }
+ }
+ }
+ },
+ condition={
+ "compare": {
+ "ctx.payload.hits.total": {
+ "gt": 0
+ }
+ }
+ },
+ actions={
+ "email_administrator": {
+ "email": {
+ "to": "sys.admino@host.domain",
+ "subject": "Encountered {{ctx.payload.hits.total}} errors",
+ "body": "Too many error in the system, see attached data",
+ "attachments": {
+ "attached_data": {
+ "data": {
+ "format": "json"
+ }
+ }
+ },
+ "priority": "high"
+ }
+ },
+ "notify_pager": {
+ "condition": {
+ "compare": {
+ "ctx.payload.hits.total": {
+ "gt": 5
+ }
+ }
+ },
+ "webhook": {
+ "method": "POST",
+ "host": "pager.service.domain",
+ "port": 1234,
+ "path": "/{{watch_id}}",
+ "body": "Encountered {{ctx.payload.hits.total}} errors"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f6911b0f2f56523ccbd8027f276981b3.asciidoc b/docs/examples/f6911b0f2f56523ccbd8027f276981b3.asciidoc
new file mode 100644
index 000000000..55b8271c5
--- /dev/null
+++ b/docs/examples/f6911b0f2f56523ccbd8027f276981b3.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/combined-fields-query.asciidoc:15
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "combined_fields": {
+ "query": "database systems",
+ "fields": [
+ "title",
+ "abstract",
+ "body"
+ ],
+ "operator": "and"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f6982ff80b9a64cd5fcac5b20908c906.asciidoc b/docs/examples/f6982ff80b9a64cd5fcac5b20908c906.asciidoc
new file mode 100644
index 000000000..08be9d126
--- /dev/null
+++ b/docs/examples/f6982ff80b9a64cd5fcac5b20908c906.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/delete-calendar-event.asciidoc:43
+
+[source, python]
+----
+resp = client.ml.delete_calendar_event(
+ calendar_id="planned-outages",
+ event_id="LS8LJGEBMTCMA-qz49st",
+)
+print(resp)
+----
diff --git a/docs/examples/f6c9d72fa26cbedd0c3f9fa64a88c38a.asciidoc b/docs/examples/f6c9d72fa26cbedd0c3f9fa64a88c38a.asciidoc
index 02881fb4d..e6c5b2140 100644
--- a/docs/examples/f6c9d72fa26cbedd0c3f9fa64a88c38a.asciidoc
+++ b/docs/examples/f6c9d72fa26cbedd0c3f9fa64a88c38a.asciidoc
@@ -1,9 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/alias.asciidoc:86
[source, python]
----
resp = client.search(
- body={"query": {"match_all": {}}, "_source": "route_length_miles"},
+ query={
+ "match_all": {}
+ },
+ source="route_length_miles",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f6d493650b4344f17297b568016fb445.asciidoc b/docs/examples/f6d493650b4344f17297b568016fb445.asciidoc
new file mode 100644
index 000000000..8e1f1d499
--- /dev/null
+++ b/docs/examples/f6d493650b4344f17297b568016fb445.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/apis/follow/post-unfollow.asciidoc:33
+
+[source, python]
+----
+resp = client.ccr.unfollow(
+ index="",
+)
+print(resp)
+----
diff --git a/docs/examples/f6de702c3d097af0b0bd391c4f947233.asciidoc b/docs/examples/f6de702c3d097af0b0bd391c4f947233.asciidoc
new file mode 100644
index 000000000..ff2a7f63d
--- /dev/null
+++ b/docs/examples/f6de702c3d097af0b0bd391c4f947233.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/disk/decrease-data-node-disk-usage.asciidoc:103
+
+[source, python]
+----
+resp = client.cat.indices(
+ v=True,
+ s="rep:desc,pri.store.size:desc",
+ h="health,index,pri,rep,store.size,pri.store.size",
+)
+print(resp)
+----
diff --git a/docs/examples/f6df4acf3c7a4f85706ff314b21ebcb2.asciidoc b/docs/examples/f6df4acf3c7a4f85706ff314b21ebcb2.asciidoc
new file mode 100644
index 000000000..a030da158
--- /dev/null
+++ b/docs/examples/f6df4acf3c7a4f85706ff314b21ebcb2.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/clear-privileges-cache.asciidoc:43
+
+[source, python]
+----
+resp = client.security.clear_cached_privileges(
+ application="myapp",
+)
+print(resp)
+----
diff --git a/docs/examples/f6ead39c5505045543b9225deca7367d.asciidoc b/docs/examples/f6ead39c5505045543b9225deca7367d.asciidoc
new file mode 100644
index 000000000..e133cf10f
--- /dev/null
+++ b/docs/examples/f6ead39c5505045543b9225deca7367d.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// cluster/voting-exclusions.asciidoc:105
+
+[source, python]
+----
+resp = client.cluster.post_voting_config_exclusions(
+ node_names="nodeName1,nodeName2",
+)
+print(resp)
+----
diff --git a/docs/examples/f6edbed2b5b2709bbc13866a4780e27a.asciidoc b/docs/examples/f6edbed2b5b2709bbc13866a4780e27a.asciidoc
new file mode 100644
index 000000000..654ad4645
--- /dev/null
+++ b/docs/examples/f6edbed2b5b2709bbc13866a4780e27a.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/params/dynamic.asciidoc:9
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ document={
+ "username": "johnsmith",
+ "name": {
+ "first": "John",
+ "last": "Smith"
+ }
+ },
+)
+print(resp)
+
+resp1 = client.indices.get_mapping(
+ index="my-index-000001",
+)
+print(resp1)
+----
diff --git a/docs/examples/f6eff830fb0fad200ebfb1e3e46f6f0e.asciidoc b/docs/examples/f6eff830fb0fad200ebfb1e3e46f6f0e.asciidoc
new file mode 100644
index 000000000..eb34a6f82
--- /dev/null
+++ b/docs/examples/f6eff830fb0fad200ebfb1e3e46f6f0e.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/execute-watch.asciidoc:155
+
+[source, python]
+----
+resp = client.watcher.execute_watch(
+ id="my_watch",
+ trigger_data={
+ "triggered_time": "now",
+ "scheduled_time": "now"
+ },
+ alternative_input={
+ "foo": "bar"
+ },
+ ignore_condition=True,
+ action_modes={
+ "my-action": "force_simulate"
+ },
+ record_execution=True,
+)
+print(resp)
+----
diff --git a/docs/examples/f70a54cd9a9f4811bf962e469f2ca2ea.asciidoc b/docs/examples/f70a54cd9a9f4811bf962e469f2ca2ea.asciidoc
index e15aff365..5d8f859d7 100644
--- a/docs/examples/f70a54cd9a9f4811bf962e469f2ca2ea.asciidoc
+++ b/docs/examples/f70a54cd9a9f4811bf962e469f2ca2ea.asciidoc
@@ -1,9 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/bool-query.asciidoc:88
[source, python]
----
resp = client.search(
- body={"query": {"bool": {"filter": {"term": {"status": "active"}}}}},
+ query={
+ "bool": {
+ "filter": {
+ "term": {
+ "status": "active"
+ }
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f70ff57c80cdbce3f1e7c63ee307c92d.asciidoc b/docs/examples/f70ff57c80cdbce3f1e7c63ee307c92d.asciidoc
new file mode 100644
index 000000000..2decbc5f1
--- /dev/null
+++ b/docs/examples/f70ff57c80cdbce3f1e7c63ee307c92d.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:503
+
+[source, python]
+----
+resp = client.reindex(
+ source={
+ "index": "my_test_scores"
+ },
+ dest={
+ "index": "my_test_scores_2",
+ "pipeline": "my_test_scores_pipeline"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f7139b3c0e066be832b9100ae17157cc.asciidoc b/docs/examples/f7139b3c0e066be832b9100ae17157cc.asciidoc
new file mode 100644
index 000000000..9bc815080
--- /dev/null
+++ b/docs/examples/f7139b3c0e066be832b9100ae17157cc.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// esql/esql-rest.asciidoc:50
+
+[source, python]
+----
+resp = client.esql.query(
+ format="txt",
+ query="\n FROM library\n | KEEP author, name, page_count, release_date\n | SORT page_count DESC\n | LIMIT 5\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/f733b25cd4c448b226bb76862974eef2.asciidoc b/docs/examples/f733b25cd4c448b226bb76862974eef2.asciidoc
new file mode 100644
index 000000000..52d65d0bf
--- /dev/null
+++ b/docs/examples/f733b25cd4c448b226bb76862974eef2.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/pattern-capture-tokenfilter.asciidoc:51
+
+[source, python]
+----
+resp = client.indices.create(
+ index="test",
+ settings={
+ "analysis": {
+ "filter": {
+ "code": {
+ "type": "pattern_capture",
+ "preserve_original": True,
+ "patterns": [
+ "(\\p{Ll}+|\\p{Lu}\\p{Ll}+|\\p{Lu}+)",
+ "(\\d+)"
+ ]
+ }
+ },
+ "analyzer": {
+ "code": {
+ "tokenizer": "pattern",
+ "filter": [
+ "code",
+ "lowercase"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f749efe8f11ebd43ef83db91922c736e.asciidoc b/docs/examples/f749efe8f11ebd43ef83db91922c736e.asciidoc
new file mode 100644
index 000000000..b54ca2498
--- /dev/null
+++ b/docs/examples/f749efe8f11ebd43ef83db91922c736e.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// ccr/uni-directional-disaster-recovery.asciidoc:133
+
+[source, python]
+----
+resp = client.cluster.put_settings(
+ persistent={
+ "cluster": {
+ "remote": {
+ "clusterB": {
+ "mode": "proxy",
+ "skip_unavailable": "true",
+ "server_name": "clusterb.es.region-b.gcp.elastic-cloud.com",
+ "proxy_socket_connections": "18",
+ "proxy_address": "clusterb.es.region-b.gcp.elastic-cloud.com:9400"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f7726cc2c60dea26b88bf0df99fb0813.asciidoc b/docs/examples/f7726cc2c60dea26b88bf0df99fb0813.asciidoc
index e091bc6aa..755c58e52 100644
--- a/docs/examples/f7726cc2c60dea26b88bf0df99fb0813.asciidoc
+++ b/docs/examples/f7726cc2c60dea26b88bf0df99fb0813.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:197
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={"mappings": {"runtime": {"day_of_week": {"type": "keyword"}}}},
+ mappings={
+ "runtime": {
+ "day_of_week": {
+ "type": "keyword"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f785b5d17eb59f8d2a353c2dee66eb5b.asciidoc b/docs/examples/f785b5d17eb59f8d2a353c2dee66eb5b.asciidoc
new file mode 100644
index 000000000..47d3faaab
--- /dev/null
+++ b/docs/examples/f785b5d17eb59f8d2a353c2dee66eb5b.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/get-connector-sync-job-api.asciidoc:44
+
+[source, python]
+----
+resp = client.perform_request(
+ "GET",
+ "/_connector/_sync_job/my-connector-sync-job",
+)
+print(resp)
+----
diff --git a/docs/examples/f7d3d367a3d8e8ff0eca426b6ea85252.asciidoc b/docs/examples/f7d3d367a3d8e8ff0eca426b6ea85252.asciidoc
new file mode 100644
index 000000000..ee6bd7f5d
--- /dev/null
+++ b/docs/examples/f7d3d367a3d8e8ff0eca426b6ea85252.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/tsds-reindex.asciidoc:222
+
+[source, python]
+----
+resp = client.reindex(
+ source={
+ "index": "k8s"
+ },
+ dest={
+ "index": "k9s",
+ "op_type": "create"
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f7dc2fed08e57abda2c3e8a14f8eb098.asciidoc b/docs/examples/f7dc2fed08e57abda2c3e8a14f8eb098.asciidoc
new file mode 100644
index 000000000..93c9879a7
--- /dev/null
+++ b/docs/examples/f7dc2fed08e57abda2c3e8a14f8eb098.asciidoc
@@ -0,0 +1,41 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/lang-analyzer.asciidoc:136
+
+[source, python]
+----
+resp = client.indices.create(
+ index="armenian_example",
+ settings={
+ "analysis": {
+ "filter": {
+ "armenian_stop": {
+ "type": "stop",
+ "stopwords": "_armenian_"
+ },
+ "armenian_keywords": {
+ "type": "keyword_marker",
+ "keywords": [
+ "օրինակ"
+ ]
+ },
+ "armenian_stemmer": {
+ "type": "stemmer",
+ "language": "armenian"
+ }
+ },
+ "analyzer": {
+ "rebuilt_armenian": {
+ "tokenizer": "standard",
+ "filter": [
+ "lowercase",
+ "armenian_stop",
+ "armenian_keywords",
+ "armenian_stemmer"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f7ec9062b3a7578fed55f119d7c22b74.asciidoc b/docs/examples/f7ec9062b3a7578fed55f119d7c22b74.asciidoc
new file mode 100644
index 000000000..b612287ee
--- /dev/null
+++ b/docs/examples/f7ec9062b3a7578fed55f119d7c22b74.asciidoc
@@ -0,0 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/testing.asciidoc:62
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="standard",
+ filter=[
+ "lowercase",
+ "asciifolding"
+ ],
+ text="Is this déja vu?",
+)
+print(resp)
+----
diff --git a/docs/examples/f823e4b87ed181b27f73ebc51351f0ee.asciidoc b/docs/examples/f823e4b87ed181b27f73ebc51351f0ee.asciidoc
new file mode 100644
index 000000000..0de27db07
--- /dev/null
+++ b/docs/examples/f823e4b87ed181b27f73ebc51351f0ee.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/delete-data-stream.asciidoc:26
+
+[source, python]
+----
+resp = client.indices.delete_data_stream(
+ name="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/f83eb6605c7c56e297a494b318400ef0.asciidoc b/docs/examples/f83eb6605c7c56e297a494b318400ef0.asciidoc
new file mode 100644
index 000000000..44e9713cd
--- /dev/null
+++ b/docs/examples/f83eb6605c7c56e297a494b318400ef0.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/filter-search-results.asciidoc:58
+
+[source, python]
+----
+resp = client.search(
+ index="shirts",
+ query={
+ "bool": {
+ "filter": [
+ {
+ "term": {
+ "color": "red"
+ }
+ },
+ {
+ "term": {
+ "brand": "gucci"
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f8525c2460a577edfef156c13f55b8a7.asciidoc b/docs/examples/f8525c2460a577edfef156c13f55b8a7.asciidoc
new file mode 100644
index 000000000..af1900d64
--- /dev/null
+++ b/docs/examples/f8525c2460a577edfef156c13f55b8a7.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/histogram-aggregation.asciidoc:201
+
+[source, python]
+----
+resp = client.search(
+ index="sales",
+ size="0",
+ query={
+ "constant_score": {
+ "filter": {
+ "range": {
+ "price": {
+ "to": "500"
+ }
+ }
+ }
+ }
+ },
+ aggs={
+ "prices": {
+ "histogram": {
+ "field": "price",
+ "interval": 50,
+ "hard_bounds": {
+ "min": 100,
+ "max": 200
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f8651356ce2e7e93fa306c30f57ed588.asciidoc b/docs/examples/f8651356ce2e7e93fa306c30f57ed588.asciidoc
new file mode 100644
index 000000000..b58e47ae1
--- /dev/null
+++ b/docs/examples/f8651356ce2e7e93fa306c30f57ed588.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/truncate-tokenfilter.asciidoc:93
+
+[source, python]
+----
+resp = client.indices.create(
+ index="custom_truncate_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "standard_truncate": {
+ "tokenizer": "standard",
+ "filter": [
+ "truncate"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f8833488041f3d318435b60917fa877c.asciidoc b/docs/examples/f8833488041f3d318435b60917fa877c.asciidoc
new file mode 100644
index 000000000..f2998bd9c
--- /dev/null
+++ b/docs/examples/f8833488041f3d318435b60917fa877c.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-overview.asciidoc:98
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my_search_application",
+ search_application={
+ "indices": [
+ "my_search_index1",
+ "my_search_index2"
+ ],
+ "template": {
+ "script": {
+ "source": {
+ "query": {
+ "query_string": {
+ "query": "{{query_string}}",
+ "default_field": "{{default_field}}"
+ }
+ }
+ },
+ "params": {
+ "query_string": "*",
+ "default_field": "*"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f8a0010753b1ff563dc42d703902d2fa.asciidoc b/docs/examples/f8a0010753b1ff563dc42d703902d2fa.asciidoc
index 59cc902c7..fb0ec2cb8 100644
--- a/docs/examples/f8a0010753b1ff563dc42d703902d2fa.asciidoc
+++ b/docs/examples/f8a0010753b1ff563dc42d703902d2fa.asciidoc
@@ -1,23 +1,45 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/bool-query.asciidoc:36
[source, python]
----
resp = client.search(
- body={
- "query": {
- "bool": {
- "must": {"term": {"user.id": "kimchy"}},
- "filter": {"term": {"tags": "production"}},
- "must_not": {"range": {"age": {"gte": 10, "lte": 20}}},
- "should": [
- {"term": {"tags": "env1"}},
- {"term": {"tags": "deployed"}},
- ],
- "minimum_should_match": 1,
- "boost": 1,
- }
+ query={
+ "bool": {
+ "must": {
+ "term": {
+ "user.id": "kimchy"
+ }
+ },
+ "filter": {
+ "term": {
+ "tags": "production"
+ }
+ },
+ "must_not": {
+ "range": {
+ "age": {
+ "gte": 10,
+ "lte": 20
+ }
+ }
+ },
+ "should": [
+ {
+ "term": {
+ "tags": "env1"
+ }
+ },
+ {
+ "term": {
+ "tags": "deployed"
+ }
+ }
+ ],
+ "minimum_should_match": 1,
+ "boost": 1
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f8cafb1a08bc9b2dd5239f99d4e93f4c.asciidoc b/docs/examples/f8cafb1a08bc9b2dd5239f99d4e93f4c.asciidoc
new file mode 100644
index 000000000..59f31deab
--- /dev/null
+++ b/docs/examples/f8cafb1a08bc9b2dd5239f99d4e93f4c.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenizers/chargroup-tokenizer.asciidoc:33
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer={
+ "type": "char_group",
+ "tokenize_on_chars": [
+ "whitespace",
+ "-",
+ "\n"
+ ]
+ },
+ text="The QUICK brown-fox",
+)
+print(resp)
+----
diff --git a/docs/examples/f8cb1a04c2e487ff006b5ae0e1a7afbd.asciidoc b/docs/examples/f8cb1a04c2e487ff006b5ae0e1a7afbd.asciidoc
new file mode 100644
index 000000000..f6c6cbba9
--- /dev/null
+++ b/docs/examples/f8cb1a04c2e487ff006b5ae0e1a7afbd.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/apis/rollup-caps.asciidoc:172
+
+[source, python]
+----
+resp = client.rollup.get_rollup_caps(
+ id="sensor-1",
+)
+print(resp)
+----
diff --git a/docs/examples/f92d2f5018a8843ffbb56ade15f84406.asciidoc b/docs/examples/f92d2f5018a8843ffbb56ade15f84406.asciidoc
new file mode 100644
index 000000000..148bc6c38
--- /dev/null
+++ b/docs/examples/f92d2f5018a8843ffbb56ade15f84406.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// licensing/get-basic-status.asciidoc:35
+
+[source, python]
+----
+resp = client.license.get_basic_status()
+print(resp)
+----
diff --git a/docs/examples/f96d4614f2fc294339fef325b794355f.asciidoc b/docs/examples/f96d4614f2fc294339fef325b794355f.asciidoc
new file mode 100644
index 000000000..a10bf05e0
--- /dev/null
+++ b/docs/examples/f96d4614f2fc294339fef325b794355f.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/get-bucket.asciidoc:202
+
+[source, python]
+----
+resp = client.ml.get_buckets(
+ job_id="low_request_rate",
+ anomaly_score=80,
+ start="1454530200001",
+)
+print(resp)
+----
diff --git a/docs/examples/f96d8131e8a592fbf6dfd686173940a9.asciidoc b/docs/examples/f96d8131e8a592fbf6dfd686173940a9.asciidoc
new file mode 100644
index 000000000..edb0c9a7b
--- /dev/null
+++ b/docs/examples/f96d8131e8a592fbf6dfd686173940a9.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/watcher/update-settings.asciidoc:16
+
+[source, python]
+----
+resp = client.watcher.put_watch(
+ id="test_watch",
+ trigger={
+ "schedule": {
+ "hourly": {
+ "minute": [
+ 0,
+ 5
+ ]
+ }
+ }
+ },
+ input={
+ "simple": {
+ "payload": {
+ "send": "yes"
+ }
+ }
+ },
+ condition={
+ "always": {}
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f9732ce07960134ea7156e118c2da8a6.asciidoc b/docs/examples/f9732ce07960134ea7156e118c2da8a6.asciidoc
new file mode 100644
index 000000000..dd5fca1f6
--- /dev/null
+++ b/docs/examples/f9732ce07960134ea7156e118c2da8a6.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/analyzers/simple-analyzer.asciidoc:134
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index-000001",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "my_custom_simple_analyzer": {
+ "tokenizer": "lowercase",
+ "filter": []
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f978088f5117d4addd55c11ee3777312.asciidoc b/docs/examples/f978088f5117d4addd55c11ee3777312.asciidoc
new file mode 100644
index 000000000..7739d7a40
--- /dev/null
+++ b/docs/examples/f978088f5117d4addd55c11ee3777312.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/get-service-credentials.asciidoc:51
+
+[source, python]
+----
+resp = client.security.create_service_token(
+ namespace="elastic",
+ service="fleet-server",
+ name="token1",
+)
+print(resp)
+----
diff --git a/docs/examples/f97aa2efabbf11a534073041eb2658c9.asciidoc b/docs/examples/f97aa2efabbf11a534073041eb2658c9.asciidoc
new file mode 100644
index 000000000..915d3739b
--- /dev/null
+++ b/docs/examples/f97aa2efabbf11a534073041eb2658c9.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/apis/delete-stored-script-api.asciidoc:24
+
+[source, python]
+----
+resp = client.delete_script(
+ id="my-stored-script",
+)
+print(resp)
+----
diff --git a/docs/examples/f98687271e1bec031cc34d05d8f4b60b.asciidoc b/docs/examples/f98687271e1bec031cc34d05d8f4b60b.asciidoc
new file mode 100644
index 000000000..d425159ac
--- /dev/null
+++ b/docs/examples/f98687271e1bec031cc34d05d8f4b60b.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/span-multi-term-query.asciidoc:12
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "span_multi": {
+ "match": {
+ "prefix": {
+ "user.id": {
+ "value": "ki"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/f9a315ea99bed0cf2f36be1d74eb3e4a.asciidoc b/docs/examples/f9a315ea99bed0cf2f36be1d74eb3e4a.asciidoc
index 11bd78c61..4d9ac9c06 100644
--- a/docs/examples/f9a315ea99bed0cf2f36be1d74eb3e4a.asciidoc
+++ b/docs/examples/f9a315ea99bed0cf2f36be1d74eb3e4a.asciidoc
@@ -1,12 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:408
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": "MULTIPOLYGON (((102.0 2.0, 103.0 2.0, 103.0 3.0, 102.0 3.0, 102.0 2.0)), ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0), (100.2 0.2, 100.8 0.2, 100.8 0.8, 100.2 0.8, 100.2 0.2)))"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f9c8245cc13770dff052b6759a749efa.asciidoc b/docs/examples/f9c8245cc13770dff052b6759a749efa.asciidoc
index a9e222c93..c8e370454 100644
--- a/docs/examples/f9c8245cc13770dff052b6759a749efa.asciidoc
+++ b/docs/examples/f9c8245cc13770dff052b6759a749efa.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/get.asciidoc:288
[source, python]
@@ -7,4 +8,4 @@ resp = client.get_source(
id="1",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f9cb2547ab04461a12bfd25a35be5f96.asciidoc b/docs/examples/f9cb2547ab04461a12bfd25a35be5f96.asciidoc
index 2acd20322..ebf203e52 100644
--- a/docs/examples/f9cb2547ab04461a12bfd25a35be5f96.asciidoc
+++ b/docs/examples/f9cb2547ab04461a12bfd25a35be5f96.asciidoc
@@ -1,27 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/range.asciidoc:429
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"my_range": {"type": "date_range"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "my_range": {
+ "type": "date_range"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={
+ document={
"my_range": [
- {"gte": 1504224000000, "lte": 1504569600000},
- {"gte": "2017-09-01", "lte": "2017-09-10"},
+ {
+ "gte": 1504224000000,
+ "lte": 1504569600000
+ },
+ {
+ "gte": "2017-09-01",
+ "lte": "2017-09-10"
+ }
]
},
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/f9ee5d55a73f4c1fe7d507609047aefd.asciidoc b/docs/examples/f9ee5d55a73f4c1fe7d507609047aefd.asciidoc
index 63aa9fabf..d74dee4b3 100644
--- a/docs/examples/f9ee5d55a73f4c1fe7d507609047aefd.asciidoc
+++ b/docs/examples/f9ee5d55a73f4c1fe7d507609047aefd.asciidoc
@@ -1,22 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/search-as-you-type.asciidoc:87
[source, python]
----
resp = client.search(
index="my-index-000001",
- body={
- "query": {
- "multi_match": {
- "query": "brown f",
- "type": "bool_prefix",
- "fields": [
- "my_field",
- "my_field._2gram",
- "my_field._3gram",
- ],
- }
+ query={
+ "multi_match": {
+ "query": "brown f",
+ "type": "bool_prefix",
+ "fields": [
+ "my_field",
+ "my_field._2gram",
+ "my_field._3gram"
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/f9f541ae23a184301913f07e62d1afd3.asciidoc b/docs/examples/f9f541ae23a184301913f07e62d1afd3.asciidoc
new file mode 100644
index 000000000..085c089eb
--- /dev/null
+++ b/docs/examples/f9f541ae23a184301913f07e62d1afd3.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// sql/endpoints/rest.asciidoc:657
+
+[source, python]
+----
+resp = client.sql.query(
+ format="json",
+ keep_alive="2d",
+ wait_for_completion_timeout="2s",
+ query="SELECT * FROM library ORDER BY page_count DESC",
+ fetch_size=5,
+)
+print(resp)
+----
diff --git a/docs/examples/fa42ae3bf6a300420cd0f77ba006458a.asciidoc b/docs/examples/fa42ae3bf6a300420cd0f77ba006458a.asciidoc
new file mode 100644
index 000000000..a66e5fe3d
--- /dev/null
+++ b/docs/examples/fa42ae3bf6a300420cd0f77ba006458a.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:11
+
+[source, python]
+----
+resp = client.indices.analyze(
+ analyzer="standard",
+ text="Quick Brown Foxes!",
+)
+print(resp)
+----
diff --git a/docs/examples/fa5dcd1c7fadc473a791daf0d7ceec36.asciidoc b/docs/examples/fa5dcd1c7fadc473a791daf0d7ceec36.asciidoc
new file mode 100644
index 000000000..4ab534972
--- /dev/null
+++ b/docs/examples/fa5dcd1c7fadc473a791daf0d7ceec36.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/metrics/geoline-aggregation.asciidoc:318
+
+[source, python]
+----
+resp = client.search(
+ index="tour",
+ filter_path="aggregations",
+ aggregations={
+ "path": {
+ "time_series": {},
+ "aggregations": {
+ "museum_tour": {
+ "geo_line": {
+ "point": {
+ "field": "location"
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fa61e3481b1f889b3bd4253866bb1c6b.asciidoc b/docs/examples/fa61e3481b1f889b3bd4253866bb1c6b.asciidoc
new file mode 100644
index 000000000..991f48c5e
--- /dev/null
+++ b/docs/examples/fa61e3481b1f889b3bd4253866bb1c6b.asciidoc
@@ -0,0 +1,96 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/bucket-correlation-aggregation.asciidoc:103
+
+[source, python]
+----
+resp = client.search(
+ index="correlate_latency",
+ size="0",
+ filter_path="aggregations",
+ aggs={
+ "buckets": {
+ "terms": {
+ "field": "version",
+ "size": 2
+ },
+ "aggs": {
+ "latency_ranges": {
+ "range": {
+ "field": "latency",
+ "ranges": [
+ {
+ "to": 0
+ },
+ {
+ "from": 0,
+ "to": 105
+ },
+ {
+ "from": 105,
+ "to": 225
+ },
+ {
+ "from": 225,
+ "to": 445
+ },
+ {
+ "from": 445,
+ "to": 665
+ },
+ {
+ "from": 665,
+ "to": 885
+ },
+ {
+ "from": 885,
+ "to": 1115
+ },
+ {
+ "from": 1115,
+ "to": 1335
+ },
+ {
+ "from": 1335,
+ "to": 1555
+ },
+ {
+ "from": 1555,
+ "to": 1775
+ },
+ {
+ "from": 1775
+ }
+ ]
+ }
+ },
+ "bucket_correlation": {
+ "bucket_correlation": {
+ "buckets_path": "latency_ranges>_count",
+ "function": {
+ "count_correlation": {
+ "indicator": {
+ "expectations": [
+ 0,
+ 52.5,
+ 165,
+ 335,
+ 555,
+ 775,
+ 1000,
+ 1225,
+ 1445,
+ 1665,
+ 1775
+ ],
+ "doc_count": 200
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fa82d86a046d67366cfe9ce65535e433.asciidoc b/docs/examples/fa82d86a046d67366cfe9ce65535e433.asciidoc
new file mode 100644
index 000000000..3dd87952c
--- /dev/null
+++ b/docs/examples/fa82d86a046d67366cfe9ce65535e433.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// graph/explore.asciidoc:396
+
+[source, python]
+----
+resp = client.graph.explore(
+ index="clicklogs",
+ vertices=[
+ {
+ "field": "product",
+ "include": [
+ "1854873"
+ ]
+ }
+ ],
+ connections={
+ "vertices": [
+ {
+ "field": "query.raw",
+ "exclude": [
+ "midi keyboard",
+ "midi",
+ "synth"
+ ]
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fa88f6f5a7d728ec4f1d05244228cb09.asciidoc b/docs/examples/fa88f6f5a7d728ec4f1d05244228cb09.asciidoc
index 29f978b0e..792d64f6f 100644
--- a/docs/examples/fa88f6f5a7d728ec4f1d05244228cb09.asciidoc
+++ b/docs/examples/fa88f6f5a7d728ec4f1d05244228cb09.asciidoc
@@ -1,16 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/bool-query.asciidoc:107
[source, python]
----
resp = client.search(
- body={
- "query": {
- "bool": {
- "must": {"match_all": {}},
- "filter": {"term": {"status": "active"}},
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "term": {
+ "status": "active"
+ }
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/fa946228e946da256d40264c8b070a1a.asciidoc b/docs/examples/fa946228e946da256d40264c8b070a1a.asciidoc
new file mode 100644
index 000000000..73aedbbdb
--- /dev/null
+++ b/docs/examples/fa946228e946da256d40264c8b070a1a.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations.asciidoc:241
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ aggs={
+ "my-agg-name": {
+ "terms": {
+ "field": "my-field"
+ },
+ "meta": {
+ "my-metadata-field": "foo"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fa9a3ef94470f3d9bd6500b65bf993d1.asciidoc b/docs/examples/fa9a3ef94470f3d9bd6500b65bf993d1.asciidoc
new file mode 100644
index 000000000..b68a663de
--- /dev/null
+++ b/docs/examples/fa9a3ef94470f3d9bd6500b65bf993d1.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/multiplexer-tokenfilter.asciidoc:61
+
+[source, python]
+----
+resp = client.indices.analyze(
+ index="multiplexer_example",
+ analyzer="my_analyzer",
+ text="Going HOME",
+)
+print(resp)
+----
diff --git a/docs/examples/fab4b811ba968aa4df92fb1ac059ea31.asciidoc b/docs/examples/fab4b811ba968aa4df92fb1ac059ea31.asciidoc
index 89c323c6f..de543694a 100644
--- a/docs/examples/fab4b811ba968aa4df92fb1ac059ea31.asciidoc
+++ b/docs/examples/fab4b811ba968aa4df92fb1ac059ea31.asciidoc
@@ -1,10 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/geo-shape.asciidoc:107
[source, python]
----
resp = client.indices.create(
index="example",
- body={"mappings": {"properties": {"location": {"type": "geo_shape"}}}},
+ mappings={
+ "properties": {
+ "location": {
+ "type": "geo_shape"
+ }
+ }
+ },
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/fab702851e90e945c1b62dec0bb6a205.asciidoc b/docs/examples/fab702851e90e945c1b62dec0bb6a205.asciidoc
new file mode 100644
index 000000000..59c475fc3
--- /dev/null
+++ b/docs/examples/fab702851e90e945c1b62dec0bb6a205.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// behavioral-analytics/apis/delete-analytics-collection.asciidoc:53
+
+[source, python]
+----
+resp = client.search_application.delete_behavioral_analytics(
+ name="my_analytics_collection",
+)
+print(resp)
+----
diff --git a/docs/examples/fabe14480624a99e8ee42c7338672058.asciidoc b/docs/examples/fabe14480624a99e8ee42c7338672058.asciidoc
index 3b557b431..82b6a2045 100644
--- a/docs/examples/fabe14480624a99e8ee42c7338672058.asciidoc
+++ b/docs/examples/fabe14480624a99e8ee42c7338672058.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// indices/create-index.asciidoc:264
[source, python]
@@ -7,4 +8,4 @@ resp = client.indices.create(
wait_for_active_shards="2",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/fad26f4fb5a1bc9c38db33394e877d94.asciidoc b/docs/examples/fad26f4fb5a1bc9c38db33394e877d94.asciidoc
new file mode 100644
index 000000000..3abe7941d
--- /dev/null
+++ b/docs/examples/fad26f4fb5a1bc9c38db33394e877d94.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/df-analytics/apis/get-dfanalytics-stats.asciidoc:533
+
+[source, python]
+----
+resp = client.ml.get_data_frame_analytics_stats(
+ id="weblog-outliers",
+)
+print(resp)
+----
diff --git a/docs/examples/fad524db23eb5718ff310956e590b00d.asciidoc b/docs/examples/fad524db23eb5718ff310956e590b00d.asciidoc
index 02fee7e2b..ae20d0a58 100644
--- a/docs/examples/fad524db23eb5718ff310956e590b00d.asciidoc
+++ b/docs/examples/fad524db23eb5718ff310956e590b00d.asciidoc
@@ -1,15 +1,17 @@
+// This file is autogenerated, DO NOT EDIT
// query-dsl/function-score-query.asciidoc:241
[source, python]
----
resp = client.search(
- body={
- "query": {
- "function_score": {
- "random_score": {"seed": 10, "field": "_seq_no"}
+ query={
+ "function_score": {
+ "random_score": {
+ "seed": 10,
+ "field": "_seq_no"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/faf7d8b9827cf5c0db5c177f01dc31c4.asciidoc b/docs/examples/faf7d8b9827cf5c0db5c177f01dc31c4.asciidoc
new file mode 100644
index 000000000..1015d6895
--- /dev/null
+++ b/docs/examples/faf7d8b9827cf5c0db5c177f01dc31c4.asciidoc
@@ -0,0 +1,28 @@
+// This file is autogenerated, DO NOT EDIT
+// search/rank-eval.asciidoc:257
+
+[source, python]
+----
+resp = client.rank_eval(
+ index="my-index-000001",
+ requests=[
+ {
+ "id": "JFK query",
+ "request": {
+ "query": {
+ "match_all": {}
+ }
+ },
+ "ratings": []
+ }
+ ],
+ metric={
+ "precision": {
+ "k": 20,
+ "relevant_rating_threshold": 1,
+ "ignore_unlabeled": False
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fb1180992b2087dfb36576b44c4261e4.asciidoc b/docs/examples/fb1180992b2087dfb36576b44c4261e4.asciidoc
new file mode 100644
index 000000000..45d5472c7
--- /dev/null
+++ b/docs/examples/fb1180992b2087dfb36576b44c4261e4.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/change-mappings-and-settings.asciidoc:249
+
+[source, python]
+----
+resp = client.indices.put_mapping(
+ index="my-data-stream",
+ write_index_only=True,
+ properties={
+ "host": {
+ "properties": {
+ "ip": {
+ "type": "ip",
+ "ignore_malformed": True
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fb1263cfdcbb6a89b20b57004d7e0dfc.asciidoc b/docs/examples/fb1263cfdcbb6a89b20b57004d7e0dfc.asciidoc
new file mode 100644
index 000000000..adbebcef2
--- /dev/null
+++ b/docs/examples/fb1263cfdcbb6a89b20b57004d7e0dfc.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/set.asciidoc:96
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "processors": [
+ {
+ "set": {
+ "field": "my_field",
+ "value": "{{{input_field.1}}}"
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_index": "index",
+ "_id": "id",
+ "_source": {
+ "input_field": [
+ "Ubuntu",
+ "Windows",
+ "Ventura"
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/fb2b91206cfa8b86b4c7117ac1b5193b.asciidoc b/docs/examples/fb2b91206cfa8b86b4c7117ac1b5193b.asciidoc
new file mode 100644
index 000000000..beaad087a
--- /dev/null
+++ b/docs/examples/fb2b91206cfa8b86b4c7117ac1b5193b.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/pipeline/cumulative-cardinality-aggregation.asciidoc:145
+
+[source, python]
+----
+resp = client.search(
+ index="user_hits",
+ size=0,
+ aggs={
+ "users_per_day": {
+ "date_histogram": {
+ "field": "timestamp",
+ "calendar_interval": "day"
+ },
+ "aggs": {
+ "distinct_users": {
+ "cardinality": {
+ "field": "user_id"
+ }
+ },
+ "total_new_users": {
+ "cumulative_cardinality": {
+ "buckets_path": "distinct_users"
+ }
+ },
+ "incremental_new_users": {
+ "derivative": {
+ "buckets_path": "total_new_users"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fb3505d976283fb7c7b9705a761e0dc2.asciidoc b/docs/examples/fb3505d976283fb7c7b9705a761e0dc2.asciidoc
index 86be61a24..8d7a3d015 100644
--- a/docs/examples/fb3505d976283fb7c7b9705a761e0dc2.asciidoc
+++ b/docs/examples/fb3505d976283fb7c7b9705a761e0dc2.asciidoc
@@ -1,24 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:264
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "polygon",
"orientation": "clockwise",
"coordinates": [
[
- [1000, 1000],
- [1000, 1001],
- [1001, 1001],
- [1001, 1000],
- [1000, 1000],
+ [
+ 1000,
+ 1000
+ ],
+ [
+ 1000,
+ 1001
+ ],
+ [
+ 1001,
+ 1001
+ ],
+ [
+ 1001,
+ 1000
+ ],
+ [
+ 1000,
+ 1000
+ ]
]
- ],
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/fb4799d2fe4011bf6084f89d97d9a4a5.asciidoc b/docs/examples/fb4799d2fe4011bf6084f89d97d9a4a5.asciidoc
new file mode 100644
index 000000000..4e9fedc99
--- /dev/null
+++ b/docs/examples/fb4799d2fe4011bf6084f89d97d9a4a5.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// autoscaling/apis/get-autoscaling-policy.asciidoc:40
+
+[source, python]
+----
+resp = client.autoscaling.get_autoscaling_policy(
+ name="",
+)
+print(resp)
+----
diff --git a/docs/examples/fb955375a202f66133af009c04cb77ad.asciidoc b/docs/examples/fb955375a202f66133af009c04cb77ad.asciidoc
new file mode 100644
index 000000000..0d76cacfc
--- /dev/null
+++ b/docs/examples/fb955375a202f66133af009c04cb77ad.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/range-enrich-policy-type-ex.asciidoc:17
+
+[source, python]
+----
+resp = client.indices.create(
+ index="networks",
+ mappings={
+ "properties": {
+ "range": {
+ "type": "ip_range"
+ },
+ "name": {
+ "type": "keyword"
+ },
+ "department": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fbb38243221c8fb311660616e3add9ce.asciidoc b/docs/examples/fbb38243221c8fb311660616e3add9ce.asciidoc
new file mode 100644
index 000000000..f3511fb9a
--- /dev/null
+++ b/docs/examples/fbb38243221c8fb311660616e3add9ce.asciidoc
@@ -0,0 +1,29 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:418
+
+[source, python]
+----
+resp = client.search(
+ sort=[
+ {
+ "_geo_distance": {
+ "pin.location": [
+ -70,
+ 40
+ ],
+ "order": "asc",
+ "unit": "km",
+ "mode": "min",
+ "distance_type": "arc",
+ "ignore_unmapped": True
+ }
+ }
+ ],
+ query={
+ "term": {
+ "user": "kimchy"
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fbc5ab85b908480bf944b55da0a43488.asciidoc b/docs/examples/fbc5ab85b908480bf944b55da0a43488.asciidoc
new file mode 100644
index 000000000..9356927d1
--- /dev/null
+++ b/docs/examples/fbc5ab85b908480bf944b55da0a43488.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/prefix-query.asciidoc:16
+
+[source, python]
+----
+resp = client.search(
+ query={
+ "prefix": {
+ "user.id": {
+ "value": "ki"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fbdad6620eb645f5f1f02e3673604d01.asciidoc b/docs/examples/fbdad6620eb645f5f1f02e3673604d01.asciidoc
new file mode 100644
index 000000000..c98648183
--- /dev/null
+++ b/docs/examples/fbdad6620eb645f5f1f02e3673604d01.asciidoc
@@ -0,0 +1,23 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/geo-distance-query.asciidoc:236
+
+[source, python]
+----
+resp = client.search(
+ index="my_locations",
+ query={
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "geo_distance": {
+ "distance": "12km",
+ "pin.location": "drm3btev3e86"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fc1907515f6a913884a9f86451e90ee8.asciidoc b/docs/examples/fc1907515f6a913884a9f86451e90ee8.asciidoc
new file mode 100644
index 000000000..543709c8c
--- /dev/null
+++ b/docs/examples/fc1907515f6a913884a9f86451e90ee8.asciidoc
@@ -0,0 +1,25 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/semantic-search-elser.asciidoc:304
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my-index",
+ mappings={
+ "_source": {
+ "excludes": [
+ "content_embedding"
+ ]
+ },
+ "properties": {
+ "content_embedding": {
+ "type": "sparse_vector"
+ },
+ "content": {
+ "type": "text"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fc190fbbf71949331266dcb3f46a1198.asciidoc b/docs/examples/fc190fbbf71949331266dcb3f46a1198.asciidoc
new file mode 100644
index 000000000..0613d1120
--- /dev/null
+++ b/docs/examples/fc190fbbf71949331266dcb3f46a1198.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/data-stream-stats.asciidoc:51
+
+[source, python]
+----
+resp = client.indices.data_streams_stats(
+ name="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/fc26f51bb22c0b5270a66b4722f18aa7.asciidoc b/docs/examples/fc26f51bb22c0b5270a66b4722f18aa7.asciidoc
new file mode 100644
index 000000000..98cc67eca
--- /dev/null
+++ b/docs/examples/fc26f51bb22c0b5270a66b4722f18aa7.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-allocate.asciidoc:60
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "warm": {
+ "actions": {
+ "allocate": {
+ "number_of_replicas": 2,
+ "total_shards_per_node": 200
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fc3f5f40fa283559ca615cd0eb0a1755.asciidoc b/docs/examples/fc3f5f40fa283559ca615cd0eb0a1755.asciidoc
new file mode 100644
index 000000000..5eb8c7e34
--- /dev/null
+++ b/docs/examples/fc3f5f40fa283559ca615cd0eb0a1755.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/doc-count-field.asciidoc:34
+
+[source, python]
+----
+resp = client.indices.create(
+ index="my_index",
+ mappings={
+ "properties": {
+ "my_histogram": {
+ "type": "histogram"
+ },
+ "my_text": {
+ "type": "keyword"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fc49437ce2e7916facf58128308c2aa3.asciidoc b/docs/examples/fc49437ce2e7916facf58128308c2aa3.asciidoc
new file mode 100644
index 000000000..94b2779c6
--- /dev/null
+++ b/docs/examples/fc49437ce2e7916facf58128308c2aa3.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// searchable-snapshots/apis/mount-snapshot.asciidoc:123
+
+[source, python]
+----
+resp = client.searchable_snapshots.mount(
+ repository="my_repository",
+ snapshot="my_snapshot",
+ wait_for_completion=True,
+ index="my_docs",
+ renamed_index="docs",
+ index_settings={
+ "index.number_of_replicas": 0
+ },
+ ignore_index_settings=[
+ "index.refresh_interval"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/fc51fbc60b0e20aac83300a43ad90252.asciidoc b/docs/examples/fc51fbc60b0e20aac83300a43ad90252.asciidoc
index a9c081b8a..ec2094d1a 100644
--- a/docs/examples/fc51fbc60b0e20aac83300a43ad90252.asciidoc
+++ b/docs/examples/fc51fbc60b0e20aac83300a43ad90252.asciidoc
@@ -1,21 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/shape.asciidoc:375
[source, python]
----
resp = client.index(
index="example",
- body={
+ document={
"location": {
"type": "geometrycollection",
"geometries": [
- {"type": "point", "coordinates": [1000, 100]},
{
- "type": "linestring",
- "coordinates": [[1001, 100], [1002, 100]],
+ "type": "point",
+ "coordinates": [
+ 1000,
+ 100
+ ]
},
- ],
+ {
+ "type": "linestring",
+ "coordinates": [
+ [
+ 1001,
+ 100
+ ],
+ [
+ 1002,
+ 100
+ ]
+ ]
+ }
+ ]
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/fc5a81f34d416e4b45ca8a859dd3b8f1.asciidoc b/docs/examples/fc5a81f34d416e4b45ca8a859dd3b8f1.asciidoc
new file mode 100644
index 000000000..deefe836f
--- /dev/null
+++ b/docs/examples/fc5a81f34d416e4b45ca8a859dd3b8f1.asciidoc
@@ -0,0 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/autodatehistogram-aggregation.asciidoc:190
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ size="0",
+ aggs={
+ "by_day": {
+ "auto_date_histogram": {
+ "field": "date",
+ "buckets": 3,
+ "time_zone": "-01:00"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fc75ea748e5f49b8ab292e453ab641a6.asciidoc b/docs/examples/fc75ea748e5f49b8ab292e453ab641a6.asciidoc
new file mode 100644
index 000000000..4231996d1
--- /dev/null
+++ b/docs/examples/fc75ea748e5f49b8ab292e453ab641a6.asciidoc
@@ -0,0 +1,30 @@
+// This file is autogenerated, DO NOT EDIT
+// aggregations/bucket/nested-aggregation.asciidoc:62
+
+[source, python]
+----
+resp = client.search(
+ index="products",
+ size="0",
+ query={
+ "match": {
+ "name": "led tv"
+ }
+ },
+ aggs={
+ "resellers": {
+ "nested": {
+ "path": "resellers"
+ },
+ "aggs": {
+ "min_price": {
+ "min": {
+ "field": "resellers.price"
+ }
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fc8a426f8a5112e61e2acb913982a8d9.asciidoc b/docs/examples/fc8a426f8a5112e61e2acb913982a8d9.asciidoc
index 54e964fc5..c93c449b7 100644
--- a/docs/examples/fc8a426f8a5112e61e2acb913982a8d9.asciidoc
+++ b/docs/examples/fc8a426f8a5112e61e2acb913982a8d9.asciidoc
@@ -1,10 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
// index-modules/index-sorting.asciidoc:137
[source, python]
----
resp = client.search(
index="events",
- body={"size": 10, "sort": [{"timestamp": "desc"}]},
+ size=10,
+ sort=[
+ {
+ "timestamp": "desc"
+ }
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/fc9a1b1173690a911725cff3912e9755.asciidoc b/docs/examples/fc9a1b1173690a911725cff3912e9755.asciidoc
new file mode 100644
index 000000000..141aa6818
--- /dev/null
+++ b/docs/examples/fc9a1b1173690a911725cff3912e9755.asciidoc
@@ -0,0 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
+// ilm/actions/ilm-readonly.asciidoc:22
+
+[source, python]
+----
+resp = client.ilm.put_lifecycle(
+ name="my_policy",
+ policy={
+ "phases": {
+ "warm": {
+ "actions": {
+ "readonly": {}
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fccbddfba9f975de7e321732874dfb78.asciidoc b/docs/examples/fccbddfba9f975de7e321732874dfb78.asciidoc
new file mode 100644
index 000000000..e1106501c
--- /dev/null
+++ b/docs/examples/fccbddfba9f975de7e321732874dfb78.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/data-stream-stats.asciidoc:176
+
+[source, python]
+----
+resp = client.indices.data_streams_stats(
+ name="my-data-stream*",
+ human=True,
+)
+print(resp)
+----
diff --git a/docs/examples/fce5c03a388c893cb11a6696e068543f.asciidoc b/docs/examples/fce5c03a388c893cb11a6696e068543f.asciidoc
new file mode 100644
index 000000000..7417cd3f6
--- /dev/null
+++ b/docs/examples/fce5c03a388c893cb11a6696e068543f.asciidoc
@@ -0,0 +1,53 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/has-privileges-user-profile.asciidoc:98
+
+[source, python]
+----
+resp = client.security.has_privileges_user_profile(
+ uids=[
+ "u_LQPnxDxEjIH0GOUoFkZr5Y57YUwSkL9Joiq-g4OCbPc_0",
+ "u_rzRnxDgEHIH0GOUoFkZr5Y27YUwSk19Joiq=g4OCxxB_1",
+ "u_does-not-exist_0"
+ ],
+ privileges={
+ "cluster": [
+ "monitor",
+ "create_snapshot",
+ "manage_ml"
+ ],
+ "index": [
+ {
+ "names": [
+ "suppliers",
+ "products"
+ ],
+ "privileges": [
+ "create_doc"
+ ]
+ },
+ {
+ "names": [
+ "inventory"
+ ],
+ "privileges": [
+ "read",
+ "write"
+ ]
+ }
+ ],
+ "application": [
+ {
+ "application": "inventory_manager",
+ "privileges": [
+ "read",
+ "data:write/inventory"
+ ],
+ "resources": [
+ "product/1852563"
+ ]
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fce7a35a737fc9e54ac1225e310dd561.asciidoc b/docs/examples/fce7a35a737fc9e54ac1225e310dd561.asciidoc
new file mode 100644
index 000000000..22cc7c714
--- /dev/null
+++ b/docs/examples/fce7a35a737fc9e54ac1225e310dd561.asciidoc
@@ -0,0 +1,33 @@
+// This file is autogenerated, DO NOT EDIT
+// vectors/vector-functions.asciidoc:121
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "script_score": {
+ "query": {
+ "bool": {
+ "filter": {
+ "term": {
+ "status": "published"
+ }
+ }
+ }
+ },
+ "script": {
+ "source": "\n double value = dotProduct(params.query_vector, 'my_dense_vector');\n return sigmoid(1, Math.E, -value); \n ",
+ "params": {
+ "query_vector": [
+ 4,
+ 3.4,
+ -0.2
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fd04289c54493e19c1d3ac70d0b489c4.asciidoc b/docs/examples/fd04289c54493e19c1d3ac70d0b489c4.asciidoc
new file mode 100644
index 000000000..298089b40
--- /dev/null
+++ b/docs/examples/fd04289c54493e19c1d3ac70d0b489c4.asciidoc
@@ -0,0 +1,18 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest.asciidoc:840
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="my-pipeline",
+ processors=[
+ {
+ "drop": {
+ "description": "Drop documents that don't contain 'prod' tag",
+ "if": "\n Collection tags = ctx.tags;\n if(tags != null){\n for (String tag : tags) {\n if (tag.toLowerCase().contains('prod')) {\n return false;\n }\n }\n }\n return true;\n "
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/fd0cd8ecd03468726b59a605eea06d75.asciidoc b/docs/examples/fd0cd8ecd03468726b59a605eea06d75.asciidoc
new file mode 100644
index 000000000..415e038a0
--- /dev/null
+++ b/docs/examples/fd0cd8ecd03468726b59a605eea06d75.asciidoc
@@ -0,0 +1,40 @@
+// This file is autogenerated, DO NOT EDIT
+// query-dsl/rank-feature-query.asciidoc:138
+
+[source, python]
+----
+resp = client.search(
+ index="test",
+ query={
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "content": "2016"
+ }
+ }
+ ],
+ "should": [
+ {
+ "rank_feature": {
+ "field": "pagerank"
+ }
+ },
+ {
+ "rank_feature": {
+ "field": "url_length",
+ "boost": 0.1
+ }
+ },
+ {
+ "rank_feature": {
+ "field": "topics.sports",
+ "boost": 0.4
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fd26bfdbe95b2d2db374385d12849f77.asciidoc b/docs/examples/fd26bfdbe95b2d2db374385d12849f77.asciidoc
new file mode 100644
index 000000000..914974d98
--- /dev/null
+++ b/docs/examples/fd26bfdbe95b2d2db374385d12849f77.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/trim-tokenfilter.asciidoc:99
+
+[source, python]
+----
+resp = client.indices.create(
+ index="trim_example",
+ settings={
+ "analysis": {
+ "analyzer": {
+ "keyword_trim": {
+ "tokenizer": "keyword",
+ "filter": [
+ "trim"
+ ]
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fd2d289e6b725fcc3cbe8fe7ffe02ea0.asciidoc b/docs/examples/fd2d289e6b725fcc3cbe8fe7ffe02ea0.asciidoc
new file mode 100644
index 000000000..7094e18ab
--- /dev/null
+++ b/docs/examples/fd2d289e6b725fcc3cbe8fe7ffe02ea0.asciidoc
@@ -0,0 +1,8 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/get-index-template-v1.asciidoc:97
+
+[source, python]
+----
+resp = client.indices.get_template()
+print(resp)
+----
diff --git a/docs/examples/fd352b472d44d197022a46fce90b6ecb.asciidoc b/docs/examples/fd352b472d44d197022a46fce90b6ecb.asciidoc
new file mode 100644
index 000000000..d52c31f38
--- /dev/null
+++ b/docs/examples/fd352b472d44d197022a46fce90b6ecb.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// docs/multi-get.asciidoc:178
+
+[source, python]
+----
+resp = client.mget(
+ docs=[
+ {
+ "_index": "test",
+ "_id": "1",
+ "_source": False
+ },
+ {
+ "_index": "test",
+ "_id": "2",
+ "_source": [
+ "field3",
+ "field4"
+ ]
+ },
+ {
+ "_index": "test",
+ "_id": "3",
+ "_source": {
+ "include": [
+ "user"
+ ],
+ "exclude": [
+ "user.location"
+ ]
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/fd60b4092c6552164862cec287359676.asciidoc b/docs/examples/fd60b4092c6552164862cec287359676.asciidoc
new file mode 100644
index 000000000..b996a6216
--- /dev/null
+++ b/docs/examples/fd60b4092c6552164862cec287359676.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// ml/anomaly-detection/apis/stop-datafeed.asciidoc:74
+
+[source, python]
+----
+resp = client.ml.stop_datafeed(
+ datafeed_id="datafeed-low_request_rate",
+ timeout="30s",
+)
+print(resp)
+----
diff --git a/docs/examples/fd620f09dbce62c6f0f603a366623607.asciidoc b/docs/examples/fd620f09dbce62c6f0f603a366623607.asciidoc
new file mode 100644
index 000000000..c8d98272a
--- /dev/null
+++ b/docs/examples/fd620f09dbce62c6f0f603a366623607.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// connector/apis/update-connector-filtering-api.asciidoc:149
+
+[source, python]
+----
+resp = client.connector.update_filtering(
+ connector_id="my-sql-connector",
+ advanced_snippet={
+ "value": [
+ {
+ "tables": [
+ "users",
+ "orders"
+ ],
+ "query": "SELECT users.id AS id, orders.order_id AS order_id FROM users JOIN orders ON users.id = orders.user_id"
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fd6fdc8fa994dd02cf1177077325304f.asciidoc b/docs/examples/fd6fdc8fa994dd02cf1177077325304f.asciidoc
new file mode 100644
index 000000000..6fa1d7076
--- /dev/null
+++ b/docs/examples/fd6fdc8fa994dd02cf1177077325304f.asciidoc
@@ -0,0 +1,16 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/troubleshooting/data/restore-from-snapshot.asciidoc:454
+
+[source, python]
+----
+resp = client.snapshot.restore(
+ repository="my_repository",
+ snapshot="snapshot-20200617",
+ feature_states=[
+ "geoip"
+ ],
+ indices="kibana_sample_data_flights,.ds-my-data-stream-2022.06.17-000001",
+ include_aliases=True,
+)
+print(resp)
+----
diff --git a/docs/examples/fd738a9af7b5d21da31a7722f03aade8.asciidoc b/docs/examples/fd738a9af7b5d21da31a7722f03aade8.asciidoc
new file mode 100644
index 000000000..7f8de764b
--- /dev/null
+++ b/docs/examples/fd738a9af7b5d21da31a7722f03aade8.asciidoc
@@ -0,0 +1,13 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/size-your-shards.asciidoc:170
+
+[source, python]
+----
+resp = client.cat.shards(
+ v=True,
+ h="index,prirep,shard,store",
+ s="prirep,store",
+ bytes="gb",
+)
+print(resp)
+----
diff --git a/docs/examples/fd7eeadab6251d9113c4380a7fbe2572.asciidoc b/docs/examples/fd7eeadab6251d9113c4380a7fbe2572.asciidoc
new file mode 100644
index 000000000..e7756bd54
--- /dev/null
+++ b/docs/examples/fd7eeadab6251d9113c4380a7fbe2572.asciidoc
@@ -0,0 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/remote-clusters-privileges-api-key.asciidoc:26
+
+[source, python]
+----
+resp = client.security.put_role(
+ name="remote-replication",
+ cluster=[
+ "manage_ccr"
+ ],
+ remote_indices=[
+ {
+ "clusters": [
+ "my_remote_cluster"
+ ],
+ "names": [
+ "leader-index"
+ ],
+ "privileges": [
+ "cross_cluster_replication"
+ ]
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/fd9b668eeb1f117950bd4991c7c03fb1.asciidoc b/docs/examples/fd9b668eeb1f117950bd4991c7c03fb1.asciidoc
new file mode 100644
index 000000000..8016651a9
--- /dev/null
+++ b/docs/examples/fd9b668eeb1f117950bd4991c7c03fb1.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// indices/analyze.asciidoc:157
+
+[source, python]
+----
+resp = client.indices.analyze(
+ analyzer="standard",
+ text=[
+ "this is a test",
+ "the second text"
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/fdada036a875d7995d5d7aba9c06361e.asciidoc b/docs/examples/fdada036a875d7995d5d7aba9c06361e.asciidoc
index 0401b9146..b2e05b24b 100644
--- a/docs/examples/fdada036a875d7995d5d7aba9c06361e.asciidoc
+++ b/docs/examples/fdada036a875d7995d5d7aba9c06361e.asciidoc
@@ -1,20 +1,19 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/dense-vector.asciidoc:95
[source, python]
----
resp = client.indices.create(
index="my-index-2",
- body={
- "mappings": {
- "properties": {
- "my_vector": {
- "type": "dense_vector",
- "dims": 3,
- "index": False,
- }
+ mappings={
+ "properties": {
+ "my_vector": {
+ "type": "dense_vector",
+ "dims": 3,
+ "index": False
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/fdc8e090293e78e9a6b283650b682517.asciidoc b/docs/examples/fdc8e090293e78e9a6b283650b682517.asciidoc
new file mode 100644
index 000000000..3a6d747f7
--- /dev/null
+++ b/docs/examples/fdc8e090293e78e9a6b283650b682517.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:161
+
+[source, python]
+----
+resp = client.indices.open(
+ index="my-data-stream",
+)
+print(resp)
+----
diff --git a/docs/examples/fde3463ddf136fdfff1306a60986515e.asciidoc b/docs/examples/fde3463ddf136fdfff1306a60986515e.asciidoc
index f0cae9445..a5edaaafc 100644
--- a/docs/examples/fde3463ddf136fdfff1306a60986515e.asciidoc
+++ b/docs/examples/fde3463ddf136fdfff1306a60986515e.asciidoc
@@ -1,11 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
// upgrade/archived-settings.asciidoc:64
[source, python]
----
resp = client.indices.get_settings(
index="*",
- flat_settings="true",
+ flat_settings=True,
filter_path="**.settings.archived*",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/fdf7cfdf1c92d21ee710675596eac6fd.asciidoc b/docs/examples/fdf7cfdf1c92d21ee710675596eac6fd.asciidoc
new file mode 100644
index 000000000..b658b53fa
--- /dev/null
+++ b/docs/examples/fdf7cfdf1c92d21ee710675596eac6fd.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// tab-widgets/semantic-search/hybrid-search.asciidoc:55
+
+[source, python]
+----
+resp = client.search(
+ index="my-index",
+ retriever={
+ "rrf": {
+ "retrievers": [
+ {
+ "standard": {
+ "query": {
+ "match": {
+ "my_text_field": "the query string"
+ }
+ }
+ }
+ },
+ {
+ "knn": {
+ "field": "text_embedding.predicted_value",
+ "k": 10,
+ "num_candidates": 100,
+ "query_vector_builder": {
+ "text_embedding": {
+ "model_id": "sentence-transformers__msmarco-minilm-l-12-v3",
+ "model_text": "the query string"
+ }
+ }
+ }
+ }
+ ]
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fe208d94ec93eabf3bd06139fa70701e.asciidoc b/docs/examples/fe208d94ec93eabf3bd06139fa70701e.asciidoc
new file mode 100644
index 000000000..21882266f
--- /dev/null
+++ b/docs/examples/fe208d94ec93eabf3bd06139fa70701e.asciidoc
@@ -0,0 +1,46 @@
+// This file is autogenerated, DO NOT EDIT
+// rollup/migrating-to-downsampling.asciidoc:58
+
+[source, python]
+----
+resp = client.indices.put_index_template(
+ name="sensor-template",
+ index_patterns=[
+ "sensor-*"
+ ],
+ data_stream={},
+ template={
+ "lifecycle": {
+ "downsampling": [
+ {
+ "after": "1d",
+ "fixed_interval": "1h"
+ }
+ ]
+ },
+ "settings": {
+ "index.mode": "time_series"
+ },
+ "mappings": {
+ "properties": {
+ "node": {
+ "type": "keyword",
+ "time_series_dimension": True
+ },
+ "temperature": {
+ "type": "half_float",
+ "time_series_metric": "gauge"
+ },
+ "voltage": {
+ "type": "half_float",
+ "time_series_metric": "gauge"
+ },
+ "@timestamp": {
+ "type": "date"
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fe3a927d868cbc530e08e05964d5174a.asciidoc b/docs/examples/fe3a927d868cbc530e08e05964d5174a.asciidoc
new file mode 100644
index 000000000..adad0a7f7
--- /dev/null
+++ b/docs/examples/fe3a927d868cbc530e08e05964d5174a.asciidoc
@@ -0,0 +1,36 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/sort-search-results.asciidoc:115
+
+[source, python]
+----
+resp = client.index(
+ index="my-index-000001",
+ id="1",
+ refresh=True,
+ document={
+ "product": "chocolate",
+ "price": [
+ 20,
+ 4
+ ]
+ },
+)
+print(resp)
+
+resp1 = client.search(
+ query={
+ "term": {
+ "product": "chocolate"
+ }
+ },
+ sort=[
+ {
+ "price": {
+ "order": "asc",
+ "mode": "avg"
+ }
+ }
+ ],
+)
+print(resp1)
+----
diff --git a/docs/examples/fe54f3e53dbe7dee40ec3108a461d19a.asciidoc b/docs/examples/fe54f3e53dbe7dee40ec3108a461d19a.asciidoc
new file mode 100644
index 000000000..3b0334fe2
--- /dev/null
+++ b/docs/examples/fe54f3e53dbe7dee40ec3108a461d19a.asciidoc
@@ -0,0 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
+// security/authentication/jwt-realm.asciidoc:522
+
+[source, python]
+----
+resp = client.security.put_role_mapping(
+ name="jwt_user1",
+ refresh=True,
+ roles=[
+ "jwt_role1"
+ ],
+ rules={
+ "all": [
+ {
+ "field": {
+ "realm.name": "jwt2"
+ }
+ },
+ {
+ "field": {
+ "username": "user2"
+ }
+ }
+ ]
+ },
+ enabled=True,
+ metadata={
+ "version": 1
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc b/docs/examples/fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc
index ec76edbd4..f6aaa06b4 100644
--- a/docs/examples/fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc
+++ b/docs/examples/fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc
@@ -1,22 +1,32 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/date.asciidoc:249
[source, python]
----
resp = client.indices.create(
index="idx",
- body={
- "mappings": {
- "_source": {"mode": "synthetic"},
- "properties": {"date": {"type": "date"}},
+ mappings={
+ "_source": {
+ "mode": "synthetic"
+ },
+ "properties": {
+ "date": {
+ "type": "date"
+ }
}
},
)
print(resp)
-resp = client.index(
+resp1 = client.index(
index="idx",
id="1",
- body={"date": ["2015-01-01T12:10:30Z", "2014-01-01T12:10:30Z"]},
+ document={
+ "date": [
+ "2015-01-01T12:10:30Z",
+ "2014-01-01T12:10:30Z"
+ ]
+ },
)
-print(resp)
-----
\ No newline at end of file
+print(resp1)
+----
diff --git a/docs/examples/fe6e35839f7d7381f8ec535c8f21959b.asciidoc b/docs/examples/fe6e35839f7d7381f8ec535c8f21959b.asciidoc
new file mode 100644
index 000000000..6eb08b8f0
--- /dev/null
+++ b/docs/examples/fe6e35839f7d7381f8ec535c8f21959b.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// how-to/recipes/scoring.asciidoc:123
+
+[source, python]
+----
+resp = client.search(
+ index="index",
+ query={
+ "script_score": {
+ "query": {
+ "match": {
+ "body": "elasticsearch"
+ }
+ },
+ "script": {
+ "source": "_score * saturation(doc['pagerank'].value, 10)"
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fe7169bab8e626f582c9ea87585d0f35.asciidoc b/docs/examples/fe7169bab8e626f582c9ea87585d0f35.asciidoc
index 1c69a70f7..311ac7917 100644
--- a/docs/examples/fe7169bab8e626f582c9ea87585d0f35.asciidoc
+++ b/docs/examples/fe7169bab8e626f582c9ea87585d0f35.asciidoc
@@ -1,17 +1,20 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/types/histogram.asciidoc:98
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "my_histogram": {"type": "histogram"},
- "my_text": {"type": "keyword"},
+ mappings={
+ "properties": {
+ "my_histogram": {
+ "type": "histogram"
+ },
+ "my_text": {
+ "type": "keyword"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/fe806011466e7cdc1590da186297edb6.asciidoc b/docs/examples/fe806011466e7cdc1590da186297edb6.asciidoc
index a01ae87e3..31d95a5f2 100644
--- a/docs/examples/fe806011466e7cdc1590da186297edb6.asciidoc
+++ b/docs/examples/fe806011466e7cdc1590da186297edb6.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// api-conventions.asciidoc:119
[source, python]
@@ -6,4 +7,4 @@ resp = client.indices.create(
index="",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/fe825c05e13e8163073166572c7ac97d.asciidoc b/docs/examples/fe825c05e13e8163073166572c7ac97d.asciidoc
new file mode 100644
index 000000000..51218bd21
--- /dev/null
+++ b/docs/examples/fe825c05e13e8163073166572c7ac97d.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/geo-grid.asciidoc:199
+
+[source, python]
+----
+resp = client.index(
+ index="geocells",
+ id="1",
+ pipeline="geohex2shape",
+ document={
+ "geocell": "811fbffffffffff"
+ },
+)
+print(resp)
+
+resp1 = client.get(
+ index="geocells",
+ id="1",
+)
+print(resp1)
+----
diff --git a/docs/examples/fe8c3e2632f5057bfbd1898a8fe4d0d2.asciidoc b/docs/examples/fe8c3e2632f5057bfbd1898a8fe4d0d2.asciidoc
new file mode 100644
index 000000000..d99fc7720
--- /dev/null
+++ b/docs/examples/fe8c3e2632f5057bfbd1898a8fe4d0d2.asciidoc
@@ -0,0 +1,38 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-application-api.asciidoc:325
+
+[source, python]
+----
+resp = client.search_application.put(
+ name="my_search_application",
+ search_application={
+ "indices": [
+ "index1",
+ "index2"
+ ],
+ "template": {
+ "script": {
+ "lang": "mustache",
+ "source": "\n {\n \"query\": {\n \"multi_match\": {\n \"query\": \"{{query_string}}\",\n \"fields\": [{{#text_fields}}\"{{name}}^{{boost}}\",{{/text_fields}}]\n }\n },\n \"explain\": \"{{explain}}\",\n \"from\": \"{{from}}\",\n \"size\": \"{{size}}\"\n }\n ",
+ "params": {
+ "query_string": "*",
+ "text_fields": [
+ {
+ "name": "title",
+ "boost": 10
+ },
+ {
+ "name": "description",
+ "boost": 5
+ }
+ ],
+ "explain": False,
+ "from": 0,
+ "size": 10
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/fe96ca3b2a559d8411aca7ed5f3854bd.asciidoc b/docs/examples/fe96ca3b2a559d8411aca7ed5f3854bd.asciidoc
new file mode 100644
index 000000000..b451d4b43
--- /dev/null
+++ b/docs/examples/fe96ca3b2a559d8411aca7ed5f3854bd.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/common-options.asciidoc:229
+
+[source, python]
+----
+resp = client.indices.get_settings(
+ index="my-index-000001",
+ flat_settings=True,
+)
+print(resp)
+----
diff --git a/docs/examples/febb71d774e0a1fc67454213d7448c53.asciidoc b/docs/examples/febb71d774e0a1fc67454213d7448c53.asciidoc
new file mode 100644
index 000000000..f7d66a12b
--- /dev/null
+++ b/docs/examples/febb71d774e0a1fc67454213d7448c53.asciidoc
@@ -0,0 +1,12 @@
+// This file is autogenerated, DO NOT EDIT
+// scripting/using.asciidoc:362
+
+[source, python]
+----
+resp = client.update(
+ index="my-index-000001",
+ id="1",
+ script="ctx._source.remove('new_field')",
+)
+print(resp)
+----
diff --git a/docs/examples/fece7c0fe1f7d113aa05ff5346a18aff.asciidoc b/docs/examples/fece7c0fe1f7d113aa05ff5346a18aff.asciidoc
new file mode 100644
index 000000000..7471680a0
--- /dev/null
+++ b/docs/examples/fece7c0fe1f7d113aa05ff5346a18aff.asciidoc
@@ -0,0 +1,43 @@
+// This file is autogenerated, DO NOT EDIT
+// data-streams/use-a-data-stream.asciidoc:81
+
+[source, python]
+----
+resp = client.bulk(
+ index="my-data-stream",
+ refresh=True,
+ operations=[
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2099-03-08T11:04:05.000Z",
+ "user": {
+ "id": "vlb44hny"
+ },
+ "message": "Login attempt failed"
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2099-03-08T11:06:07.000Z",
+ "user": {
+ "id": "8a4f500d"
+ },
+ "message": "Login successful"
+ },
+ {
+ "create": {}
+ },
+ {
+ "@timestamp": "2099-03-09T11:07:08.000Z",
+ "user": {
+ "id": "l7gk7f82"
+ },
+ "message": "Logout successful"
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/feda4b996ea7004f8b2c5f5007fb717b.asciidoc b/docs/examples/feda4b996ea7004f8b2c5f5007fb717b.asciidoc
new file mode 100644
index 000000000..3557e85c5
--- /dev/null
+++ b/docs/examples/feda4b996ea7004f8b2c5f5007fb717b.asciidoc
@@ -0,0 +1,21 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/range-enrich-policy-type-ex.asciidoc:91
+
+[source, python]
+----
+resp = client.ingest.put_pipeline(
+ id="networks_lookup",
+ processors=[
+ {
+ "enrich": {
+ "description": "Add 'network' data based on 'ip'",
+ "policy_name": "networks-policy",
+ "field": "ip",
+ "target_field": "network",
+ "max_matches": "10"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/fef520cbc9b0656e6aac7b3dd3da9984.asciidoc b/docs/examples/fef520cbc9b0656e6aac7b3dd3da9984.asciidoc
new file mode 100644
index 000000000..eb3a21c25
--- /dev/null
+++ b/docs/examples/fef520cbc9b0656e6aac7b3dd3da9984.asciidoc
@@ -0,0 +1,11 @@
+// This file is autogenerated, DO NOT EDIT
+// eql/eql.asciidoc:789
+
+[source, python]
+----
+resp = client.eql.search(
+ index="my-index*",
+ query="\n sample by host\n [any where uptime > 0] by os\n [any where port > 100] by op_sys\n [any where bool == true] by os\n ",
+)
+print(resp)
+----
diff --git a/docs/examples/ff05842419968a2141bde0371ac2f6f4.asciidoc b/docs/examples/ff05842419968a2141bde0371ac2f6f4.asciidoc
new file mode 100644
index 000000000..4eaaf245b
--- /dev/null
+++ b/docs/examples/ff05842419968a2141bde0371ac2f6f4.asciidoc
@@ -0,0 +1,22 @@
+// This file is autogenerated, DO NOT EDIT
+// search/search-your-data/search-template.asciidoc:320
+
+[source, python]
+----
+resp = client.render_search_template(
+ source={
+ "query": {
+ "match": {
+ "user.group.emails": "{{#join}}emails{{/join}}"
+ }
+ }
+ },
+ params={
+ "emails": [
+ "user1@example.com",
+ "user_one@example.com"
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ff09e13391cecb2e8b9dd440b37e065f.asciidoc b/docs/examples/ff09e13391cecb2e8b9dd440b37e065f.asciidoc
index c62f8d3bf..e6498693e 100644
--- a/docs/examples/ff09e13391cecb2e8b9dd440b37e065f.asciidoc
+++ b/docs/examples/ff09e13391cecb2e8b9dd440b37e065f.asciidoc
@@ -1,3 +1,4 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:310
[source, python]
@@ -8,4 +9,4 @@ resp = client.search(
filter_path="hits.total",
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ff1b96d2fdcf628bd938bff9e939943c.asciidoc b/docs/examples/ff1b96d2fdcf628bd938bff9e939943c.asciidoc
index f3b2889cf..8bab9f402 100644
--- a/docs/examples/ff1b96d2fdcf628bd938bff9e939943c.asciidoc
+++ b/docs/examples/ff1b96d2fdcf628bd938bff9e939943c.asciidoc
@@ -1,19 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:967
[source, python]
----
resp = client.indices.create(
index="my-index-000001",
- body={
- "mappings": {
- "properties": {
- "timestamp": {"type": "date"},
- "temperature": {"type": "long"},
- "voltage": {"type": "double"},
- "node": {"type": "keyword"},
+ mappings={
+ "properties": {
+ "timestamp": {
+ "type": "date"
+ },
+ "temperature": {
+ "type": "long"
+ },
+ "voltage": {
+ "type": "double"
+ },
+ "node": {
+ "type": "keyword"
}
}
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ff27e5cddd1f58d8a8f84f807fd27eec.asciidoc b/docs/examples/ff27e5cddd1f58d8a8f84f807fd27eec.asciidoc
new file mode 100644
index 000000000..9ce7f1ce8
--- /dev/null
+++ b/docs/examples/ff27e5cddd1f58d8a8f84f807fd27eec.asciidoc
@@ -0,0 +1,31 @@
+// This file is autogenerated, DO NOT EDIT
+// ingest/processors/redact.asciidoc:178
+
+[source, python]
+----
+resp = client.ingest.simulate(
+ pipeline={
+ "processors": [
+ {
+ "redact": {
+ "field": "message",
+ "patterns": [
+ "%{GITHUB_NAME:GITHUB_NAME}"
+ ],
+ "pattern_definitions": {
+ "GITHUB_NAME": "@%{USERNAME}"
+ }
+ }
+ }
+ ]
+ },
+ docs=[
+ {
+ "_source": {
+ "message": "@elastic-data-management the PR is ready for review"
+ }
+ }
+ ],
+)
+print(resp)
+----
diff --git a/docs/examples/ff56ded50c65998c70f3c5691ddc6f86.asciidoc b/docs/examples/ff56ded50c65998c70f3c5691ddc6f86.asciidoc
new file mode 100644
index 000000000..b08b694ec
--- /dev/null
+++ b/docs/examples/ff56ded50c65998c70f3c5691ddc6f86.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// snapshot-restore/apis/delete-repo-api.asciidoc:27
+
+[source, python]
+----
+resp = client.snapshot.delete_repository(
+ name="my_repository",
+)
+print(resp)
+----
diff --git a/docs/examples/ff63ae39c34925dbfa54282ec9989124.asciidoc b/docs/examples/ff63ae39c34925dbfa54282ec9989124.asciidoc
index 5902847db..7381f8418 100644
--- a/docs/examples/ff63ae39c34925dbfa54282ec9989124.asciidoc
+++ b/docs/examples/ff63ae39c34925dbfa54282ec9989124.asciidoc
@@ -1,19 +1,26 @@
+// This file is autogenerated, DO NOT EDIT
// docs/reindex.asciidoc:1003
[source, python]
----
resp = client.reindex(
- body={
- "source": {
- "remote": {
- "host": "http://otherhost:9200",
- "headers": {"Authorization": "ApiKey API_KEY_VALUE"},
- },
- "index": "my-index-000001",
- "query": {"match": {"test": "data"}},
+ source={
+ "remote": {
+ "host": "http://otherhost:9200",
+ "headers": {
+ "Authorization": "ApiKey API_KEY_VALUE"
+ }
},
- "dest": {"index": "my-new-index-000001"},
+ "index": "my-index-000001",
+ "query": {
+ "match": {
+ "test": "data"
+ }
+ }
+ },
+ dest={
+ "index": "my-new-index-000001"
},
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ff776c0fccf93e1c7050f7cb7efbae0b.asciidoc b/docs/examples/ff776c0fccf93e1c7050f7cb7efbae0b.asciidoc
index 864363aea..5effa743d 100644
--- a/docs/examples/ff776c0fccf93e1c7050f7cb7efbae0b.asciidoc
+++ b/docs/examples/ff776c0fccf93e1c7050f7cb7efbae0b.asciidoc
@@ -1,12 +1,15 @@
+// This file is autogenerated, DO NOT EDIT
// ml/trained-models/apis/infer-trained-model.asciidoc:905
[source, python]
----
resp = client.ml.infer_trained_model(
model_id="model2",
- body={
- "docs": [{"text_field": "Hi my name is Josh and I live in Berlin"}]
- },
+ docs=[
+ {
+ "text_field": "Hi my name is Josh and I live in Berlin"
+ }
+ ],
)
print(resp)
-----
\ No newline at end of file
+----
diff --git a/docs/examples/ff7b81fa96c3b994efa3dee230512291.asciidoc b/docs/examples/ff7b81fa96c3b994efa3dee230512291.asciidoc
new file mode 100644
index 000000000..2d64be799
--- /dev/null
+++ b/docs/examples/ff7b81fa96c3b994efa3dee230512291.asciidoc
@@ -0,0 +1,27 @@
+// This file is autogenerated, DO NOT EDIT
+// graph/explore.asciidoc:204
+
+[source, python]
+----
+resp = client.graph.explore(
+ index="clicklogs",
+ query={
+ "match": {
+ "query.raw": "midi"
+ }
+ },
+ vertices=[
+ {
+ "field": "product"
+ }
+ ],
+ connections={
+ "vertices": [
+ {
+ "field": "query.raw"
+ }
+ ]
+ },
+)
+print(resp)
+----
diff --git a/docs/examples/ff945f5db7d8a9b0d9f6a2f2fcf849e3.asciidoc b/docs/examples/ff945f5db7d8a9b0d9f6a2f2fcf849e3.asciidoc
new file mode 100644
index 000000000..da1eae11d
--- /dev/null
+++ b/docs/examples/ff945f5db7d8a9b0d9f6a2f2fcf849e3.asciidoc
@@ -0,0 +1,37 @@
+// This file is autogenerated, DO NOT EDIT
+// mapping/fields/tier-field.asciidoc:10
+
+[source, python]
+----
+resp = client.index(
+ index="index_1",
+ id="1",
+ document={
+ "text": "Document in index 1"
+ },
+)
+print(resp)
+
+resp1 = client.index(
+ index="index_2",
+ id="2",
+ refresh=True,
+ document={
+ "text": "Document in index 2"
+ },
+)
+print(resp1)
+
+resp2 = client.search(
+ index="index_1,index_2",
+ query={
+ "terms": {
+ "_tier": [
+ "data_hot",
+ "data_warm"
+ ]
+ }
+ },
+)
+print(resp2)
+----
diff --git a/docs/examples/ffcf80e1094aa2d774f56f6b0bc54827.asciidoc b/docs/examples/ffcf80e1094aa2d774f56f6b0bc54827.asciidoc
new file mode 100644
index 000000000..5b86d02a8
--- /dev/null
+++ b/docs/examples/ffcf80e1094aa2d774f56f6b0bc54827.asciidoc
@@ -0,0 +1,14 @@
+// This file is autogenerated, DO NOT EDIT
+// analysis/tokenfilters/word-delimiter-graph-tokenfilter.asciidoc:47
+
+[source, python]
+----
+resp = client.indices.analyze(
+ tokenizer="keyword",
+ filter=[
+ "word_delimiter_graph"
+ ],
+ text="Neil's-Super-Duper-XL500--42+AutoCoder",
+)
+print(resp)
+----
diff --git a/docs/examples/ffd63dd186ab81b893faec3b3358fa09.asciidoc b/docs/examples/ffd63dd186ab81b893faec3b3358fa09.asciidoc
new file mode 100644
index 000000000..83140cb6e
--- /dev/null
+++ b/docs/examples/ffd63dd186ab81b893faec3b3358fa09.asciidoc
@@ -0,0 +1,10 @@
+// This file is autogenerated, DO NOT EDIT
+// rest-api/security/delete-users.asciidoc:39
+
+[source, python]
+----
+resp = client.security.delete_user(
+ username="jacknich",
+)
+print(resp)
+----
diff --git a/docs/examples/ffe45a7c70071730c2078cabb8cbdf95.asciidoc b/docs/examples/ffe45a7c70071730c2078cabb8cbdf95.asciidoc
new file mode 100644
index 000000000..9c274a864
--- /dev/null
+++ b/docs/examples/ffe45a7c70071730c2078cabb8cbdf95.asciidoc
@@ -0,0 +1,34 @@
+// This file is autogenerated, DO NOT EDIT
+// vectors/vector-functions.asciidoc:294
+
+[source, python]
+----
+resp = client.search(
+ index="my-index-000001",
+ query={
+ "script_score": {
+ "query": {
+ "bool": {
+ "filter": {
+ "term": {
+ "status": "published"
+ }
+ }
+ }
+ },
+ "script": {
+ "source": "\n float[] v = doc['my_dense_vector'].vectorValue;\n float vm = doc['my_dense_vector'].magnitude;\n float dotProduct = 0;\n for (int i = 0; i < v.length; i++) {\n dotProduct += v[i] * params.queryVector[i];\n }\n return dotProduct / (vm * (float) params.queryVectorMag);\n ",
+ "params": {
+ "queryVector": [
+ 4,
+ 3.4,
+ -0.2
+ ],
+ "queryVectorMag": 5.25357
+ }
+ }
+ }
+ },
+)
+print(resp)
+----
diff --git a/utils/generate-docs-examples/README.md b/utils/generate-docs-examples/README.md
new file mode 100644
index 000000000..e70ba8eaf
--- /dev/null
+++ b/utils/generate-docs-examples/README.md
@@ -0,0 +1,14 @@
+This directory contains a script that generates the Python documentation examples in `docs/examples`.
+
+To use this script you need a recent version of Node.js (18+). First install the dependencies:
+
+```bash
+cd utils/generate-docs-examples
+npm install
+```
+
+Then run the script as follows:
+
+```bash
+node generate-docs-examples.js
+```
diff --git a/utils/generate-docs-examples/generate-docs-examples.js b/utils/generate-docs-examples/generate-docs-examples.js
new file mode 100644
index 000000000..fadaf8447
--- /dev/null
+++ b/utils/generate-docs-examples/generate-docs-examples.js
@@ -0,0 +1,112 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { join } = require('path')
+const { writeFile } = require('fs/promises')
+const fetch = require('node-fetch')
+const rimraf = require('rimraf')
+const ora = require('ora')
+const { convertRequests } = require('@elastic/request-converter')
+const minimist = require('minimist')
+
+const docsExamplesDir = join(__dirname, '../../docs', 'examples')
+
+const log = ora('Generating example snippets')
+
+const failures = {}
+
+async function getAlternativesReport (version = 'master') {
+ const reportUrl = `https://raw.githubusercontent.com/elastic/built-docs/master/raw/en/elasticsearch/reference/${version}/alternatives_report.json`
+ const response = await fetch(reportUrl)
+ if (!response.ok) {
+ log.fail(`unexpected response ${response.statusText}`)
+ process.exit(1)
+ }
+ return await response.json()
+}
+
+async function makeSnippet (example) {
+ const { source, digest } = example
+ const fileName = `${digest}.asciidoc`
+ const filePath = join(docsExamplesDir, fileName)
+
+ try {
+ const code = await convertRequests(source, 'python', {
+ complete: false,
+ printResponse: true
+ })
+ await writeFile(filePath, asciidocWrapper(code, example), 'utf8')
+ } catch (err) {
+ failures[digest] = err.message
+ }
+}
+
+async function generate (version) {
+ log.start()
+
+ rimraf.sync(join(docsExamplesDir, '*'))
+
+ log.text = `Downloading alternatives report for version ${version}`
+ const examples = await getAlternativesReport(version)
+
+ let counter = 1
+ for (const example of examples) {
+ log.text = `${counter++}/${examples.length}: ${example.digest}`
+
+ // skip over bad request definitions
+ if (example.source.startsWith('{') || example.source.endsWith('...')) {
+ failures[example.digest] = 'Incomplete request syntax'
+ continue
+ }
+
+ await makeSnippet(example)
+ }
+}
+
+function asciidocWrapper (source, example) {
+ return `// This file is autogenerated, DO NOT EDIT
+// ${example.source_location.file}:${example.source_location.line}
+
+[source, python]
+----
+${source.trim()}
+----
+`
+}
+
+const options = minimist(process.argv.slice(2), {
+ string: ['version'],
+ default: {
+ version: 'master'
+ }
+})
+
+generate(options.version)
+ .then(() => log.succeed('done!'))
+ .catch(err => log.fail(err.message))
+ .finally(() => {
+ const keys = Object.keys(failures)
+ if (keys.length > 0) {
+ let message = 'Some examples failed to generate:\n\n'
+ for (const key of keys) {
+ message += `${key}: ${failures[key]}\n`
+ }
+ console.error(message)
+ }
+ })
diff --git a/utils/generate-docs-examples/package-lock.json b/utils/generate-docs-examples/package-lock.json
new file mode 100644
index 000000000..f482f91c6
--- /dev/null
+++ b/utils/generate-docs-examples/package-lock.json
@@ -0,0 +1,674 @@
+{
+ "name": "generate-docs-examples",
+ "version": "1.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "generate-docs-examples",
+ "version": "1.0.0",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@elastic/request-converter": "^8.15.2",
+ "minimist": "^1.2.6",
+ "node-fetch": "^2.6.7",
+ "ora": "^5.4.1",
+ "rimraf": "^3.0.2"
+ }
+ },
+ "node_modules/@elastic/request-converter": {
+ "version": "8.15.4",
+ "resolved": "https://registry.npmjs.org/@elastic/request-converter/-/request-converter-8.15.4.tgz",
+ "integrity": "sha512-iZDQpZpygV+AVOweaDzTsMJBfa2hwwduPXNNzk/yTXgC9qtjmns/AjehtLStKXs274+u3fg+BFxVt6NcMwUAAg==",
+ "dependencies": {
+ "child-process-promise": "^2.2.1",
+ "commander": "^12.1.0",
+ "find-my-way-ts": "^0.1.2",
+ "handlebars": "^4.7.8",
+ "prettier": "^2.8.8"
+ },
+ "bin": {
+ "es-request-converter": "dist/es-request-converter.js"
+ }
+ },
+ "node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
+ },
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/bl": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
+ "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
+ "dependencies": {
+ "buffer": "^5.5.0",
+ "inherits": "^2.0.4",
+ "readable-stream": "^3.4.0"
+ }
+ },
+ "node_modules/brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "node_modules/buffer": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
+ "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.1.13"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/child-process-promise": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/child-process-promise/-/child-process-promise-2.2.1.tgz",
+ "integrity": "sha512-Fi4aNdqBsr0mv+jgWxcZ/7rAIC2mgihrptyVI4foh/rrjY/3BNjfP9+oaiFx/fzim+1ZyCNBae0DlyfQhSugog==",
+ "dependencies": {
+ "cross-spawn": "^4.0.2",
+ "node-version": "^1.0.0",
+ "promise-polyfill": "^6.0.1"
+ }
+ },
+ "node_modules/cli-cursor": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
+ "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==",
+ "dependencies": {
+ "restore-cursor": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cli-spinners": {
+ "version": "2.9.2",
+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz",
+ "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/clone": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
+ "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==",
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+ },
+ "node_modules/commander": {
+ "version": "12.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
+ "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
+ },
+ "node_modules/cross-spawn": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz",
+ "integrity": "sha512-yAXz/pA1tD8Gtg2S98Ekf/sewp3Lcp3YoFKJ4Hkp5h5yLWnKVTDU0kwjKJ8NDCYcfTLfyGkzTikst+jWypT1iA==",
+ "dependencies": {
+ "lru-cache": "^4.0.1",
+ "which": "^1.2.9"
+ }
+ },
+ "node_modules/defaults": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz",
+ "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==",
+ "dependencies": {
+ "clone": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/find-my-way-ts": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/find-my-way-ts/-/find-my-way-ts-0.1.5.tgz",
+ "integrity": "sha512-4GOTMrpGQVzsCH2ruUn2vmwzV/02zF4q+ybhCIrw/Rkt3L8KWcycdC6aJMctJzwN4fXD4SD5F/4B9Sksh5rE0A=="
+ },
+ "node_modules/fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
+ },
+ "node_modules/glob": {
+ "version": "7.2.3",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
+ "deprecated": "Glob versions prior to v9 are no longer supported",
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.1.1",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/handlebars": {
+ "version": "4.7.8",
+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
+ "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
+ "dependencies": {
+ "minimist": "^1.2.5",
+ "neo-async": "^2.6.2",
+ "source-map": "^0.6.1",
+ "wordwrap": "^1.0.0"
+ },
+ "bin": {
+ "handlebars": "bin/handlebars"
+ },
+ "engines": {
+ "node": ">=0.4.7"
+ },
+ "optionalDependencies": {
+ "uglify-js": "^3.1.4"
+ }
+ },
+ "node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ieee754": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
+ "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
+ "dependencies": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "node_modules/is-interactive": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz",
+ "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-unicode-supported": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
+ "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
+ },
+ "node_modules/log-symbols": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
+ "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==",
+ "dependencies": {
+ "chalk": "^4.1.0",
+ "is-unicode-supported": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/lru-cache": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
+ "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
+ "dependencies": {
+ "pseudomap": "^1.0.2",
+ "yallist": "^2.1.2"
+ }
+ },
+ "node_modules/mimic-fn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/minimist": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/neo-async": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
+ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
+ },
+ "node_modules/node-fetch": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/node-version": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/node-version/-/node-version-1.2.0.tgz",
+ "integrity": "sha512-ma6oU4Sk0qOoKEAymVoTvk8EdXEobdS7m/mAGhDJ8Rouugho48crHBORAmy5BoOcv8wraPM6xumapQp5hl4iIQ==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/onetime": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
+ "dependencies": {
+ "mimic-fn": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/ora": {
+ "version": "5.4.1",
+ "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz",
+ "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==",
+ "dependencies": {
+ "bl": "^4.1.0",
+ "chalk": "^4.1.0",
+ "cli-cursor": "^3.1.0",
+ "cli-spinners": "^2.5.0",
+ "is-interactive": "^1.0.0",
+ "is-unicode-supported": "^0.1.0",
+ "log-symbols": "^4.1.0",
+ "strip-ansi": "^6.0.0",
+ "wcwidth": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/prettier": {
+ "version": "2.8.8",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
+ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
+ "node_modules/promise-polyfill": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-6.1.0.tgz",
+ "integrity": "sha512-g0LWaH0gFsxovsU7R5LrrhHhWAWiHRnh1GPrhXnPgYsDkIqjRYUYSZEsej/wtleDrz5xVSIDbeKfidztp2XHFQ=="
+ },
+ "node_modules/pseudomap": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
+ "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ=="
+ },
+ "node_modules/readable-stream": {
+ "version": "3.6.2",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/restore-cursor": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
+ "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==",
+ "dependencies": {
+ "onetime": "^5.1.0",
+ "signal-exit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "deprecated": "Rimraf versions prior to v4 are no longer supported",
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/signal-exit": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
+ },
+ "node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/string_decoder": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+ "dependencies": {
+ "safe-buffer": "~5.2.0"
+ }
+ },
+ "node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tr46": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
+ },
+ "node_modules/uglify-js": {
+ "version": "3.19.2",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.2.tgz",
+ "integrity": "sha512-S8KA6DDI47nQXJSi2ctQ629YzwOVs+bQML6DAtvy0wgNdpi+0ySpQK0g2pxBq2xfF2z3YCscu7NNA8nXT9PlIQ==",
+ "optional": true,
+ "bin": {
+ "uglifyjs": "bin/uglifyjs"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
+ },
+ "node_modules/wcwidth": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz",
+ "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==",
+ "dependencies": {
+ "defaults": "^1.0.3"
+ }
+ },
+ "node_modules/webidl-conversions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
+ },
+ "node_modules/whatwg-url": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
+ "dependencies": {
+ "tr46": "~0.0.3",
+ "webidl-conversions": "^3.0.0"
+ }
+ },
+ "node_modules/which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "which": "bin/which"
+ }
+ },
+ "node_modules/wordwrap": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+ "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q=="
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
+ },
+ "node_modules/yallist": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
+ "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A=="
+ }
+ }
+}
diff --git a/utils/generate-docs-examples/package.json b/utils/generate-docs-examples/package.json
new file mode 100644
index 000000000..569fa4655
--- /dev/null
+++ b/utils/generate-docs-examples/package.json
@@ -0,0 +1,19 @@
+{
+ "name": "generate-docs-examples",
+ "version": "1.0.0",
+ "main": "generate-docs-examples.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "Apache-2.0",
+ "description": "",
+ "dependencies": {
+ "@elastic/request-converter": "~8.15.2",
+ "minimist": "^1.2.6",
+ "node-fetch": "^2.6.7",
+ "ora": "^5.4.1",
+ "rimraf": "^3.0.2"
+ }
+}