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 Jan 5, 2024
1 parent e590347 commit 9aab364
Show file tree
Hide file tree
Showing 44 changed files with 685 additions and 31 deletions.
33 changes: 33 additions & 0 deletions docs/examples/guide/0350410d11579f4e876c798ce1eaef5b.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[source, ruby]
----
response = client.index(
index: 'my-index-000001',
id: 5,
refresh: true,
body: {
query: {
bool: {
should: [
{
match: {
message: {
query: 'Japanese art',
_name: 'query1'
}
}
},
{
match: {
message: {
query: 'Holand culture',
_name: 'query2'
}
}
}
]
}
}
}
)
puts response
----
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ response = client.search(
query: {
text_expansion: {
'ml.tokens' => {
model_id: '.elser_model_1',
model_id: '.elser_model_2',
model_text: 'How is the weather in Jamaica?'
}
}
Expand Down
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
----
8 changes: 8 additions & 0 deletions docs/examples/guide/33d480fc6812ada75756cf5337bc9092.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[source, ruby]
----
response = client.connector_sync_job.list(
from: 0,
size: 2
)
puts response
----
12 changes: 12 additions & 0 deletions docs/examples/guide/342ddf9121aeddd82fea2464665e25da.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[source, ruby]
----
response = client.connector.put(
connector_id: 'my-connector',
body: {
index_name: 'search-google-drive',
name: 'My Connector',
service_type: 'google_drive'
}
)
puts response
----
24 changes: 24 additions & 0 deletions docs/examples/guide/34d63740b58209a3d031212909743925.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[source, ruby]
----
response = client.search(
index: 'openai-embeddings',
body: {
knn: {
field: 'content_embedding',
query_vector_builder: {
text_embedding: {
model_id: 'openai_embeddings',
model_text: 'Calculate fuel cost'
}
},
k: 10,
num_candidates: 100
},
_source: [
'id',
'content'
]
}
)
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
----
7 changes: 7 additions & 0 deletions docs/examples/guide/365256ebdfa47b449780771d9beba8d9.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[source, ruby]
----
response = client.connector_sync_job.check_in(
connector_sync_job_id: 'my-connector-sync-job'
)
puts response
----
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
----
response = client.search(
index: 'books',
body: { query: { match: { name: 'brave' } } }
body: {
query: {
match: {
name: 'brave'
}
}
}
)
puts response
----
7 changes: 7 additions & 0 deletions docs/examples/guide/370b297ed3433577adf53e64f572d89d.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[source, ruby]
----
response = client.connector_sync_job.delete(
connector_sync_job_id: 'my-connector-sync-job-id'
)
puts response
----
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ response = client.search(
slop: 5,
in_order: false
}
},
highlight: {
require_field_match: false,
fields: {
"*": {}
}
}
}
)
Expand Down
14 changes: 14 additions & 0 deletions docs/examples/guide/3e4227250d49e81df48773f8ba803ea7.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[source, ruby]
----
response = client.indices.put_mapping(
index: 'my-data-stream',
body: {
properties: {
message: {
type: 'text'
}
}
}
)
puts response
----
11 changes: 11 additions & 0 deletions docs/examples/guide/405ac843a9156d3cab374e199cac87fb.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[source, ruby]
----
response = client.connector_sync_job.post(
body: {
id: 'connector-id',
job_type: 'full',
trigger_method: 'on_demand'
}
)
puts response
----
15 changes: 15 additions & 0 deletions docs/examples/guide/41175d304e660da2931764f9a4418fd3.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[source, ruby]
----
response = client.connector.update_pipeline(
connector_id: 'my-connector',
body: {
pipeline: {
extract_binary_content: true,
name: 'my-connector-pipeline',
reduce_whitespace: true,
run_ml_inference: true
}
}
)
puts response
----
19 changes: 19 additions & 0 deletions docs/examples/guide/46103fee3cd5f53dc75123def82d52ad.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[source, ruby]
----
response = client.indices.put_index_template(
name: 'my-data-stream-template',
body: {
index_patterns: [
'my-data-stream*'
],
data_stream: {},
priority: 500,
template: {
settings: {
'index.refresh_interval' => '30s'
}
}
}
)
puts response
----
28 changes: 28 additions & 0 deletions docs/examples/guide/4be20da16d2b58216e8b307218c7bf3a.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[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: {
host: {
properties: {
ip: {
type: 'ip',
ignore_malformed: true
}
}
}
}
}
}
}
)
puts response
----
43 changes: 43 additions & 0 deletions docs/examples/guide/4fcca1687d7b2cf08de526539fea5a76.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[source, ruby]
----
response = client.search(
index: 'my-index',
body: {
query: {
bool: {
should: [
{
text_expansion: {
'ml.inference.title_expanded.predicted_value' => {
model_id: '.elser_model_2',
model_text: 'How is the weather in Jamaica?',
boost: 1
}
}
},
{
text_expansion: {
'ml.inference.description_expanded.predicted_value' => {
model_id: '.elser_model_2',
model_text: 'How is the weather in Jamaica?',
boost: 1
}
}
},
{
multi_match: {
query: 'How is the weather in Jamaica?',
fields: [
'title',
'description'
],
boost: 4
}
}
]
}
}
}
)
puts response
----
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ response = client.cluster.put_component_template(
body: {
template: {
settings: {
'index.lifecycle.name' => 'my-lifecycle-policy',
'index.look_ahead_time' => '3h'
'index.lifecycle.name' => 'my-lifecycle-policy'
}
},
_meta: {
Expand Down
19 changes: 19 additions & 0 deletions docs/examples/guide/640621cea39cdeeb76fbc95bff31a18d.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[source, ruby]
----
response = client.connector.last_sync(
connector_id: 'my-connector',
body: {
last_access_control_sync_error: 'Houston, we have a problem!',
last_access_control_sync_scheduled_at: '2023-11-09T15:13:08.231Z',
last_access_control_sync_status: 'pending',
last_deleted_document_count: 42,
last_incremental_sync_scheduled_at: '2023-11-09T15:13:08.231Z',
last_indexed_document_count: 42,
last_sync_error: 'Houston, we have a problem!',
last_sync_scheduled_at: '2024-11-09T15:13:08.231Z',
last_sync_status: 'completed',
last_synced: '2024-11-09T15:13:08.231Z'
}
)
puts response
----
17 changes: 17 additions & 0 deletions docs/examples/guide/65e892a362d940e4a74965f21c15ca09.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[source, ruby]
----
response = client.reindex(
wait_for_completion: false,
body: {
source: {
index: 'test-data',
size: 50
},
dest: {
index: 'openai-embeddings',
pipeline: 'openai_embeddings'
}
}
)
puts response
----
24 changes: 24 additions & 0 deletions docs/examples/guide/6843d859e2965d17cad4f033c81db83f.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[source, ruby]
----
response = client.indices.put_index_template(
name: 'my-data-stream-template',
body: {
index_patterns: [
'my-data-stream*'
],
data_stream: {},
priority: 500,
template: {
settings: {
'sort.field' => [
'@timestamp'
],
'sort.order' => [
'desc'
]
}
}
}
)
puts response
----
7 changes: 7 additions & 0 deletions docs/examples/guide/6b8c5c8145c287c4fc535fa57ccf95a7.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[source, ruby]
----
response = client.connector_sync_job.list(
status: 'pending'
)
puts response
----
Loading

0 comments on commit 9aab364

Please sign in to comment.