Skip to content

Commit

Permalink
[DOCS] Updates generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed May 16, 2024
1 parent 9226804 commit b076a3e
Show file tree
Hide file tree
Showing 87 changed files with 1,300 additions and 110 deletions.
11 changes: 11 additions & 0 deletions docs/examples/guide/04412d11783dac25b5fd2ec5407078a3.asciidoc
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 docs/examples/guide/086ec4c5d86bbf80fb80162e94037689.asciidoc
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 docs/examples/guide/0ba5acede9d43af424e85428e7d35420.asciidoc
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 docs/examples/guide/1147a02afa087278e51fa365fb9e06b7.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[source, ruby]
----
response = client.search(
body: {
size: '1000'
}
)
puts response
----
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
----
response = client.inference.inference(
task_type: 'sparse_embedding',
model_id: 'my-elser-model',
inference_id: 'my-elser-model',
body: {
input: 'The sky above the port was the color of television tuned to a dead channel.'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ puts response
response = client.esql.query(
body: {
query: 'FROM mv | LIMIT 2'
query: 'FROM mv | LIMIT 2',
version: '2024.04.01'
}
)
puts response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ response = client.indices.create(
properties: {
vector: {
type: 'dense_vector',
dims: 2
dims: 2,
index_options: {
type: 'hnsw'
}
},
text: {
type: 'text',
Expand Down
34 changes: 34 additions & 0 deletions docs/examples/guide/1aa96eeaf63fc967e166d1a2fcdccccc.asciidoc
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
----
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
----
response = client.esql.query(
body: {
query: 'FROM mv | EVAL b + 2, a + b | LIMIT 4'
query: 'FROM mv | EVAL b + 2, a + b | LIMIT 4',
version: '2024.04.01'
}
)
puts response
Expand Down
7 changes: 7 additions & 0 deletions docs/examples/guide/2212167f67b7ad1cd2b8dcec083d09ea.asciidoc
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 docs/examples/guide/22dd833336fa22c8a8f67bb754ffba9a.asciidoc
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
----
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
----
response = client.esql.query(
body: {
query: 'FROM mv | EVAL b=MV_MIN(b) | EVAL b + 2, a + b | LIMIT 4'
query: 'FROM mv | EVAL b=MV_MIN(b) | EVAL b + 2, a + b | LIMIT 4',
version: '2024.04.01'
}
)
puts response
Expand Down
8 changes: 8 additions & 0 deletions docs/examples/guide/2afdf0d83724953aa2875b5fb37d60cc.asciidoc
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 docs/examples/guide/2b1c560f00d9bcf5caaf56c03f6b5962.asciidoc
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 docs/examples/guide/2b7687e3d7c06824950e00618c297864.asciidoc
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 docs/examples/guide/2e93eaaebf75fa4a2451e8a76ffa9f20.asciidoc
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
----
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[source, ruby]
----
response = client.indices.put_settings(
index: 'my_source_index',
index: 'my-index-000001',
body: {
settings: {
'index.blocks.write' => true
}
'index.indexing.slowlog.include.user' => true
}
)
puts response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[source, ruby]
----
response = client.connector_sync_job.list(
response = client.connector.sync_job_list(
from: 0,
size: 2
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[source, ruby]
----
response = client.indices.put_settings(
index: 'my_source_index',
index: 'my-index-000001',
body: {
settings: {
'index.blocks.write' => true
}
'index.search.slowlog.include.user' => true
}
)
puts response
Expand Down
8 changes: 8 additions & 0 deletions docs/examples/guide/357edc9d10e98ed776401c7a439a1a55.asciidoc
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 docs/examples/guide/360b3cef34bbddc5d9579ca95f0cb061.asciidoc
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
----
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[source, ruby]
----
response = client.connector_sync_job.check_in(
response = client.connector.sync_job_check_in(
connector_sync_job_id: 'my-connector-sync-job'
)
puts response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[source, ruby]
----
response = client.connector_sync_job.delete(
response = client.connector.sync_job_delete(
connector_sync_job_id: 'my-connector-sync-job-id'
)
puts response
Expand Down
41 changes: 41 additions & 0 deletions docs/examples/guide/394d8fc4d78214e6fe5e4dea62c8923f.asciidoc
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 docs/examples/guide/3a7a6ab88a49b484fafb10c8eb09b562.asciidoc
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
----

0 comments on commit b076a3e

Please sign in to comment.