Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// inference/service-elasticsearch.asciidoc:163
// inference/service-elasticsearch.asciidoc:190

[source, python]
----
Expand Down
46 changes: 46 additions & 0 deletions docs/examples/015e6e6132b6d6d44bddb06bc3b316ed.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// This file is autogenerated, DO NOT EDIT
// search/search-your-data/retrievers-examples.asciidoc:789

[source, python]
----
resp = client.search(
index="retrievers_example",
retriever={
"rrf": {
"retrievers": [
{
"standard": {
"query": {
"range": {
"year": {
"gt": 2023
}
}
}
}
},
{
"standard": {
"query": {
"term": {
"topic": "elastic"
}
}
}
}
],
"rank_window_size": 10,
"rank_constant": 1
}
},
source=False,
aggs={
"topics": {
"terms": {
"field": "topic"
}
}
},
)
print(resp)
----
18 changes: 18 additions & 0 deletions docs/examples/0165d22da5f2fc7678392b31d8eb5566.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This file is autogenerated, DO NOT EDIT
// search/search-your-data/retrievers-examples.asciidoc:1101

[source, python]
----
resp = client.inference.put(
task_type="rerank",
inference_id="my-rerank-model",
inference_config={
"service": "cohere",
"service_settings": {
"model_id": "rerank-english-v3.0",
"api_key": "{{COHERE_API_KEY}}"
}
},
)
print(resp)
----
2 changes: 1 addition & 1 deletion docs/examples/0709a38613d2de90d418ce12b36af30e.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:109
// troubleshooting/common-issues/red-yellow-cluster-status.asciidoc:113

[source, python]
----
Expand Down
10 changes: 10 additions & 0 deletions docs/examples/0722b302b2b3275a988d858044f99d5d.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// quickstart/aggs-tutorial.asciidoc:45

[source, python]
----
resp = client.indices.get_mapping(
index="kibana_sample_data_ecommerce",
)
print(resp)
----
2 changes: 1 addition & 1 deletion docs/examples/083b92e8ea264e49bf9fd40fc6a3094b.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// inference/service-elasticsearch.asciidoc:223
// inference/service-elasticsearch.asciidoc:250

[source, python]
----
Expand Down
57 changes: 57 additions & 0 deletions docs/examples/0bc6155e0c88062a4d8490da49db3aa8.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// This file is autogenerated, DO NOT EDIT
// search/search-your-data/retrievers-examples.asciidoc:550

[source, python]
----
resp = client.search(
index="retrievers_example_nested",
retriever={
"rrf": {
"retrievers": [
{
"standard": {
"query": {
"nested": {
"path": "nested_field",
"inner_hits": {
"name": "nested_vector",
"_source": False,
"fields": [
"nested_field.paragraph_id"
]
},
"query": {
"knn": {
"field": "nested_field.nested_vector",
"query_vector": [
1,
0,
0.5
],
"k": 10
}
}
}
}
}
},
{
"standard": {
"query": {
"term": {
"topic": "ai"
}
}
}
}
],
"rank_window_size": 10,
"rank_constant": 1
}
},
source=[
"topic"
],
)
print(resp)
----
11 changes: 8 additions & 3 deletions docs/examples/0bee07a581c5776e068f6f4efad5a399.asciidoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// This file is autogenerated, DO NOT EDIT
// esql/esql-across-clusters.asciidoc:197
// esql/esql-across-clusters.asciidoc:192

[source, python]
----
resp = client.esql.async_query(
format="json",
resp = client.perform_request(
"POST",
"/_query/async",
params={
"format": "json"
},
headers={"Content-Type": "application/json"},
body={
"query": "\n FROM my-index-000001,cluster_one:my-index-000001,cluster_two:my-index*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ",
"include_ccs_metadata": True
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// ingest/processors/attachment.asciidoc:165
// ingest/processors/attachment.asciidoc:214

[source, python]
----
Expand All @@ -10,7 +10,7 @@ resp = client.ingest.put_pipeline(
{
"attachment": {
"field": "data",
"remove_binary": False
"remove_binary": True
}
}
],
Expand Down
60 changes: 60 additions & 0 deletions docs/examples/0d689ac6e78be5d438f9b5d441be2b44.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// This file is autogenerated, DO NOT EDIT
// search/search-your-data/retrievers-examples.asciidoc:929

[source, python]
----
resp = client.search(
index="retrievers_example",
retriever={
"rrf": {
"retrievers": [
{
"standard": {
"query": {
"term": {
"topic": "elastic"
}
}
}
},
{
"rrf": {
"retrievers": [
{
"standard": {
"query": {
"query_string": {
"query": "(information retrieval) OR (artificial intelligence)",
"default_field": "text"
}
}
}
},
{
"knn": {
"field": "vector",
"query_vector": [
0.23,
0.67,
0.89
],
"k": 3,
"num_candidates": 5
}
}
],
"rank_window_size": 10,
"rank_constant": 1
}
}
],
"rank_window_size": 10,
"rank_constant": 1
}
},
source=False,
size=1,
explain=True,
)
print(resp)
----
2 changes: 1 addition & 1 deletion docs/examples/0da747e9d98bae157d3520ff1b489ad4.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// snapshot-restore/repository-s3.asciidoc:41
// snapshot-restore/repository-s3.asciidoc:45

[source, python]
----
Expand Down
6 changes: 4 additions & 2 deletions docs/examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

[source, python]
----
resp = client.search_application.render_query(
name="my-app",
resp = client.perform_request(
"POST",
"/_application/search_application/my-app/_render_query",
headers={"Content-Type": "application/json"},
body={
"params": {
"query_string": "my first query",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/11e8d6e14686efabb8634b6522c05cb5.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// search/search-your-data/highlighting.asciidoc:455
// search/search-your-data/highlighting.asciidoc:453

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/15f769bbd7b5fddeb3353ae726b71b14.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// vectors/vector-functions.asciidoc:401
// vectors/vector-functions.asciidoc:405

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/16634cfa7916cf4e8048a1d70e6240f2.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resp = client.search_application.put(
"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 ",
"source": "\n {\n \"query\": {\n \"bool\": {\n \"must\": [\n {{#query}}\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": {},
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/17a1e308761afd3282f13d44d7be008a.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// search/search-your-data/highlighting.asciidoc:687
// search/search-your-data/highlighting.asciidoc:685

[source, python]
----
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// reranking/semantic-reranking.asciidoc:105
// reranking/semantic-reranking.asciidoc:107

[source, python]
----
Expand All @@ -16,7 +16,7 @@ resp = client.search(
}
},
"field": "text",
"inference_id": "my-cohere-rerank-model",
"inference_id": "elastic-rerank",
"inference_text": "How often does the moon hide the sun?",
"rank_window_size": 100,
"min_score": 0.5
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/192fa1f6f51dfb640e9e15bb5cd7eebc.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// ilm/error-handling.asciidoc:147
// ilm/error-handling.asciidoc:148

[source, python]
----
Expand Down
5 changes: 4 additions & 1 deletion docs/examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

[source, python]
----
resp = client.simulate.ingest(
resp = client.perform_request(
"POST",
"/_ingest/_simulate",
headers={"Content-Type": "application/json"},
body={
"docs": [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/1aa91d3d48140d6367b6cabca8737b8f.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// docs/bulk.asciidoc:632
// docs/bulk.asciidoc:636

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/1b37e2237c9e3aaf84d56cc5c0bdb9ec.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated, DO NOT EDIT
// ilm/error-handling.asciidoc:18
// ilm/error-handling.asciidoc:19

[source, python]
----
Expand Down
10 changes: 10 additions & 0 deletions docs/examples/22b176a184517cf1b5801f5eb4f17f97.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// data-streams/downsampling-dsl.asciidoc:349

[source, python]
----
resp = client.indices.rollover(
alias="datastream",
)
print(resp)
----
33 changes: 0 additions & 33 deletions docs/examples/2577acb462b95bd4394523cf2f8a661f.asciidoc

This file was deleted.

Loading
Loading