Skip to content

Commit 9aab364

Browse files
committed
[DOCS] Updates generated docs
1 parent e590347 commit 9aab364

File tree

44 files changed

+685
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+685
-31
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[source, ruby]
2+
----
3+
response = client.index(
4+
index: 'my-index-000001',
5+
id: 5,
6+
refresh: true,
7+
body: {
8+
query: {
9+
bool: {
10+
should: [
11+
{
12+
match: {
13+
message: {
14+
query: 'Japanese art',
15+
_name: 'query1'
16+
}
17+
}
18+
},
19+
{
20+
match: {
21+
message: {
22+
query: 'Holand culture',
23+
_name: 'query2'
24+
}
25+
}
26+
}
27+
]
28+
}
29+
}
30+
}
31+
)
32+
puts response
33+
----

docs/examples/guide/f743225f1abcbc341e991a0e79ea89bc.asciidoc renamed to docs/examples/guide/2310d84ebf113f2a3ed14cc53172ae4a.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ response = client.search(
66
query: {
77
text_expansion: {
88
'ml.tokens' => {
9-
model_id: '.elser_model_1',
9+
model_id: '.elser_model_2',
1010
model_text: 'How is the weather in Jamaica?'
1111
}
1212
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[source, ruby]
2+
----
3+
response = client.indices.put_index_template(
4+
name: 'my-data-stream-template',
5+
body: {
6+
index_patterns: [
7+
'my-data-stream*'
8+
],
9+
data_stream: {},
10+
priority: 500,
11+
template: {
12+
mappings: {
13+
properties: {
14+
message: {
15+
type: 'text'
16+
}
17+
}
18+
}
19+
}
20+
}
21+
)
22+
puts response
23+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[source, ruby]
2+
----
3+
response = client.connector_sync_job.list(
4+
from: 0,
5+
size: 2
6+
)
7+
puts response
8+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[source, ruby]
2+
----
3+
response = client.connector.put(
4+
connector_id: 'my-connector',
5+
body: {
6+
index_name: 'search-google-drive',
7+
name: 'My Connector',
8+
service_type: 'google_drive'
9+
}
10+
)
11+
puts response
12+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[source, ruby]
2+
----
3+
response = client.search(
4+
index: 'openai-embeddings',
5+
body: {
6+
knn: {
7+
field: 'content_embedding',
8+
query_vector_builder: {
9+
text_embedding: {
10+
model_id: 'openai_embeddings',
11+
model_text: 'Calculate fuel cost'
12+
}
13+
},
14+
k: 10,
15+
num_candidates: 100
16+
},
17+
_source: [
18+
'id',
19+
'content'
20+
]
21+
}
22+
)
23+
puts response
24+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[source, ruby]
2+
----
3+
response = client.indices.put_mapping(
4+
index: 'my-data-stream',
5+
write_index_only: true,
6+
body: {
7+
properties: {
8+
message: {
9+
type: 'text'
10+
}
11+
}
12+
}
13+
)
14+
puts response
15+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[source, ruby]
2+
----
3+
response = client.connector_sync_job.check_in(
4+
connector_sync_job_id: 'my-connector-sync-job'
5+
)
6+
puts response
7+
----

docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
----
33
response = client.search(
44
index: 'books',
5-
body: { query: { match: { name: 'brave' } } }
5+
body: {
6+
query: {
7+
match: {
8+
name: 'brave'
9+
}
10+
}
11+
}
612
)
713
puts response
814
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[source, ruby]
2+
----
3+
response = client.connector_sync_job.delete(
4+
connector_sync_job_id: 'my-connector-sync-job-id'
5+
)
6+
puts response
7+
----

docs/examples/guide/2b23a0e5fc29fa57da48c50b41909951.asciidoc renamed to docs/examples/guide/388ec2b038d3ad69378f4c2e5bc36dce.asciidoc

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ response = client.search(
2424
slop: 5,
2525
in_order: false
2626
}
27+
},
28+
highlight: {
29+
require_field_match: false,
30+
fields: {
31+
"*": {}
32+
}
2733
}
2834
}
2935
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[source, ruby]
2+
----
3+
response = client.indices.put_mapping(
4+
index: 'my-data-stream',
5+
body: {
6+
properties: {
7+
message: {
8+
type: 'text'
9+
}
10+
}
11+
}
12+
)
13+
puts response
14+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[source, ruby]
2+
----
3+
response = client.connector_sync_job.post(
4+
body: {
5+
id: 'connector-id',
6+
job_type: 'full',
7+
trigger_method: 'on_demand'
8+
}
9+
)
10+
puts response
11+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[source, ruby]
2+
----
3+
response = client.connector.update_pipeline(
4+
connector_id: 'my-connector',
5+
body: {
6+
pipeline: {
7+
extract_binary_content: true,
8+
name: 'my-connector-pipeline',
9+
reduce_whitespace: true,
10+
run_ml_inference: true
11+
}
12+
}
13+
)
14+
puts response
15+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[source, ruby]
2+
----
3+
response = client.indices.put_index_template(
4+
name: 'my-data-stream-template',
5+
body: {
6+
index_patterns: [
7+
'my-data-stream*'
8+
],
9+
data_stream: {},
10+
priority: 500,
11+
template: {
12+
settings: {
13+
'index.refresh_interval' => '30s'
14+
}
15+
}
16+
}
17+
)
18+
puts response
19+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[source, ruby]
2+
----
3+
response = client.indices.put_index_template(
4+
name: 'my-data-stream-template',
5+
body: {
6+
index_patterns: [
7+
'my-data-stream*'
8+
],
9+
data_stream: {},
10+
priority: 500,
11+
template: {
12+
mappings: {
13+
properties: {
14+
host: {
15+
properties: {
16+
ip: {
17+
type: 'ip',
18+
ignore_malformed: true
19+
}
20+
}
21+
}
22+
}
23+
}
24+
}
25+
}
26+
)
27+
puts response
28+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[source, ruby]
2+
----
3+
response = client.search(
4+
index: 'my-index',
5+
body: {
6+
query: {
7+
bool: {
8+
should: [
9+
{
10+
text_expansion: {
11+
'ml.inference.title_expanded.predicted_value' => {
12+
model_id: '.elser_model_2',
13+
model_text: 'How is the weather in Jamaica?',
14+
boost: 1
15+
}
16+
}
17+
},
18+
{
19+
text_expansion: {
20+
'ml.inference.description_expanded.predicted_value' => {
21+
model_id: '.elser_model_2',
22+
model_text: 'How is the weather in Jamaica?',
23+
boost: 1
24+
}
25+
}
26+
},
27+
{
28+
multi_match: {
29+
query: 'How is the weather in Jamaica?',
30+
fields: [
31+
'title',
32+
'description'
33+
],
34+
boost: 4
35+
}
36+
}
37+
]
38+
}
39+
}
40+
}
41+
)
42+
puts response
43+
----

docs/examples/guide/0f9a213d2cc4b9c2738446d5a7aee976.asciidoc renamed to docs/examples/guide/50d36787601ebba01fc6266abe3bd415.asciidoc

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ response = client.cluster.put_component_template(
55
body: {
66
template: {
77
settings: {
8-
'index.lifecycle.name' => 'my-lifecycle-policy',
9-
'index.look_ahead_time' => '3h'
8+
'index.lifecycle.name' => 'my-lifecycle-policy'
109
}
1110
},
1211
_meta: {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[source, ruby]
2+
----
3+
response = client.connector.last_sync(
4+
connector_id: 'my-connector',
5+
body: {
6+
last_access_control_sync_error: 'Houston, we have a problem!',
7+
last_access_control_sync_scheduled_at: '2023-11-09T15:13:08.231Z',
8+
last_access_control_sync_status: 'pending',
9+
last_deleted_document_count: 42,
10+
last_incremental_sync_scheduled_at: '2023-11-09T15:13:08.231Z',
11+
last_indexed_document_count: 42,
12+
last_sync_error: 'Houston, we have a problem!',
13+
last_sync_scheduled_at: '2024-11-09T15:13:08.231Z',
14+
last_sync_status: 'completed',
15+
last_synced: '2024-11-09T15:13:08.231Z'
16+
}
17+
)
18+
puts response
19+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[source, ruby]
2+
----
3+
response = client.reindex(
4+
wait_for_completion: false,
5+
body: {
6+
source: {
7+
index: 'test-data',
8+
size: 50
9+
},
10+
dest: {
11+
index: 'openai-embeddings',
12+
pipeline: 'openai_embeddings'
13+
}
14+
}
15+
)
16+
puts response
17+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[source, ruby]
2+
----
3+
response = client.indices.put_index_template(
4+
name: 'my-data-stream-template',
5+
body: {
6+
index_patterns: [
7+
'my-data-stream*'
8+
],
9+
data_stream: {},
10+
priority: 500,
11+
template: {
12+
settings: {
13+
'sort.field' => [
14+
'@timestamp'
15+
],
16+
'sort.order' => [
17+
'desc'
18+
]
19+
}
20+
}
21+
}
22+
)
23+
puts response
24+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[source, ruby]
2+
----
3+
response = client.connector_sync_job.list(
4+
status: 'pending'
5+
)
6+
puts response
7+
----

0 commit comments

Comments
 (0)