Skip to content

Commit 47dc082

Browse files
committed
Add x-codeSamples to check document API
1 parent da8617e commit 47dc082

File tree

6 files changed

+42
-0
lines changed

6 files changed

+42
-0
lines changed

docs/overlays/elasticsearch-shared-overlays.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,3 +1696,13 @@ actions:
16961696
examples:
16971697
searchApplicationSearchRequestExample1:
16981698
$ref: "../../specification/search_application/search/examples/request/SearchApplicationsSearchRequestExample1.yaml"
1699+
# xCodeSamples
1700+
- target: "$.paths['/{index}/_doc/{id}']['head']"
1701+
description: "Add xCodeSamples for check document operation"
1702+
update:
1703+
x-codeSamples:
1704+
- $ref: "../../specification/_global/exists/examples/xCodeSamples/DocumentExistsConsoleExample1.yaml"
1705+
- $ref: "../../specification/_global/exists/examples/xCodeSamples/DocumentExistsCurlExample1.yaml"
1706+
- $ref: "../../specification/_global/exists/examples/xCodeSamples/DocumentExistsJavaScriptExample1.yaml"
1707+
- $ref: "../../specification/_global/exists/examples/xCodeSamples/DocumentExistsPythonExample1.yaml"
1708+
- $ref: "../../specification/_global/exists/examples/xCodeSamples/DocumentExistsRubyExample1.yaml"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lang: Console
2+
# label:
3+
source: |
4+
HEAD my-index-000001/_doc/0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lang: Curl
2+
# label:
3+
source: |
4+
curl -I "localhost:9200/my-index-000001/_doc/0?pretty"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
lang: JavaScript
2+
# label:
3+
source: |
4+
const response = await client.exists({
5+
index: "my-index-000001",
6+
id: 0,
7+
});
8+
console.log(response);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
lang: Python
2+
# label:
3+
source: |
4+
resp = client.exists(
5+
index="my-index-000001",
6+
id="0",
7+
)
8+
print(resp)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- lang: Ruby
2+
# label:
3+
source: |
4+
response = client.exists(
5+
index: 'my-index-000001',
6+
id: 0
7+
)
8+
puts response

0 commit comments

Comments
 (0)