-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9226804
commit b076a3e
Showing
87 changed files
with
1,300 additions
and
110 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
docs/examples/guide/04412d11783dac25b5fd2ec5407078a3.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[source, ruby] | ||
---- | ||
response = client.connector.update_api_key_id( | ||
connector_id: 'my-connector', | ||
body: { | ||
api_key_id: 'my-api-key-id', | ||
api_key_secret_id: 'my-connector-secret-id' | ||
} | ||
) | ||
puts response | ||
---- |
48 changes: 48 additions & 0 deletions
48
docs/examples/guide/086ec4c5d86bbf80fb80162e94037689.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[source, ruby] | ||
---- | ||
response = client.search( | ||
body: { | ||
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 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
) | ||
puts response | ||
---- |
20 changes: 20 additions & 0 deletions
20
docs/examples/guide/0ba5acede9d43af424e85428e7d35420.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[source, ruby] | ||
---- | ||
response = client.ingest.put_pipeline( | ||
id: 'azure_openai_embeddings', | ||
body: { | ||
processors: [ | ||
{ | ||
inference: { | ||
model_id: 'azure_openai_embeddings', | ||
input_output: { | ||
input_field: 'content', | ||
output_field: 'content_embedding' | ||
} | ||
} | ||
} | ||
] | ||
} | ||
) | ||
puts response | ||
---- |
9 changes: 9 additions & 0 deletions
9
docs/examples/guide/1147a02afa087278e51fa365fb9e06b7.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[source, ruby] | ||
---- | ||
response = client.search( | ||
body: { | ||
size: '1000' | ||
} | ||
) | ||
puts response | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
docs/examples/guide/1aa96eeaf63fc967e166d1a2fcdccccc.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[source, ruby] | ||
---- | ||
response = client.indices.create( | ||
index: 'my-index-000002', | ||
body: { | ||
mappings: { | ||
properties: { | ||
metrics: { | ||
subobjects: false, | ||
properties: { | ||
time: { | ||
type: 'object', | ||
properties: { | ||
min: { | ||
type: 'long' | ||
}, | ||
max: { | ||
type: 'long' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
) | ||
puts response | ||
response = client.indices.get_mapping( | ||
index: 'my-index-000002' | ||
) | ||
puts response | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
docs/examples/guide/2212167f67b7ad1cd2b8dcec083d09ea.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[source, ruby] | ||
---- | ||
response = client.connector.list( | ||
index_name: 'search-google-drive' | ||
) | ||
puts response | ||
---- |
24 changes: 24 additions & 0 deletions
24
docs/examples/guide/22dd833336fa22c8a8f67bb754ffba9a.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[source, ruby] | ||
---- | ||
response = client.search( | ||
index: 'azure-openai-embeddings', | ||
body: { | ||
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' | ||
] | ||
} | ||
) | ||
puts response | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
docs/examples/guide/2afdf0d83724953aa2875b5fb37d60cc.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[source, ruby] | ||
---- | ||
response = client.esql.async_query_get( | ||
id: 'FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=', | ||
wait_for_completion_timeout: '30s' | ||
) | ||
puts response | ||
---- |
7 changes: 7 additions & 0 deletions
7
docs/examples/guide/2b1c560f00d9bcf5caaf56c03f6b5962.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[source, ruby] | ||
---- | ||
response = client.connector.sync_job_list( | ||
job_type: 'full,incremental' | ||
) | ||
puts response | ||
---- |
7 changes: 7 additions & 0 deletions
7
docs/examples/guide/2b7687e3d7c06824950e00618c297864.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[source, ruby] | ||
---- | ||
response = client.indices.resolve_cluster( | ||
name: 'my-index*,clust*:my-index*' | ||
) | ||
puts response | ||
---- |
23 changes: 23 additions & 0 deletions
23
docs/examples/guide/2e93eaaebf75fa4a2451e8a76ffa9f20.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[source, ruby] | ||
---- | ||
response = client.indices.put_index_template( | ||
name: 'my-data-stream-template', | ||
body: { | ||
index_patterns: [ | ||
'my-data-stream*' | ||
], | ||
data_stream: {}, | ||
priority: 500, | ||
template: { | ||
mappings: { | ||
properties: { | ||
message: { | ||
type: 'text' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
) | ||
puts response | ||
---- |
6 changes: 2 additions & 4 deletions
6
...01c0e302f4fd5118faf5e34f4a010ebf.asciidoc → ...2f07b81fd47ec3b074242a760f0c4e9e.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
...1c5a5a8c0bdc3c577f560157bd4e2313.asciidoc → ...34cdeefb09bbbe5206957a8bc1bd513d.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
docs/examples/guide/357edc9d10e98ed776401c7a439a1a55.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[source, ruby] | ||
---- | ||
response = client.indices.resolve_cluster( | ||
name: 'not-present,clust*:my-index*,oldcluster:*', | ||
ignore_unavailable: false | ||
) | ||
puts response | ||
---- |
15 changes: 15 additions & 0 deletions
15
docs/examples/guide/360b3cef34bbddc5d9579ca95f0cb061.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[source, ruby] | ||
---- | ||
response = client.indices.put_mapping( | ||
index: 'my-data-stream', | ||
write_index_only: true, | ||
body: { | ||
properties: { | ||
message: { | ||
type: 'text' | ||
} | ||
} | ||
} | ||
) | ||
puts response | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
docs/examples/guide/394d8fc4d78214e6fe5e4dea62c8923f.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[source, ruby] | ||
---- | ||
response = client.connector.update_configuration( | ||
connector_id: 'my-spo-connector', | ||
body: { | ||
configuration: { | ||
client_id: { | ||
default_value: nil, | ||
depends_on: [], | ||
display: 'text', | ||
label: 'Client ID', | ||
options: [], | ||
order: 3, | ||
required: true, | ||
sensitive: false, | ||
tooltip: nil, | ||
type: 'str', | ||
ui_restrictions: [], | ||
validations: [], | ||
value: nil | ||
}, | ||
secret_value: { | ||
default_value: nil, | ||
depends_on: [], | ||
display: 'text', | ||
label: 'Secret value', | ||
options: [], | ||
order: 4, | ||
required: true, | ||
sensitive: true, | ||
tooltip: nil, | ||
type: 'str', | ||
ui_restrictions: [], | ||
validations: [], | ||
value: nil | ||
} | ||
} | ||
} | ||
) | ||
puts response | ||
---- |
20 changes: 20 additions & 0 deletions
20
docs/examples/guide/3a7a6ab88a49b484fafb10c8eb09b562.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[source, ruby] | ||
---- | ||
response = client.ingest.put_pipeline( | ||
id: 'cohere_embeddings', | ||
body: { | ||
processors: [ | ||
{ | ||
inference: { | ||
model_id: 'cohere_embeddings', | ||
input_output: { | ||
input_field: 'content', | ||
output_field: 'content_embedding' | ||
} | ||
} | ||
} | ||
] | ||
} | ||
) | ||
puts response | ||
---- |
Oops, something went wrong.