Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fb1a42cadc | |||
| e3863d7b77 | |||
| 424cc94458 | |||
| 7aca5cf652 | |||
| a8927727b1 | |||
| 15a450eba4 | |||
| 8f028a522a | |||
| 411f379006 | |||
| 242b4227ee | |||
| 78332da539 | |||
| 62b2d78b15 |
@ -125,6 +125,13 @@ async function codegen (args) {
|
||||
await $`cp -R ${join(import.meta.url, '..', '..', 'elastic-client-generator-js', 'output')}/* ${join(import.meta.url, '..', 'src', 'api')}`
|
||||
await $`mv ${join(import.meta.url, '..', 'src', 'api', 'reference.asciidoc')} ${join(import.meta.url, '..', 'docs', 'reference.asciidoc')}`
|
||||
await $`npm run build`
|
||||
|
||||
// run docs example generation
|
||||
if (version === 'main') {
|
||||
await $`node ./scripts/generate-docs-examples.js`
|
||||
} else {
|
||||
await $`node ./scripts/generate-docs-examples.js ${version.split('.').slice(0, 2).join('.')}`
|
||||
}
|
||||
}
|
||||
|
||||
function onError (err) {
|
||||
|
||||
18
.github/workflows/auto-merge.yml
vendored
Normal file
18
.github/workflows/auto-merge.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
name: Automerge
|
||||
|
||||
on:
|
||||
pull_request_review:
|
||||
types:
|
||||
- submitted
|
||||
|
||||
jobs:
|
||||
automerge:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.review.state == 'approved'
|
||||
steps:
|
||||
- uses: reitermarkus/automerge@v2
|
||||
with:
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
merge-method: squash
|
||||
pull-request-author-associations: OWNER
|
||||
review-author-associations: OWNER,CONTRIBUTOR
|
||||
2
.github/workflows/nodejs.yml
vendored
2
.github/workflows/nodejs.yml
vendored
@ -2,7 +2,7 @@
|
||||
name: Node CI
|
||||
|
||||
on:
|
||||
pull_request_target: {}
|
||||
pull_request: {}
|
||||
|
||||
jobs:
|
||||
paths-filter:
|
||||
|
||||
@ -1,6 +1,17 @@
|
||||
[[changelog-client]]
|
||||
== Release notes
|
||||
|
||||
[discrete]
|
||||
=== 8.15.1
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Improved support for Elasticsearch `v8.15`
|
||||
|
||||
Updated TypeScript types based on fixes and improvements to the Elasticsearch specification.
|
||||
|
||||
[discrete]
|
||||
=== 8.15.0
|
||||
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_inference/text_embedding/my-e5-model",
|
||||
body: {
|
||||
const response = await client.inference.put({
|
||||
task_type: "text_embedding",
|
||||
inference_id: "my-e5-model",
|
||||
inference_config: {
|
||||
service: "elasticsearch",
|
||||
service_settings: {
|
||||
num_allocations: 1,
|
||||
|
||||
@ -26,7 +26,7 @@ const response1 = await client.cluster.putComponentTemplate({
|
||||
type: "keyword",
|
||||
script: {
|
||||
source:
|
||||
"emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))",
|
||||
"emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH))",
|
||||
},
|
||||
},
|
||||
},
|
||||
12
docs/doc_examples/01cd0ea360282a2c591a366679d7187d.asciidoc
Normal file
12
docs/doc_examples/01cd0ea360282a2c591a366679d7187d.asciidoc
Normal file
@ -0,0 +1,12 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.tasks.list({
|
||||
human: "true",
|
||||
detailed: "true",
|
||||
actions: "indices:data/write/bulk",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,13 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_connector/my-connector/_api_key_id",
|
||||
body: {
|
||||
api_key_id: "my-api-key-id",
|
||||
api_key_secret_id: "my-connector-secret-id",
|
||||
},
|
||||
const response = await client.connector.updateApiKeyId({
|
||||
connector_id: "my-connector",
|
||||
api_key_id: "my-api-key-id",
|
||||
api_key_secret_id: "my-connector-secret-id",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_inference/text_embedding/google_vertex_ai_embeddings",
|
||||
body: {
|
||||
const response = await client.inference.put({
|
||||
task_type: "text_embedding",
|
||||
inference_id: "google_vertex_ai_embeddings",
|
||||
inference_config: {
|
||||
service: "googlevertexai",
|
||||
service_settings: {
|
||||
service_account_json: "<service_account_json>",
|
||||
|
||||
21
docs/doc_examples/05e637284bc3bedd46e0b7c26ad983c4.asciidoc
Normal file
21
docs/doc_examples/05e637284bc3bedd46e0b7c26ad983c4.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.ingest.putPipeline({
|
||||
id: "alibabacloud_ai_search_embeddings_pipeline",
|
||||
processors: [
|
||||
{
|
||||
inference: {
|
||||
model_id: "alibabacloud_ai_search_embeddings",
|
||||
input_output: {
|
||||
input_field: "content",
|
||||
output_field: "content_embedding",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
23
docs/doc_examples/083b92e8ea264e49bf9fd40fc6a3094b.asciidoc
Normal file
23
docs/doc_examples/083b92e8ea264e49bf9fd40fc6a3094b.asciidoc
Normal file
@ -0,0 +1,23 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.inference.put({
|
||||
task_type: "text_embedding",
|
||||
inference_id: "my-e5-model",
|
||||
inference_config: {
|
||||
service: "elasticsearch",
|
||||
service_settings: {
|
||||
adaptive_allocations: {
|
||||
enabled: true,
|
||||
min_number_of_allocations: 3,
|
||||
max_number_of_allocations: 10,
|
||||
},
|
||||
num_threads: 1,
|
||||
model_id: ".multilingual-e5-small",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_inference/text_embedding/amazon_bedrock_embeddings",
|
||||
body: {
|
||||
const response = await client.inference.put({
|
||||
task_type: "text_embedding",
|
||||
inference_id: "amazon_bedrock_embeddings",
|
||||
inference_config: {
|
||||
service: "amazonbedrock",
|
||||
service_settings: {
|
||||
access_key: "<aws_access_key>",
|
||||
|
||||
@ -3,29 +3,26 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_connector/my-g-drive-connector/_filtering",
|
||||
body: {
|
||||
rules: [
|
||||
{
|
||||
field: "file_extension",
|
||||
id: "exclude-txt-files",
|
||||
order: 0,
|
||||
policy: "exclude",
|
||||
rule: "equals",
|
||||
value: "txt",
|
||||
},
|
||||
{
|
||||
field: "_",
|
||||
id: "DEFAULT",
|
||||
order: 1,
|
||||
policy: "include",
|
||||
rule: "regex",
|
||||
value: ".*",
|
||||
},
|
||||
],
|
||||
},
|
||||
const response = await client.connector.updateFiltering({
|
||||
connector_id: "my-g-drive-connector",
|
||||
rules: [
|
||||
{
|
||||
field: "file_extension",
|
||||
id: "exclude-txt-files",
|
||||
order: 0,
|
||||
policy: "exclude",
|
||||
rule: "equals",
|
||||
value: "txt",
|
||||
},
|
||||
{
|
||||
field: "_",
|
||||
id: "DEFAULT",
|
||||
order: 1,
|
||||
policy: "include",
|
||||
rule: "regex",
|
||||
value: ".*",
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -10,7 +10,7 @@ const response = await client.search({
|
||||
type: "keyword",
|
||||
script: {
|
||||
source:
|
||||
"emit(doc['@timestamp'].value.dayOfWeekEnum\n .getDisplayName(TextStyle.FULL, Locale.ROOT))",
|
||||
"emit(doc['@timestamp'].value.dayOfWeekEnum\n .getDisplayName(TextStyle.FULL, Locale.ENGLISH))",
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -5,6 +5,21 @@
|
||||
----
|
||||
const response = await client.searchApplication.renderQuery({
|
||||
name: "my-app",
|
||||
body: {
|
||||
params: {
|
||||
query_string: "my first query",
|
||||
text_fields: [
|
||||
{
|
||||
name: "title",
|
||||
boost: 5,
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
boost: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
20
docs/doc_examples/0fbca60a487f5f22a4d51d73b2434cc4.asciidoc
Normal file
20
docs/doc_examples/0fbca60a487f5f22a4d51d73b2434cc4.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "elser-embeddings",
|
||||
mappings: {
|
||||
properties: {
|
||||
content_embedding: {
|
||||
type: "sparse_vector",
|
||||
},
|
||||
content: {
|
||||
type: "text",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -5,6 +5,11 @@
|
||||
----
|
||||
const response = await client.security.queryUser({
|
||||
with_profile_uid: "true",
|
||||
query: {
|
||||
prefix: {
|
||||
roles: "other",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
15
docs/doc_examples/11be807bdeaeecc8174dec88e0851ea7.asciidoc
Normal file
15
docs/doc_examples/11be807bdeaeecc8174dec88e0851ea7.asciidoc
Normal file
@ -0,0 +1,15 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "GET",
|
||||
path: "/_connector/_sync_job",
|
||||
querystring: {
|
||||
connector_id: "my-connector-id",
|
||||
size: "1",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
18
docs/doc_examples/12e9e758f7f18a6cbf27e9d0aea57a19.asciidoc
Normal file
18
docs/doc_examples/12e9e758f7f18a6cbf27e9d0aea57a19.asciidoc
Normal file
@ -0,0 +1,18 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.update({
|
||||
index: ".elastic-connectors",
|
||||
id: "connector_id",
|
||||
doc: {
|
||||
features: {
|
||||
native_connector_api_keys: {
|
||||
enabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,13 +3,11 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_inference/sparse_embedding/my-elser-model",
|
||||
body: {
|
||||
input:
|
||||
"The sky above the port was the color of television tuned to a dead channel.",
|
||||
},
|
||||
const response = await client.inference.inference({
|
||||
task_type: "sparse_embedding",
|
||||
inference_id: "my-elser-model",
|
||||
input:
|
||||
"The sky above the port was the color of television tuned to a dead channel.",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
25
docs/doc_examples/13fd7a99c5cf53279409ecc679084f87.asciidoc
Normal file
25
docs/doc_examples/13fd7a99c5cf53279409ecc679084f87.asciidoc
Normal file
@ -0,0 +1,25 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx_keep",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
properties: {
|
||||
path: {
|
||||
type: "object",
|
||||
synthetic_source_keep: "all",
|
||||
},
|
||||
ids: {
|
||||
type: "integer",
|
||||
synthetic_source_keep: "arrays",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
23
docs/doc_examples/13fe12cdb73bc89f07a83f1e6b127511.asciidoc
Normal file
23
docs/doc_examples/13fe12cdb73bc89f07a83f1e6b127511.asciidoc
Normal file
@ -0,0 +1,23 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "google-vertex-ai-embeddings",
|
||||
mappings: {
|
||||
properties: {
|
||||
content_embedding: {
|
||||
type: "dense_vector",
|
||||
dims: 768,
|
||||
element_type: "float",
|
||||
similarity: "dot_product",
|
||||
},
|
||||
content: {
|
||||
type: "text",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
12
docs/doc_examples/14a33c364873c2f930ca83d0a3005389.asciidoc
Normal file
12
docs/doc_examples/14a33c364873c2f930ca83d0a3005389.asciidoc
Normal file
@ -0,0 +1,12 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.cluster.allocationExplain({
|
||||
index: "my-index",
|
||||
shard: 0,
|
||||
primary: false,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
19
docs/doc_examples/1522a9297151d7046e6345b9b27539ca.asciidoc
Normal file
19
docs/doc_examples/1522a9297151d7046e6345b9b27539ca.asciidoc
Normal file
@ -0,0 +1,19 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.connector.updateConfiguration({
|
||||
connector_id: "my-connector-id",
|
||||
values: {
|
||||
host: "127.0.0.1",
|
||||
port: 5432,
|
||||
username: "myuser",
|
||||
password: "mypassword",
|
||||
database: "chinook",
|
||||
schema: "public",
|
||||
tables: "album,artist",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
15
docs/doc_examples/16a7ce08b4a6b3af269f27eecc71d664.asciidoc
Normal file
15
docs/doc_examples/16a7ce08b4a6b3af269f27eecc71d664.asciidoc
Normal file
@ -0,0 +1,15 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.delete({
|
||||
index: "books",
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.indices.delete({
|
||||
index: "my-explicit-mappings-books",
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
26
docs/doc_examples/17316a81c9dbdd120b7754116bf0461c.asciidoc
Normal file
26
docs/doc_examples/17316a81c9dbdd120b7754116bf0461c.asciidoc
Normal file
@ -0,0 +1,26 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.security.createApiKey({
|
||||
name: "my-connector-api-key",
|
||||
role_descriptors: {
|
||||
"my-connector-connector-role": {
|
||||
cluster: ["monitor", "manage_connector"],
|
||||
indices: [
|
||||
{
|
||||
names: [
|
||||
"my-index_name",
|
||||
".search-acl-filter-my-index_name",
|
||||
".elastic-connectors*",
|
||||
],
|
||||
privileges: ["all"],
|
||||
allow_restricted_indices: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,8 +3,8 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.nodes.hotThreads({
|
||||
node_id: "my-node,my-other-node",
|
||||
const response = await client.indices.create({
|
||||
index: "books",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,6 +3,25 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.simulate.ingest({});
|
||||
const response = await client.simulate.ingest({
|
||||
body: {
|
||||
docs: [
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "123",
|
||||
_source: {
|
||||
foo: "bar",
|
||||
},
|
||||
},
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "456",
|
||||
_source: {
|
||||
foo: "rab",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
11
docs/doc_examples/19d60e4890cc57151d596326484d9076.asciidoc
Normal file
11
docs/doc_examples/19d60e4890cc57151d596326484d9076.asciidoc
Normal file
@ -0,0 +1,11 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "DELETE",
|
||||
path: "/_ingest/geoip/database/my-database-id",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_inference/text_embedding/openai_embeddings",
|
||||
body: {
|
||||
const response = await client.inference.put({
|
||||
task_type: "text_embedding",
|
||||
inference_id: "openai_embeddings",
|
||||
inference_config: {
|
||||
service: "openai",
|
||||
service_settings: {
|
||||
api_key: "<api_key>",
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_inference/rerank/google_vertex_ai_rerank",
|
||||
body: {
|
||||
const response = await client.inference.put({
|
||||
task_type: "rerank",
|
||||
inference_id: "google_vertex_ai_rerank",
|
||||
inference_config: {
|
||||
service: "googlevertexai",
|
||||
service_settings: {
|
||||
service_account_json: "<service_account_json>",
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.ingest.putPipeline({
|
||||
id: "hugging_face_embeddings",
|
||||
id: "hugging_face_embeddings_pipeline",
|
||||
processors: [
|
||||
{
|
||||
inference: {
|
||||
@ -4,7 +4,7 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.delete({
|
||||
index: "my-index",
|
||||
index: "music",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
21
docs/doc_examples/1cbecd19be22979aefb45b4f160e77ea.asciidoc
Normal file
21
docs/doc_examples/1cbecd19be22979aefb45b4f160e77ea.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.ingest.putPipeline({
|
||||
id: "google_vertex_ai_embeddings_pipeline",
|
||||
processors: [
|
||||
{
|
||||
inference: {
|
||||
model_id: "google_vertex_ai_embeddings",
|
||||
input_output: {
|
||||
input_field: "content",
|
||||
output_field: "content_embedding",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_inference/text_embedding/azure_ai_studio_embeddings",
|
||||
body: {
|
||||
const response = await client.inference.put({
|
||||
task_type: "text_embedding",
|
||||
inference_id: "azure_ai_studio_embeddings",
|
||||
inference_config: {
|
||||
service: "azureaistudio",
|
||||
service_settings: {
|
||||
api_key: "<api_key>",
|
||||
|
||||
@ -3,12 +3,8 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "GET",
|
||||
path: "/_connector",
|
||||
querystring: {
|
||||
service_type: "sharepoint_online",
|
||||
},
|
||||
const response = await client.connector.list({
|
||||
service_type: "sharepoint_online",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
33
docs/doc_examples/1fb2c77c0988bc6545040b20e3afa7e9.asciidoc
Normal file
33
docs/doc_examples/1fb2c77c0988bc6545040b20e3afa7e9.asciidoc
Normal file
@ -0,0 +1,33 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.security.createApiKey({
|
||||
name: "john-api-key",
|
||||
expiration: "1d",
|
||||
role_descriptors: {
|
||||
"sharepoint-online-role": {
|
||||
index: [
|
||||
{
|
||||
names: ["sharepoint-search-application"],
|
||||
privileges: ["read"],
|
||||
query: {
|
||||
template: {
|
||||
params: {
|
||||
access_control: ["john@example.co", "Engineering Members"],
|
||||
},
|
||||
source:
|
||||
'\n {\n "bool": {\n "should": [\n {\n "bool": {\n "must_not": {\n "exists": {\n "field": "_allow_access_control"\n }\n }\n }\n },\n {\n "terms": {\n "_allow_access_control.enum": {{#toJson}}access_control{{/toJson}}\n }\n }\n ]\n }\n }\n ',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
restriction: {
|
||||
workflows: ["search_application_query"],
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
22
docs/doc_examples/20179a8889e949d6a8ee5fbf2ba35c96.asciidoc
Normal file
22
docs/doc_examples/20179a8889e949d6a8ee5fbf2ba35c96.asciidoc
Normal file
@ -0,0 +1,22 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
index: "google-vertex-ai-embeddings",
|
||||
knn: {
|
||||
field: "content_embedding",
|
||||
query_vector_builder: {
|
||||
text_embedding: {
|
||||
model_id: "google_vertex_ai_embeddings",
|
||||
model_text: "Calculate fuel cost",
|
||||
},
|
||||
},
|
||||
k: 10,
|
||||
num_candidates: 100,
|
||||
},
|
||||
_source: ["id", "content"],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_inference/text_embedding/azure_ai_studio_embeddings",
|
||||
body: {
|
||||
const response = await client.inference.put({
|
||||
task_type: "text_embedding",
|
||||
inference_id: "azure_ai_studio_embeddings",
|
||||
inference_config: {
|
||||
service: "azureaistudio",
|
||||
service_settings: {
|
||||
api_key: "<api_key>",
|
||||
|
||||
@ -10,7 +10,7 @@ const response = await client.search({
|
||||
"date.day_of_week": {
|
||||
type: "keyword",
|
||||
script:
|
||||
"emit(doc['date'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))",
|
||||
"emit(doc['date'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH))",
|
||||
},
|
||||
},
|
||||
aggs: {
|
||||
@ -11,7 +11,7 @@ const response = await client.reindex({
|
||||
},
|
||||
dest: {
|
||||
index: "azure-ai-studio-embeddings",
|
||||
pipeline: "azure_ai_studio_embeddings",
|
||||
pipeline: "azure_ai_studio_embeddings_pipeline",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
@ -3,6 +3,12 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.security.oidcLogout({});
|
||||
const response = await client.security.oidcLogout({
|
||||
body: {
|
||||
token:
|
||||
"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
|
||||
refresh_token: "vLBPvmAB6KvwvJZr27cS",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
10
docs/doc_examples/2acf75803494fef29f9ca70671aa6be1.asciidoc
Normal file
10
docs/doc_examples/2acf75803494fef29f9ca70671aa6be1.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.security.bulkDeleteRole({
|
||||
names: ["my_admin_role", "superuser"],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -6,6 +6,7 @@
|
||||
const response = await client.esql.asyncQueryGet({
|
||||
id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
|
||||
wait_for_completion_timeout: "30s",
|
||||
body: null,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
28
docs/doc_examples/2c86840a46242a38cf82024a9321be46.asciidoc
Normal file
28
docs/doc_examples/2c86840a46242a38cf82024a9321be46.asciidoc
Normal file
@ -0,0 +1,28 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "my-explicit-mappings-books",
|
||||
mappings: {
|
||||
dynamic: false,
|
||||
properties: {
|
||||
name: {
|
||||
type: "text",
|
||||
},
|
||||
author: {
|
||||
type: "text",
|
||||
},
|
||||
release_date: {
|
||||
type: "date",
|
||||
format: "yyyy-MM-dd",
|
||||
},
|
||||
page_count: {
|
||||
type: "integer",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
25
docs/doc_examples/2d0244c020075595acb625aa5ba8f455.asciidoc
Normal file
25
docs/doc_examples/2d0244c020075595acb625aa5ba8f455.asciidoc
Normal file
@ -0,0 +1,25 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.index({
|
||||
index: "idx_keep",
|
||||
id: 1,
|
||||
document: {
|
||||
path: {
|
||||
to: [
|
||||
{
|
||||
foo: [3, 2, 1],
|
||||
},
|
||||
{
|
||||
foo: [30, 20, 10],
|
||||
},
|
||||
],
|
||||
bar: "baz",
|
||||
},
|
||||
ids: [200, 100, 300, 100],
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
16
docs/doc_examples/2e09666d3ad5ad9afc22763ee6e97a2b.asciidoc
Normal file
16
docs/doc_examples/2e09666d3ad5ad9afc22763ee6e97a2b.asciidoc
Normal file
@ -0,0 +1,16 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.slm.putLifecycle({
|
||||
policy_id: "hourly-snapshots",
|
||||
schedule: "1h",
|
||||
name: "<hourly-snap-{now/d}>",
|
||||
repository: "my_repository",
|
||||
config: {
|
||||
indices: ["data-*", "important"],
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
25
docs/doc_examples/30fa37c9575fe81a0ea7c12cfc08e277.asciidoc
Normal file
25
docs/doc_examples/30fa37c9575fe81a0ea7c12cfc08e277.asciidoc
Normal file
@ -0,0 +1,25 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "bad_example_index",
|
||||
mappings: {
|
||||
properties: {
|
||||
field_1: {
|
||||
type: "text",
|
||||
copy_to: "field_2",
|
||||
},
|
||||
field_2: {
|
||||
type: "text",
|
||||
copy_to: "field_3",
|
||||
},
|
||||
field_3: {
|
||||
type: "text",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,7 +4,7 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.ingest.putPipeline({
|
||||
id: "azure_ai_studio_embeddings",
|
||||
id: "azure_ai_studio_embeddings_pipeline",
|
||||
processors: [
|
||||
{
|
||||
inference: {
|
||||
@ -3,14 +3,11 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_connector/my-connector",
|
||||
body: {
|
||||
index_name: "search-google-drive",
|
||||
name: "My Connector",
|
||||
service_type: "google_drive",
|
||||
},
|
||||
const response = await client.connector.put({
|
||||
connector_id: "my-connector",
|
||||
index_name: "search-google-drive",
|
||||
name: "My Connector",
|
||||
service_type: "google_drive",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -11,7 +11,7 @@ const response = await client.reindex({
|
||||
},
|
||||
dest: {
|
||||
index: "openai-embeddings",
|
||||
pipeline: "openai_embeddings",
|
||||
pipeline: "openai_embeddings_pipeline",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
21
docs/doc_examples/398389933901b572a06a752bc780af7c.asciidoc
Normal file
21
docs/doc_examples/398389933901b572a06a752bc780af7c.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.inference.put({
|
||||
task_type: "completion",
|
||||
inference_id: "anthropic_completion",
|
||||
inference_config: {
|
||||
service: "anthropic",
|
||||
service_settings: {
|
||||
api_key: "<api_key>",
|
||||
model_id: "<model_id>",
|
||||
},
|
||||
task_settings: {
|
||||
max_tokens: 1024,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,6 +3,6 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.simulate.ingest({});
|
||||
const response = await client.nodes.hotThreads();
|
||||
console.log(response);
|
||||
----
|
||||
@ -11,7 +11,7 @@ const response = await client.reindex({
|
||||
},
|
||||
dest: {
|
||||
index: "amazon-bedrock-embeddings",
|
||||
pipeline: "amazon_bedrock_embeddings",
|
||||
pipeline: "amazon_bedrock_embeddings_pipeline",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
11
docs/doc_examples/3b6718257421b5419bf4cd6a7303c57e.asciidoc
Normal file
11
docs/doc_examples/3b6718257421b5419bf4cd6a7303c57e.asciidoc
Normal file
@ -0,0 +1,11 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "GET",
|
||||
path: "/_ingest/geoip/database/my-database-id",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
20
docs/doc_examples/3c0d0c38e1c819a35a68cdba5ae8ccc4.asciidoc
Normal file
20
docs/doc_examples/3c0d0c38e1c819a35a68cdba5ae8ccc4.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.inference.put({
|
||||
task_type: "text_embedding",
|
||||
inference_id: "alibabacloud_ai_search_embeddings",
|
||||
inference_config: {
|
||||
service: "alibabacloud-ai-search",
|
||||
service_settings: {
|
||||
api_key: "<api_key>",
|
||||
service_id: "<service_id>",
|
||||
host: "<host>",
|
||||
workspace: "<workspace>",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,6 +3,12 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.esql.asyncQuery({});
|
||||
const response = await client.esql.asyncQuery({
|
||||
body: {
|
||||
query:
|
||||
"\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ",
|
||||
wait_for_completion_timeout: "2s",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
----
|
||||
const response = await client.esql.asyncQueryGet({
|
||||
id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
|
||||
body: null,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,16 +3,13 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_connector/my-connector/_pipeline",
|
||||
body: {
|
||||
pipeline: {
|
||||
extract_binary_content: true,
|
||||
name: "my-connector-pipeline",
|
||||
reduce_whitespace: true,
|
||||
run_ml_inference: true,
|
||||
},
|
||||
const response = await client.connector.updatePipeline({
|
||||
connector_id: "my-connector",
|
||||
pipeline: {
|
||||
extract_binary_content: true,
|
||||
name: "my-connector-pipeline",
|
||||
reduce_whitespace: true,
|
||||
run_ml_inference: true,
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
@ -3,12 +3,9 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_connector/my-connector/_status",
|
||||
body: {
|
||||
status: "needs_configuration",
|
||||
},
|
||||
const response = await client.connector.updateStatus({
|
||||
connector_id: "my-connector",
|
||||
status: "needs_configuration",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
18
docs/doc_examples/43d9e314431336a6f084cea76dfd6489.asciidoc
Normal file
18
docs/doc_examples/43d9e314431336a6f084cea76dfd6489.asciidoc
Normal file
@ -0,0 +1,18 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
index: "restaurants",
|
||||
retriever: {
|
||||
knn: {
|
||||
field: "vector",
|
||||
query_vector: [10, 22, 77],
|
||||
k: 10,
|
||||
num_candidates: 10,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/44385b61342e20ea05f254015b2b04d7.asciidoc
Normal file
10
docs/doc_examples/44385b61342e20ea05f254015b2b04d7.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.security.bulkDeleteRole({
|
||||
names: ["my_admin_role", "my_user_role"],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
11
docs/doc_examples/4982c547be1ad9455ae836990aea92c5.asciidoc
Normal file
11
docs/doc_examples/4982c547be1ad9455ae836990aea92c5.asciidoc
Normal file
@ -0,0 +1,11 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.ml.startTrainedModelDeployment({
|
||||
model_id: "my_model",
|
||||
deployment_id: "my_model_for_search",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -10,7 +10,7 @@ const response = await client.search({
|
||||
type: "keyword",
|
||||
script: {
|
||||
source:
|
||||
"emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))",
|
||||
"emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH))",
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_inference/text_embedding/my-msmarco-minilm-model",
|
||||
body: {
|
||||
const response = await client.inference.put({
|
||||
task_type: "text_embedding",
|
||||
inference_id: "my-msmarco-minilm-model",
|
||||
inference_config: {
|
||||
service: "elasticsearch",
|
||||
service_settings: {
|
||||
num_allocations: 1,
|
||||
|
||||
38
docs/doc_examples/4da0cb8693e9ceceee2ba3b558014bbf.asciidoc
Normal file
38
docs/doc_examples/4da0cb8693e9ceceee2ba3b558014bbf.asciidoc
Normal file
@ -0,0 +1,38 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.updateByQuery({
|
||||
index: "INDEX_NAME",
|
||||
conflicts: "proceed",
|
||||
query: {
|
||||
bool: {
|
||||
filter: [
|
||||
{
|
||||
match: {
|
||||
object_type: "drive_item",
|
||||
},
|
||||
},
|
||||
{
|
||||
exists: {
|
||||
field: "file",
|
||||
},
|
||||
},
|
||||
{
|
||||
range: {
|
||||
lastModifiedDateTime: {
|
||||
lte: "now-180d",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
script: {
|
||||
source: "ctx._source.body = ''",
|
||||
lang: "painless",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,7 +4,7 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.ingest.putPipeline({
|
||||
id: "openai_embeddings",
|
||||
id: "openai_embeddings_pipeline",
|
||||
processors: [
|
||||
{
|
||||
inference: {
|
||||
@ -3,9 +3,9 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "DELETE",
|
||||
path: "/_inference/sparse_embedding/my-elser-model",
|
||||
const response = await client.inference.delete({
|
||||
task_type: "sparse_embedding",
|
||||
inference_id: "my-elser-model",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
18
docs/doc_examples/4eeded40f30949e359714a5bb6c88612.asciidoc
Normal file
18
docs/doc_examples/4eeded40f30949e359714a5bb6c88612.asciidoc
Normal file
@ -0,0 +1,18 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.reindex({
|
||||
wait_for_completion: "false",
|
||||
source: {
|
||||
index: "test-data",
|
||||
size: 50,
|
||||
},
|
||||
dest: {
|
||||
index: "elser-embeddings",
|
||||
pipeline: "elser_embeddings_pipeline",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
11
docs/doc_examples/4f6694ef147a73b1163bde3c13779d26.asciidoc
Normal file
11
docs/doc_examples/4f6694ef147a73b1163bde3c13779d26.asciidoc
Normal file
@ -0,0 +1,11 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.nodes.stats({
|
||||
human: "true",
|
||||
filter_path: "nodes.*.indexing_pressure",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
31
docs/doc_examples/529671ffaf7cc75fe83a81d729788be4.asciidoc
Normal file
31
docs/doc_examples/529671ffaf7cc75fe83a81d729788be4.asciidoc
Normal file
@ -0,0 +1,31 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.update({
|
||||
index: ".elastic-connectors",
|
||||
id: "connector_id",
|
||||
doc: {
|
||||
configuration: {
|
||||
field_a: {
|
||||
type: "str",
|
||||
value: "",
|
||||
},
|
||||
field_b: {
|
||||
type: "bool",
|
||||
value: false,
|
||||
},
|
||||
field_c: {
|
||||
type: "int",
|
||||
value: 1,
|
||||
},
|
||||
field_d: {
|
||||
type: "list",
|
||||
value: "a,b",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
20
docs/doc_examples/52f4c5eb08d39f98e2e2f5527ece9731.asciidoc
Normal file
20
docs/doc_examples/52f4c5eb08d39f98e2e2f5527ece9731.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.inference.put({
|
||||
task_type: "sparse_embedding",
|
||||
inference_id: "alibabacloud_ai_search_sparse",
|
||||
inference_config: {
|
||||
service: "alibabacloud-ai-search",
|
||||
service_settings: {
|
||||
api_key: "<api_key>",
|
||||
service_id: "ops-text-sparse-embedding-001",
|
||||
host: "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com",
|
||||
workspace: "default",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
11
docs/doc_examples/533087d787b48878a0bf3fa8d0851b64.asciidoc
Normal file
11
docs/doc_examples/533087d787b48878a0bf3fa8d0851b64.asciidoc
Normal file
@ -0,0 +1,11 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "DELETE",
|
||||
path: "/_ingest/geoip/database/example-database-id",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,7 +4,7 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.ingest.putPipeline({
|
||||
id: "cohere_embeddings",
|
||||
id: "cohere_embeddings_pipeline",
|
||||
processors: [
|
||||
{
|
||||
inference: {
|
||||
15
docs/doc_examples/54a47b5d07e7bfbea75c77f35eaae18d.asciidoc
Normal file
15
docs/doc_examples/54a47b5d07e7bfbea75c77f35eaae18d.asciidoc
Normal file
@ -0,0 +1,15 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.putMapping({
|
||||
index: ".elastic-connectors-sync-jobs-v1",
|
||||
properties: {
|
||||
job_type: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
22
docs/doc_examples/54c12d5099d7b715c15f5bbf65b386a1.asciidoc
Normal file
22
docs/doc_examples/54c12d5099d7b715c15f5bbf65b386a1.asciidoc
Normal file
@ -0,0 +1,22 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "alibabacloud-ai-search-embeddings",
|
||||
mappings: {
|
||||
properties: {
|
||||
content_embedding: {
|
||||
type: "dense_vector",
|
||||
dims: 1024,
|
||||
element_type: "float",
|
||||
},
|
||||
content: {
|
||||
type: "text",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -11,7 +11,7 @@ const response = await client.reindex({
|
||||
},
|
||||
dest: {
|
||||
index: "hugging-face-embeddings",
|
||||
pipeline: "hugging_face_embeddings",
|
||||
pipeline: "hugging_face_embeddings_pipeline",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
22
docs/doc_examples/565386eee0951865a684e41fab53b40c.asciidoc
Normal file
22
docs/doc_examples/565386eee0951865a684e41fab53b40c.asciidoc
Normal file
@ -0,0 +1,22 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.inference.put({
|
||||
task_type: "sparse_embedding",
|
||||
inference_id: "my-elser-model",
|
||||
inference_config: {
|
||||
service: "elser",
|
||||
service_settings: {
|
||||
adaptive_allocations: {
|
||||
enabled: true,
|
||||
min_number_of_allocations: 3,
|
||||
max_number_of_allocations: 10,
|
||||
},
|
||||
num_threads: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,6 +3,12 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.security.oidcPrepareAuthentication({});
|
||||
const response = await client.security.oidcPrepareAuthentication({
|
||||
body: {
|
||||
realm: "oidc1",
|
||||
state: "lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO",
|
||||
nonce: "zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
19
docs/doc_examples/58f6b72009512851843c7b7a20e9504a.asciidoc
Normal file
19
docs/doc_examples/58f6b72009512851843c7b7a20e9504a.asciidoc
Normal file
@ -0,0 +1,19 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "my-index-000002",
|
||||
mappings: {
|
||||
properties: {
|
||||
inference_field: {
|
||||
type: "semantic_text",
|
||||
inference_id: "my-elser-endpoint-for-ingest",
|
||||
search_inference_id: "my-elser-endpoint-for-search",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_inference/completion/openai-completion",
|
||||
body: {
|
||||
const response = await client.inference.put({
|
||||
task_type: "completion",
|
||||
inference_id: "openai-completion",
|
||||
inference_config: {
|
||||
service: "openai",
|
||||
service_settings: {
|
||||
api_key: "<api_key>",
|
||||
|
||||
28
docs/doc_examples/5d3ee81bcf6ad57f39052c9065963cc3.asciidoc
Normal file
28
docs/doc_examples/5d3ee81bcf6ad57f39052c9065963cc3.asciidoc
Normal file
@ -0,0 +1,28 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "test_index",
|
||||
mappings: {
|
||||
dynamic: "strict",
|
||||
properties: {
|
||||
description: {
|
||||
properties: {
|
||||
notes: {
|
||||
type: "text",
|
||||
copy_to: ["description.notes_raw"],
|
||||
analyzer: "standard",
|
||||
search_analyzer: "standard",
|
||||
},
|
||||
notes_raw: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/5deeed427f35cbaee4b8ddc45002a9d7.asciidoc
Normal file
10
docs/doc_examples/5deeed427f35cbaee4b8ddc45002a9d7.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.security.bulkDeleteRole({
|
||||
names: ["my_admin_role", "not_an_existing_role"],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -1,47 +0,0 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
query: {
|
||||
intervals: {
|
||||
my_text: {
|
||||
all_of: {
|
||||
intervals: [
|
||||
{
|
||||
match: {
|
||||
query: "the",
|
||||
},
|
||||
},
|
||||
{
|
||||
any_of: {
|
||||
intervals: [
|
||||
{
|
||||
match: {
|
||||
query: "big",
|
||||
},
|
||||
},
|
||||
{
|
||||
match: {
|
||||
query: "big bad",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
match: {
|
||||
query: "wolf",
|
||||
},
|
||||
},
|
||||
],
|
||||
max_gaps: 0,
|
||||
ordered: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -29,7 +29,7 @@ const response = await client.transport.request({
|
||||
},
|
||||
{
|
||||
rule_id: "rule2",
|
||||
type: "pinned",
|
||||
type: "exclude",
|
||||
criteria: [
|
||||
{
|
||||
type: "contains",
|
||||
10
docs/doc_examples/60d3f9a99cc91b43aaa7524a9a74dba0.asciidoc
Normal file
10
docs/doc_examples/60d3f9a99cc91b43aaa7524a9a74dba0.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.nodes.stats({
|
||||
metric: "breaker",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/6329fb2840a4373ff6d342f2653247cb.asciidoc
Normal file
10
docs/doc_examples/6329fb2840a4373ff6d342f2653247cb.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.getMapping({
|
||||
index: "books",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
20
docs/doc_examples/63a53fcb0717ae9033a679cbfc932851.asciidoc
Normal file
20
docs/doc_examples/63a53fcb0717ae9033a679cbfc932851.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.inference.put({
|
||||
task_type: "completion",
|
||||
inference_id: "alibabacloud_ai_search_completion",
|
||||
inference_config: {
|
||||
service: "alibabacloud-ai-search",
|
||||
service_settings: {
|
||||
host: "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com",
|
||||
api_key: "{{API_KEY}}",
|
||||
service_id: "ops-qwen-turbo",
|
||||
workspace: "default",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
59
docs/doc_examples/63bf3480627a89b4b4ede4150e1d6bc0.asciidoc
Normal file
59
docs/doc_examples/63bf3480627a89b4b4ede4150e1d6bc0.asciidoc
Normal file
@ -0,0 +1,59 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.security.bulkPutRole({
|
||||
roles: {
|
||||
my_admin_role: {
|
||||
cluster: ["all"],
|
||||
indices: [
|
||||
{
|
||||
names: ["index1", "index2"],
|
||||
privileges: ["all"],
|
||||
field_security: {
|
||||
grant: ["title", "body"],
|
||||
},
|
||||
query: '{"match": {"title": "foo"}}',
|
||||
},
|
||||
],
|
||||
applications: [
|
||||
{
|
||||
application: "myapp",
|
||||
privileges: ["admin", "read"],
|
||||
resources: ["*"],
|
||||
},
|
||||
],
|
||||
run_as: ["other_user"],
|
||||
metadata: {
|
||||
version: 1,
|
||||
},
|
||||
},
|
||||
my_user_role: {
|
||||
cluster: ["all"],
|
||||
indices: [
|
||||
{
|
||||
names: ["index1"],
|
||||
privileges: ["read"],
|
||||
field_security: {
|
||||
grant: ["title", "body"],
|
||||
},
|
||||
query: '{"match": {"title": "foo"}}',
|
||||
},
|
||||
],
|
||||
applications: [
|
||||
{
|
||||
application: "myapp",
|
||||
privileges: ["admin", "read"],
|
||||
resources: ["*"],
|
||||
},
|
||||
],
|
||||
run_as: ["other_user"],
|
||||
metadata: {
|
||||
version: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,21 +3,18 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_connector/my-connector/_last_sync",
|
||||
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",
|
||||
},
|
||||
const response = await client.connector.lastSync({
|
||||
connector_id: "my-connector",
|
||||
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",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
10
docs/doc_examples/640dbeecb736bd25f6f2b392b76a7531.asciidoc
Normal file
10
docs/doc_examples/640dbeecb736bd25f6f2b392b76a7531.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.cluster.stats({
|
||||
include_remotes: "true",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,12 +3,9 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_connector/my-connector/_index_name",
|
||||
body: {
|
||||
index_name: "data-from-my-google-drive",
|
||||
},
|
||||
const response = await client.connector.updateIndexName({
|
||||
connector_id: "my-connector",
|
||||
index_name: "data-from-my-google-drive",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
19
docs/doc_examples/69541f0bb81ab3797926bb2a00607cda.asciidoc
Normal file
19
docs/doc_examples/69541f0bb81ab3797926bb2a00607cda.asciidoc
Normal file
@ -0,0 +1,19 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.inference.put({
|
||||
task_type: "rerank",
|
||||
inference_id: "my-msmarco-minilm-model",
|
||||
inference_config: {
|
||||
service: "elasticsearch",
|
||||
service_settings: {
|
||||
num_allocations: 1,
|
||||
num_threads: 1,
|
||||
model_id: "cross-encoder__ms-marco-minilm-l-6-v2",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
18
docs/doc_examples/6b6e275efe3d2aafe0fc3443f2c96868.asciidoc
Normal file
18
docs/doc_examples/6b6e275efe3d2aafe0fc3443f2c96868.asciidoc
Normal file
@ -0,0 +1,18 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.reindex({
|
||||
wait_for_completion: "false",
|
||||
source: {
|
||||
index: "test-data",
|
||||
size: 50,
|
||||
},
|
||||
dest: {
|
||||
index: "google-vertex-ai-embeddings",
|
||||
pipeline: "google_vertex_ai_embeddings_pipeline",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -29,7 +29,7 @@ const response = await client.transport.request({
|
||||
},
|
||||
{
|
||||
rule_id: "my-rule2",
|
||||
type: "pinned",
|
||||
type: "exclude",
|
||||
criteria: [
|
||||
{
|
||||
type: "fuzzy",
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_inference/completion/azure_ai_studio_completion",
|
||||
body: {
|
||||
const response = await client.inference.put({
|
||||
task_type: "completion",
|
||||
inference_id: "azure_ai_studio_completion",
|
||||
inference_config: {
|
||||
service: "azureaistudio",
|
||||
service_settings: {
|
||||
api_key: "<api_key>",
|
||||
|
||||
45
docs/doc_examples/6e6b78e6b689a5d6aa637271b6d084e2.asciidoc
Normal file
45
docs/doc_examples/6e6b78e6b689a5d6aa637271b6d084e2.asciidoc
Normal file
@ -0,0 +1,45 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
index: "movies",
|
||||
retriever: {
|
||||
rrf: {
|
||||
retrievers: [
|
||||
{
|
||||
standard: {
|
||||
query: {
|
||||
sparse_vector: {
|
||||
field: "plot_embedding",
|
||||
inference_id: "my-elser-model",
|
||||
query: "films that explore psychological depths",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
standard: {
|
||||
query: {
|
||||
multi_match: {
|
||||
query: "crime",
|
||||
fields: ["plot", "title"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
knn: {
|
||||
field: "vector",
|
||||
query_vector: [10, 22, 77],
|
||||
k: 10,
|
||||
num_candidates: 10,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,6 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.security.bulkUpdateApiKeys({});
|
||||
const response = await client.security.bulkUpdateApiKeys({
|
||||
body: {
|
||||
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
10
docs/doc_examples/6f8bdca97e43aac75e32de655aa4314a.asciidoc
Normal file
10
docs/doc_examples/6f8bdca97e43aac75e32de655aa4314a.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.connector.delete({
|
||||
connector_id: "my-connector-id&delete_sync_jobs=true",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/7163346755400594d1dd7e445aa19ff0.asciidoc
Normal file
10
docs/doc_examples/7163346755400594d1dd7e445aa19ff0.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
index: "music",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user