diff --git a/docs/examples/guide/0350410d11579f4e876c798ce1eaef5b.asciidoc b/docs/examples/guide/0350410d11579f4e876c798ce1eaef5b.asciidoc new file mode 100644 index 0000000000..4382f16605 --- /dev/null +++ b/docs/examples/guide/0350410d11579f4e876c798ce1eaef5b.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/f743225f1abcbc341e991a0e79ea89bc.asciidoc b/docs/examples/guide/2310d84ebf113f2a3ed14cc53172ae4a.asciidoc similarity index 86% rename from docs/examples/guide/f743225f1abcbc341e991a0e79ea89bc.asciidoc rename to docs/examples/guide/2310d84ebf113f2a3ed14cc53172ae4a.asciidoc index 6ea9c7ce50..937d675bcd 100644 --- a/docs/examples/guide/f743225f1abcbc341e991a0e79ea89bc.asciidoc +++ b/docs/examples/guide/2310d84ebf113f2a3ed14cc53172ae4a.asciidoc @@ -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?' } } diff --git a/docs/examples/guide/2e93eaaebf75fa4a2451e8a76ffa9f20.asciidoc b/docs/examples/guide/2e93eaaebf75fa4a2451e8a76ffa9f20.asciidoc new file mode 100644 index 0000000000..5588366d70 --- /dev/null +++ b/docs/examples/guide/2e93eaaebf75fa4a2451e8a76ffa9f20.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/33d480fc6812ada75756cf5337bc9092.asciidoc b/docs/examples/guide/33d480fc6812ada75756cf5337bc9092.asciidoc new file mode 100644 index 0000000000..72b2f4150e --- /dev/null +++ b/docs/examples/guide/33d480fc6812ada75756cf5337bc9092.asciidoc @@ -0,0 +1,8 @@ +[source, ruby] +---- +response = client.connector_sync_job.list( + from: 0, + size: 2 +) +puts response +---- diff --git a/docs/examples/guide/342ddf9121aeddd82fea2464665e25da.asciidoc b/docs/examples/guide/342ddf9121aeddd82fea2464665e25da.asciidoc new file mode 100644 index 0000000000..974b1eb6e5 --- /dev/null +++ b/docs/examples/guide/342ddf9121aeddd82fea2464665e25da.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/34d63740b58209a3d031212909743925.asciidoc b/docs/examples/guide/34d63740b58209a3d031212909743925.asciidoc new file mode 100644 index 0000000000..ae713fef54 --- /dev/null +++ b/docs/examples/guide/34d63740b58209a3d031212909743925.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/360b3cef34bbddc5d9579ca95f0cb061.asciidoc b/docs/examples/guide/360b3cef34bbddc5d9579ca95f0cb061.asciidoc new file mode 100644 index 0000000000..ea8c543dfd --- /dev/null +++ b/docs/examples/guide/360b3cef34bbddc5d9579ca95f0cb061.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/365256ebdfa47b449780771d9beba8d9.asciidoc b/docs/examples/guide/365256ebdfa47b449780771d9beba8d9.asciidoc new file mode 100644 index 0000000000..226c34ee7d --- /dev/null +++ b/docs/examples/guide/365256ebdfa47b449780771d9beba8d9.asciidoc @@ -0,0 +1,7 @@ +[source, ruby] +---- +response = client.connector_sync_job.check_in( + connector_sync_job_id: 'my-connector-sync-job' +) +puts response +---- diff --git a/docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc b/docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc index 718fd3338a..0147fe261d 100644 --- a/docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc +++ b/docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc @@ -2,7 +2,13 @@ ---- response = client.search( index: 'books', - body: { query: { match: { name: 'brave' } } } + body: { + query: { + match: { + name: 'brave' + } + } + } ) puts response ---- diff --git a/docs/examples/guide/370b297ed3433577adf53e64f572d89d.asciidoc b/docs/examples/guide/370b297ed3433577adf53e64f572d89d.asciidoc new file mode 100644 index 0000000000..0f8fbcd7ea --- /dev/null +++ b/docs/examples/guide/370b297ed3433577adf53e64f572d89d.asciidoc @@ -0,0 +1,7 @@ +[source, ruby] +---- +response = client.connector_sync_job.delete( + connector_sync_job_id: 'my-connector-sync-job-id' +) +puts response +---- diff --git a/docs/examples/guide/2b23a0e5fc29fa57da48c50b41909951.asciidoc b/docs/examples/guide/388ec2b038d3ad69378f4c2e5bc36dce.asciidoc similarity index 84% rename from docs/examples/guide/2b23a0e5fc29fa57da48c50b41909951.asciidoc rename to docs/examples/guide/388ec2b038d3ad69378f4c2e5bc36dce.asciidoc index a414e5a245..3ac6f22168 100644 --- a/docs/examples/guide/2b23a0e5fc29fa57da48c50b41909951.asciidoc +++ b/docs/examples/guide/388ec2b038d3ad69378f4c2e5bc36dce.asciidoc @@ -24,6 +24,12 @@ response = client.search( slop: 5, in_order: false } + }, + highlight: { + require_field_match: false, + fields: { + "*": {} + } } } ) diff --git a/docs/examples/guide/3e4227250d49e81df48773f8ba803ea7.asciidoc b/docs/examples/guide/3e4227250d49e81df48773f8ba803ea7.asciidoc new file mode 100644 index 0000000000..b1a1e477b1 --- /dev/null +++ b/docs/examples/guide/3e4227250d49e81df48773f8ba803ea7.asciidoc @@ -0,0 +1,14 @@ +[source, ruby] +---- +response = client.indices.put_mapping( + index: 'my-data-stream', + body: { + properties: { + message: { + type: 'text' + } + } + } +) +puts response +---- diff --git a/docs/examples/guide/405ac843a9156d3cab374e199cac87fb.asciidoc b/docs/examples/guide/405ac843a9156d3cab374e199cac87fb.asciidoc new file mode 100644 index 0000000000..abaa0f805b --- /dev/null +++ b/docs/examples/guide/405ac843a9156d3cab374e199cac87fb.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/41175d304e660da2931764f9a4418fd3.asciidoc b/docs/examples/guide/41175d304e660da2931764f9a4418fd3.asciidoc new file mode 100644 index 0000000000..4ea20b6a83 --- /dev/null +++ b/docs/examples/guide/41175d304e660da2931764f9a4418fd3.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/46103fee3cd5f53dc75123def82d52ad.asciidoc b/docs/examples/guide/46103fee3cd5f53dc75123def82d52ad.asciidoc new file mode 100644 index 0000000000..29176ceb6c --- /dev/null +++ b/docs/examples/guide/46103fee3cd5f53dc75123def82d52ad.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/4be20da16d2b58216e8b307218c7bf3a.asciidoc b/docs/examples/guide/4be20da16d2b58216e8b307218c7bf3a.asciidoc new file mode 100644 index 0000000000..8410d14978 --- /dev/null +++ b/docs/examples/guide/4be20da16d2b58216e8b307218c7bf3a.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/4fcca1687d7b2cf08de526539fea5a76.asciidoc b/docs/examples/guide/4fcca1687d7b2cf08de526539fea5a76.asciidoc new file mode 100644 index 0000000000..43ce1972c3 --- /dev/null +++ b/docs/examples/guide/4fcca1687d7b2cf08de526539fea5a76.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/0f9a213d2cc4b9c2738446d5a7aee976.asciidoc b/docs/examples/guide/50d36787601ebba01fc6266abe3bd415.asciidoc similarity index 73% rename from docs/examples/guide/0f9a213d2cc4b9c2738446d5a7aee976.asciidoc rename to docs/examples/guide/50d36787601ebba01fc6266abe3bd415.asciidoc index f892a27d88..71108a2766 100644 --- a/docs/examples/guide/0f9a213d2cc4b9c2738446d5a7aee976.asciidoc +++ b/docs/examples/guide/50d36787601ebba01fc6266abe3bd415.asciidoc @@ -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: { diff --git a/docs/examples/guide/640621cea39cdeeb76fbc95bff31a18d.asciidoc b/docs/examples/guide/640621cea39cdeeb76fbc95bff31a18d.asciidoc new file mode 100644 index 0000000000..c3710d0691 --- /dev/null +++ b/docs/examples/guide/640621cea39cdeeb76fbc95bff31a18d.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/65e892a362d940e4a74965f21c15ca09.asciidoc b/docs/examples/guide/65e892a362d940e4a74965f21c15ca09.asciidoc new file mode 100644 index 0000000000..41754cb744 --- /dev/null +++ b/docs/examples/guide/65e892a362d940e4a74965f21c15ca09.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/6843d859e2965d17cad4f033c81db83f.asciidoc b/docs/examples/guide/6843d859e2965d17cad4f033c81db83f.asciidoc new file mode 100644 index 0000000000..2ee2a2cd46 --- /dev/null +++ b/docs/examples/guide/6843d859e2965d17cad4f033c81db83f.asciidoc @@ -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 +---- diff --git a/docs/examples/guide/6b8c5c8145c287c4fc535fa57ccf95a7.asciidoc b/docs/examples/guide/6b8c5c8145c287c4fc535fa57ccf95a7.asciidoc new file mode 100644 index 0000000000..b0c88741cb --- /dev/null +++ b/docs/examples/guide/6b8c5c8145c287c4fc535fa57ccf95a7.asciidoc @@ -0,0 +1,7 @@ +[source, ruby] +---- +response = client.connector_sync_job.list( + status: 'pending' +) +puts response +---- diff --git a/docs/examples/guide/8bf1e7a6d529547906ba8b1d6501fa0c.asciidoc b/docs/examples/guide/8bf1e7a6d529547906ba8b1d6501fa0c.asciidoc new file mode 100644 index 0000000000..67333da3bb --- /dev/null +++ b/docs/examples/guide/8bf1e7a6d529547906ba8b1d6501fa0c.asciidoc @@ -0,0 +1,10 @@ +[source, ruby] +---- +response = client.connector_sync_job.error( + connector_sync_job_id: 'my-connector-sync-job', + body: { + error: 'some-error' + } +) +puts response +---- diff --git a/docs/examples/guide/8e89fee0be6a436c4e3d7c152659c47e.asciidoc b/docs/examples/guide/8e89fee0be6a436c4e3d7c152659c47e.asciidoc new file mode 100644 index 0000000000..412cbd8e26 --- /dev/null +++ b/docs/examples/guide/8e89fee0be6a436c4e3d7c152659c47e.asciidoc @@ -0,0 +1,23 @@ +[source, ruby] +---- +response = client.connector.update_scheduling( + connector_id: 'my-connector', + body: { + scheduling: { + access_control: { + enabled: true, + interval: '0 10 0 * * ?' + }, + full: { + enabled: true, + interval: '0 20 0 * * ?' + }, + incremental: { + enabled: false, + interval: '0 30 0 * * ?' + } + } + } +) +puts response +---- diff --git a/docs/examples/guide/90083d93e46fad2524755b8d4d1306fc.asciidoc b/docs/examples/guide/90083d93e46fad2524755b8d4d1306fc.asciidoc new file mode 100644 index 0000000000..65d23a7431 --- /dev/null +++ b/docs/examples/guide/90083d93e46fad2524755b8d4d1306fc.asciidoc @@ -0,0 +1,14 @@ +[source, ruby] +---- +response = client.connector_sync_job.update_stats( + connector_sync_job_id: 'my-connector-sync-job', + body: { + deleted_document_count: 10, + indexed_document_count: 20, + indexed_document_volume: 1000, + total_document_count: 2000, + last_seen: '2023-01-02T10:00:00Z' + } +) +puts response +---- diff --git a/docs/examples/guide/98f83f0dc4634e108ab0db6db347b2c7.asciidoc b/docs/examples/guide/98f83f0dc4634e108ab0db6db347b2c7.asciidoc new file mode 100644 index 0000000000..e7035bef28 --- /dev/null +++ b/docs/examples/guide/98f83f0dc4634e108ab0db6db347b2c7.asciidoc @@ -0,0 +1,7 @@ +[source, ruby] +---- +response = client.connector.delete( + connector_id: 'my-connector' +) +puts response +---- diff --git a/docs/examples/guide/9b0f34d122a4b348dc86df7410d6ebb6.asciidoc b/docs/examples/guide/9b0f34d122a4b348dc86df7410d6ebb6.asciidoc new file mode 100644 index 0000000000..1192f98675 --- /dev/null +++ b/docs/examples/guide/9b0f34d122a4b348dc86df7410d6ebb6.asciidoc @@ -0,0 +1,7 @@ +[source, ruby] +---- +response = client.connector_sync_job.cancel( + connector_sync_job_id: 'my-connector-sync-job-id' +) +puts response +---- diff --git a/docs/examples/guide/a53ff77d83222c0e76453e630d64787e.asciidoc b/docs/examples/guide/a53ff77d83222c0e76453e630d64787e.asciidoc new file mode 100644 index 0000000000..446177b2b5 --- /dev/null +++ b/docs/examples/guide/a53ff77d83222c0e76453e630d64787e.asciidoc @@ -0,0 +1,20 @@ +[source, ruby] +---- +response = client.ingest.put_pipeline( + id: 'openai_embeddings', + body: { + processors: [ + { + inference: { + model_id: 'openai_embeddings', + input_output: { + input_field: 'content', + output_field: 'content_embedding' + } + } + } + ] + } +) +puts response +---- diff --git a/docs/examples/guide/a960b43e720b4934edb74ab4b085ca77.asciidoc b/docs/examples/guide/a960b43e720b4934edb74ab4b085ca77.asciidoc new file mode 100644 index 0000000000..124637796e --- /dev/null +++ b/docs/examples/guide/a960b43e720b4934edb74ab4b085ca77.asciidoc @@ -0,0 +1,5 @@ +[source, ruby] +---- +response = client.connector.list +puts response +---- diff --git a/docs/examples/guide/bc2feb70658f028d5d0418ae4ac9662f.asciidoc b/docs/examples/guide/bc2feb70658f028d5d0418ae4ac9662f.asciidoc new file mode 100644 index 0000000000..4e19205736 --- /dev/null +++ b/docs/examples/guide/bc2feb70658f028d5d0418ae4ac9662f.asciidoc @@ -0,0 +1,26 @@ +[source, ruby] +---- +response = client.connector.update_configuration( + connector_id: 'my-connector', + body: { + configuration: { + service_account_credentials: { + default_value: nil, + depends_on: [], + display: 'textarea', + label: 'Google Drive service account JSON', + options: [], + order: 1, + required: true, + sensitive: true, + tooltip: 'This connectors authenticates as a service account to synchronize content from Google Drive.', + type: 'str', + ui_restrictions: [], + validations: [], + value: '...service account JSON...' + } + } + } +) +puts response +---- diff --git a/docs/examples/guide/c00c9412609832ebceb9e786dd9542df.asciidoc b/docs/examples/guide/c00c9412609832ebceb9e786dd9542df.asciidoc new file mode 100644 index 0000000000..9de66a6634 --- /dev/null +++ b/docs/examples/guide/c00c9412609832ebceb9e786dd9542df.asciidoc @@ -0,0 +1,11 @@ +[source, ruby] +---- +response = client.connector.update_name( + connector_id: 'my-connector', + body: { + name: 'Custom connector', + description: 'This is my customized connector' + } +) +puts response +---- diff --git a/docs/examples/guide/c12d6e962f083c728f9397932f05202e.asciidoc b/docs/examples/guide/c12d6e962f083c728f9397932f05202e.asciidoc new file mode 100644 index 0000000000..e0e1e833c0 --- /dev/null +++ b/docs/examples/guide/c12d6e962f083c728f9397932f05202e.asciidoc @@ -0,0 +1,7 @@ +[source, ruby] +---- +response = client.connector_sync_job.list( + connector_id: 'connector-1' +) +puts response +---- diff --git a/docs/examples/guide/c4e29dde9a3e497c69aec02b61c0d322.asciidoc b/docs/examples/guide/c4e29dde9a3e497c69aec02b61c0d322.asciidoc new file mode 100644 index 0000000000..e931ec0b26 --- /dev/null +++ b/docs/examples/guide/c4e29dde9a3e497c69aec02b61c0d322.asciidoc @@ -0,0 +1,60 @@ +[source, ruby] +---- +response = client.connector.update_filtering( + connector_id: 'my-connector', + body: { + filtering: [ + { + active: { + advanced_snippet: { + created_at: '2023-11-09T15:13:08.231Z', + updated_at: '2023-11-09T15:13:08.231Z', + value: {} + }, + rules: [ + { + created_at: '2023-11-09T15:13:08.231Z', + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: '2023-11-09T15:13:08.231Z', + value: '.*' + } + ], + validation: { + errors: [], + state: 'valid' + } + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: '2023-11-09T15:13:08.231Z', + updated_at: '2023-11-09T15:13:08.231Z', + value: {} + }, + rules: [ + { + created_at: '2023-11-09T15:13:08.231Z', + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: '2023-11-09T15:13:08.231Z', + value: '.*' + } + ], + validation: { + errors: [], + state: 'valid' + } + } + } + ] + } +) +puts response +---- diff --git a/docs/examples/guide/cb0f3eea39612a694d47a57aee93956f.asciidoc b/docs/examples/guide/cb0f3eea39612a694d47a57aee93956f.asciidoc new file mode 100644 index 0000000000..1b7674facf --- /dev/null +++ b/docs/examples/guide/cb0f3eea39612a694d47a57aee93956f.asciidoc @@ -0,0 +1,8 @@ +[source, ruby] +---- +response = client.connector.list( + from: 0, + size: 2 +) +puts response +---- diff --git a/docs/examples/guide/cdce7bc083dfb36e6f1d465a5c9d5049.asciidoc b/docs/examples/guide/cdce7bc083dfb36e6f1d465a5c9d5049.asciidoc new file mode 100644 index 0000000000..4db8dce241 --- /dev/null +++ b/docs/examples/guide/cdce7bc083dfb36e6f1d465a5c9d5049.asciidoc @@ -0,0 +1,5 @@ +[source, ruby] +---- +response = client.connector_sync_job.list +puts response +---- diff --git a/docs/examples/guide/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc b/docs/examples/guide/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc new file mode 100644 index 0000000000..82556abd34 --- /dev/null +++ b/docs/examples/guide/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc @@ -0,0 +1,14 @@ +[source, ruby] +---- +response = client.connector.put( + connector_id: 'my-connector', + body: { + index_name: 'search-google-drive', + name: 'My Connector', + description: 'My Connector to sync data to Elastic index from Google Drive', + service_type: 'google_drive', + language: 'english' + } +) +puts response +---- diff --git a/docs/examples/guide/d03139a851888db53f8b7affd85eb495.asciidoc b/docs/examples/guide/d03139a851888db53f8b7affd85eb495.asciidoc new file mode 100644 index 0000000000..b2689578e1 --- /dev/null +++ b/docs/examples/guide/d03139a851888db53f8b7affd85eb495.asciidoc @@ -0,0 +1,7 @@ +[source, ruby] +---- +response = client.connector.check_in( + connector_id: 'my-connector' +) +puts response +---- diff --git a/docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc b/docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc index 31b2253437..ba6b1c7ee4 100644 --- a/docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc +++ b/docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc @@ -2,16 +2,61 @@ ---- response = client.bulk( body: [ - { index: { _index: 'books' } }, - { name: 'Revelation Space', author: 'Alastair Reynolds', release_date: '2000-03-15', page_count: 585}, - { index: { _index: 'books' } }, - { name: '1984', author: 'George Orwell', release_date: '1985-06-01', page_count: 328}, - { index: { _index: 'books' } }, - { name: 'Fahrenheit 451', author: 'Ray Bradbury', release_date: '1953-10-15', page_count: 227}, - { index: { _index: 'books' } }, - { name: 'Brave New World', author: 'Aldous Huxley', release_date: '1932-06-01', page_count: 268}, - { index: { _index: 'books' } }, - { name: 'The Handmaids Tale', author: 'Margaret Atwood', release_date: '1985-06-01', page_count: 311} + { + index: { + _index: 'books' + } + }, + { + name: 'Revelation Space', + author: 'Alastair Reynolds', + release_date: '2000-03-15', + page_count: 585 + }, + { + index: { + _index: 'books' + } + }, + { + name: '1984', + author: 'George Orwell', + release_date: '1985-06-01', + page_count: 328 + }, + { + index: { + _index: 'books' + } + }, + { + name: 'Fahrenheit 451', + author: 'Ray Bradbury', + release_date: '1953-10-15', + page_count: 227 + }, + { + index: { + _index: 'books' + } + }, + { + name: 'Brave New World', + author: 'Aldous Huxley', + release_date: '1932-06-01', + page_count: 268 + }, + { + index: { + _index: 'books' + } + }, + { + name: 'The Handmaids Tale', + author: 'Margaret Atwood', + release_date: '1985-06-01', + page_count: 311 + } ] ) puts response diff --git a/docs/examples/guide/e2a753029b450942a3228e3003a55a7d.asciidoc b/docs/examples/guide/e2a753029b450942a3228e3003a55a7d.asciidoc new file mode 100644 index 0000000000..7591a7ad90 --- /dev/null +++ b/docs/examples/guide/e2a753029b450942a3228e3003a55a7d.asciidoc @@ -0,0 +1,19 @@ +[source, ruby] +---- +response = client.indices.put_data_lifecycle( + name: 'my-weather-sensor-data-stream', + body: { + downsampling: [ + { + after: '1d', + fixed_interval: '10m' + }, + { + after: '7d', + fixed_interval: '1d' + } + ] + } +) +puts response +---- diff --git a/docs/examples/guide/e301695a514a13abd98c1fe51360fa85.asciidoc b/docs/examples/guide/e301695a514a13abd98c1fe51360fa85.asciidoc deleted file mode 100644 index 33042f946b..0000000000 --- a/docs/examples/guide/e301695a514a13abd98c1fe51360fa85.asciidoc +++ /dev/null @@ -1,17 +0,0 @@ -[source, ruby] ----- -response = client.indices.put_mapping( - index: 'my-index-0001', - body: { - properties: { - 'ml.inference.summary.predicted_value' => { - type: 'dense_vector', - dims: 768, - index: true, - similarity: 'dot_product' - } - } - } -) -puts response ----- diff --git a/docs/examples/guide/e8b0d0911b179355435d02fa9057fda8.asciidoc b/docs/examples/guide/e8b0d0911b179355435d02fa9057fda8.asciidoc new file mode 100644 index 0000000000..0456abf509 --- /dev/null +++ b/docs/examples/guide/e8b0d0911b179355435d02fa9057fda8.asciidoc @@ -0,0 +1,22 @@ +[source, ruby] +---- +response = client.indices.create( + index: 'openai-embeddings', + body: { + mappings: { + properties: { + content_embedding: { + type: 'dense_vector', + dims: 1536, + element_type: 'byte', + similarity: 'dot_product' + }, + content: { + type: 'text' + } + } + } + } +) +puts response +---- diff --git a/docs/examples/guide/ecfd0d94dd14ef05dfa861f22544b388.asciidoc b/docs/examples/guide/ecfd0d94dd14ef05dfa861f22544b388.asciidoc new file mode 100644 index 0000000000..cb49956e46 --- /dev/null +++ b/docs/examples/guide/ecfd0d94dd14ef05dfa861f22544b388.asciidoc @@ -0,0 +1,10 @@ +[source, ruby] +---- +response = client.connector.update_error( + connector_id: 'my-connector', + body: { + error: 'Houston, we have a problem!' + } +) +puts response +---- diff --git a/docs/examples/guide/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc b/docs/examples/guide/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc new file mode 100644 index 0000000000..a4b6902fbe --- /dev/null +++ b/docs/examples/guide/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc @@ -0,0 +1,7 @@ +[source, ruby] +---- +response = client.connector.get( + connector_id: 'my-connector' +) +puts response +---- diff --git a/docs/examples/guide/f785b5d17eb59f8d2a353c2dee66eb5b.asciidoc b/docs/examples/guide/f785b5d17eb59f8d2a353c2dee66eb5b.asciidoc new file mode 100644 index 0000000000..c479d1f735 --- /dev/null +++ b/docs/examples/guide/f785b5d17eb59f8d2a353c2dee66eb5b.asciidoc @@ -0,0 +1,7 @@ +[source, ruby] +---- +response = client.connector_sync_job.get( + connector_sync_job_id: 'my-connector-sync-job' +) +puts response +----