Skip to content

Add x-codeSamples to check document API #3594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 28, 2025
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
10 changes: 10 additions & 0 deletions docs/overlays/elasticsearch-shared-overlays.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2169,3 +2169,13 @@ actions:
examples:
updateTransformResponseExample1:
$ref: "../../specification/transform/update_transform/examples/response/UpdateTransformResponseExample1.yaml"
## xCodeSamples
- target: "$.paths['/{index}/_doc/{id}']['head']"
description: "Add xCodeSamples for check document operation"
update:
x-codeSamples:
- $ref: "../../specification/_global/exists/examples/xCodeSamples/DocumentExistsConsoleExample1.yaml"
- $ref: "../../specification/_global/exists/examples/xCodeSamples/DocumentExistsCurlExample1.yaml"
- $ref: "../../specification/_global/exists/examples/xCodeSamples/DocumentExistsJavaScriptExample1.yaml"
- $ref: "../../specification/_global/exists/examples/xCodeSamples/DocumentExistsPythonExample1.yaml"
- $ref: "../../specification/_global/exists/examples/xCodeSamples/DocumentExistsRubyExample1.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lang: Console
# label:
source: |
HEAD my-index-000001/_doc/0
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lang: Curl
# label:
source: |
curl -I "localhost:9200/my-index-000001/_doc/0?pretty"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lang: JavaScript
# label:
source: |
const response = await client.exists({
index: "my-index-000001",
id: 0,
});
console.log(response);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lang: Python
# label:
source: |
resp = client.exists(
index="my-index-000001",
id="0",
)
print(resp)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lang: Ruby
# label:
source: |
response = client.exists(
index: 'my-index-000001',
id: 0
)
puts response
Loading