Compare commits
21 Commits
v8.18.0
...
backport-2
| Author | SHA1 | Date | |
|---|---|---|---|
| ca3b25c929 | |||
| 424cc94458 | |||
| 7aca5cf652 | |||
| a8927727b1 | |||
| 15a450eba4 | |||
| 8f028a522a | |||
| 411f379006 | |||
| 242b4227ee | |||
| 78332da539 | |||
| 62b2d78b15 | |||
| 599d7e6e07 | |||
| 6116909a9b | |||
| f609271107 | |||
| b4eb8e5441 | |||
| ccf9fcbd93 | |||
| 0c6f323745 | |||
| 04a9eb462d | |||
| 05eaa9fc61 | |||
| 30c6793383 | |||
| 6df75b6a92 | |||
| 383206ef19 |
@ -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
|
||||
10
.github/workflows/nodejs.yml
vendored
10
.github/workflows/nodejs.yml
vendored
@ -72,3 +72,13 @@ jobs:
|
||||
- name: License checker
|
||||
run: |
|
||||
npm run license-checker
|
||||
|
||||
auto-approve:
|
||||
name: Auto-approve
|
||||
needs: [test, license]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
if: github.actor == 'elasticmachine'
|
||||
steps:
|
||||
- uses: hmarr/auto-approve-action@v4
|
||||
|
||||
@ -1,6 +1,36 @@
|
||||
[[changelog-client]]
|
||||
== Release notes
|
||||
|
||||
[discrete]
|
||||
=== 8.15.0
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.15.0`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.15/release-notes-8.15.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== OpenTelemetry zero-code instrumentation support
|
||||
|
||||
For those that use an observability service that supports OpenTelemetry spans, the client will now automatically generate traces for each Elasticsearch request it makes.
|
||||
See {jsclient}/observability.html#_opentelemetry[the docs]
|
||||
for more information.
|
||||
|
||||
[discrete]
|
||||
=== 8.14.1
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Improved support for Elasticsearch `8.14`
|
||||
|
||||
Updated types based on fixes and changes to the Elasticsearch specification.
|
||||
|
||||
[discrete]
|
||||
=== 8.14.0
|
||||
|
||||
@ -198,7 +228,7 @@ https://www.elastic.co/guide/en/elasticsearch/reference/8.9/release-notes-8.9.0.
|
||||
[discrete]
|
||||
===== Allow document to be overwritten in `onDocument` iteratee of bulk helper https://github.com/elastic/elasticsearch-js/pull/1732[#1732]
|
||||
|
||||
In the https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-helpers.html#bulk-helper[bulk helper], documents could not be modified before being sent to Elasticsearch. It is now possible to https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-helpers.html#_modifying_a_document_before_operation[modify a document] before sending it.
|
||||
In the {jsclient}/client-helpers.html#bulk-helper[bulk helper], documents could not be modified before being sent to Elasticsearch. It is now possible to {jsclient}/client-helpers.html#_modifying_a_document_before_operation[modify a document] before sending it.
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
|
||||
10
docs/doc_examples/00272f75a6afea91f8554ef7cda0c1f2.asciidoc
Normal file
10
docs/doc_examples/00272f75a6afea91f8554ef7cda0c1f2.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.clearCachedRealms({
|
||||
realms: "default_file,ldap1",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
11
docs/doc_examples/004743b9c9f61588926ccf734696b713.asciidoc
Normal file
11
docs/doc_examples/004743b9c9f61588926ccf734696b713.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.indices.forcemerge({
|
||||
index: ".ds-my-data-stream-2099.03.07-000001",
|
||||
max_num_segments: 1,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,20 +4,16 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
index: 'bank',
|
||||
body: {
|
||||
query: {
|
||||
match_all: {}
|
||||
query: {
|
||||
pinned: {
|
||||
ids: ["1", "4", "100"],
|
||||
organic: {
|
||||
match: {
|
||||
description: "iphone",
|
||||
},
|
||||
},
|
||||
},
|
||||
sort: [
|
||||
{
|
||||
account_number: 'asc'
|
||||
}
|
||||
],
|
||||
from: 10,
|
||||
size: 10
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
20
docs/doc_examples/006e0e16c9f1da58c0bfe57377f7fc38.asciidoc
Normal file
20
docs/doc_examples/006e0e16c9f1da58c0bfe57377f7fc38.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: "my-index-000001",
|
||||
settings: {
|
||||
analysis: {
|
||||
analyzer: {
|
||||
my_analyzer: {
|
||||
tokenizer: "whitespace",
|
||||
filter: ["stemmer"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
40
docs/doc_examples/007179b5e241da650562a5f0a5007823.asciidoc
Normal file
40
docs/doc_examples/007179b5e241da650562a5f0a5007823.asciidoc
Normal file
@ -0,0 +1,40 @@
|
||||
// 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.watcher.putWatch({
|
||||
id: "cluster_health_watch",
|
||||
trigger: {
|
||||
schedule: {
|
||||
interval: "10s",
|
||||
},
|
||||
},
|
||||
input: {
|
||||
http: {
|
||||
request: {
|
||||
host: "localhost",
|
||||
port: 9200,
|
||||
path: "/_cluster/health",
|
||||
},
|
||||
},
|
||||
},
|
||||
condition: {
|
||||
compare: {
|
||||
"ctx.payload.status": {
|
||||
eq: "red",
|
||||
},
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
send_email: {
|
||||
email: {
|
||||
to: "username@example.org",
|
||||
subject: "Cluster Status Warning",
|
||||
body: "Cluster status is RED",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -0,0 +1,8 @@
|
||||
// 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.migration.postFeatureUpgrade();
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,18 +4,13 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
index: 'bank',
|
||||
body: {
|
||||
query: {
|
||||
match_all: {}
|
||||
index: "my-index",
|
||||
query: {
|
||||
match: {
|
||||
"http.clientip": "40.135.0.0",
|
||||
},
|
||||
sort: [
|
||||
{
|
||||
account_number: 'asc'
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
},
|
||||
fields: ["http.clientip"],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
// 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.shardStores();
|
||||
console.log(response);
|
||||
----
|
||||
15
docs/doc_examples/00c05aa931fc985985e3e21c93cf43ff.asciidoc
Normal file
15
docs/doc_examples/00c05aa931fc985985e3e21c93cf43ff.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.renderSearchTemplate({
|
||||
source: '{ "query": {{#toJson}}my_query{{/toJson}} }',
|
||||
params: {
|
||||
my_query: {
|
||||
match_all: {},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
12
docs/doc_examples/00d65f7b9daa1c6b18eedd8ace206bae.asciidoc
Normal file
12
docs/doc_examples/00d65f7b9daa1c6b18eedd8ace206bae.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.indices.analyze({
|
||||
tokenizer: "standard",
|
||||
filter: ["asciifolding"],
|
||||
text: "açaí à la carte",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
67
docs/doc_examples/00e0c964c79fcc1876ab957da2ffce82.asciidoc
Normal file
67
docs/doc_examples/00e0c964c79fcc1876ab957da2ffce82.asciidoc
Normal file
@ -0,0 +1,67 @@
|
||||
// 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: "italian_example",
|
||||
settings: {
|
||||
analysis: {
|
||||
filter: {
|
||||
italian_elision: {
|
||||
type: "elision",
|
||||
articles: [
|
||||
"c",
|
||||
"l",
|
||||
"all",
|
||||
"dall",
|
||||
"dell",
|
||||
"nell",
|
||||
"sull",
|
||||
"coll",
|
||||
"pell",
|
||||
"gl",
|
||||
"agl",
|
||||
"dagl",
|
||||
"degl",
|
||||
"negl",
|
||||
"sugl",
|
||||
"un",
|
||||
"m",
|
||||
"t",
|
||||
"s",
|
||||
"v",
|
||||
"d",
|
||||
],
|
||||
articles_case: true,
|
||||
},
|
||||
italian_stop: {
|
||||
type: "stop",
|
||||
stopwords: "_italian_",
|
||||
},
|
||||
italian_keywords: {
|
||||
type: "keyword_marker",
|
||||
keywords: ["esempio"],
|
||||
},
|
||||
italian_stemmer: {
|
||||
type: "stemmer",
|
||||
language: "light_italian",
|
||||
},
|
||||
},
|
||||
analyzer: {
|
||||
rebuilt_italian: {
|
||||
tokenizer: "standard",
|
||||
filter: [
|
||||
"italian_elision",
|
||||
"lowercase",
|
||||
"italian_stop",
|
||||
"italian_keywords",
|
||||
"italian_stemmer",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
19
docs/doc_examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc
Normal file
19
docs/doc_examples/00fea15cbca83be9d5f1a024ff2ec708.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: "text_embedding",
|
||||
inference_id: "my-e5-model",
|
||||
inference_config: {
|
||||
service: "elasticsearch",
|
||||
service_settings: {
|
||||
num_allocations: 1,
|
||||
num_threads: 1,
|
||||
model_id: ".multilingual-e5-small",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
13
docs/doc_examples/010d5e901a2690fa7b2396edbe6cd463.asciidoc
Normal file
13
docs/doc_examples/010d5e901a2690fa7b2396edbe6cd463.asciidoc
Normal file
@ -0,0 +1,13 @@
|
||||
// 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.putIndexTemplate({
|
||||
name: "my-data-stream-template",
|
||||
index_patterns: ["my-data-stream*"],
|
||||
data_stream: {},
|
||||
priority: 500,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
24
docs/doc_examples/0163af36c8472ac0c5160c8b716f5b26.asciidoc
Normal file
24
docs/doc_examples/0163af36c8472ac0c5160c8b716f5b26.asciidoc
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: "sales",
|
||||
size: 0,
|
||||
filter_path: "aggregations",
|
||||
query: {
|
||||
term: {
|
||||
type: "t-shirt",
|
||||
},
|
||||
},
|
||||
aggs: {
|
||||
avg_price: {
|
||||
avg: {
|
||||
field: "price",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,17 +4,14 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.updateAliases({
|
||||
body: {
|
||||
actions: [
|
||||
{
|
||||
add: {
|
||||
index: 'test1',
|
||||
alias: 'alias1'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
actions: [
|
||||
{
|
||||
add: {
|
||||
index: "logs-*",
|
||||
alias: "logs",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
26
docs/doc_examples/019e329ed5a930aef825266822e7377a.asciidoc
Normal file
26
docs/doc_examples/019e329ed5a930aef825266822e7377a.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.indices.create({
|
||||
index: "asciifold_example",
|
||||
settings: {
|
||||
analysis: {
|
||||
analyzer: {
|
||||
standard_asciifolding: {
|
||||
tokenizer: "standard",
|
||||
filter: ["my_ascii_folding"],
|
||||
},
|
||||
},
|
||||
filter: {
|
||||
my_ascii_folding: {
|
||||
type: "asciifolding",
|
||||
preserve_original: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
37
docs/doc_examples/01b23f09d2b7f140faf649eadbbf3ac3.asciidoc
Normal file
37
docs/doc_examples/01b23f09d2b7f140faf649eadbbf3ac3.asciidoc
Normal file
@ -0,0 +1,37 @@
|
||||
// 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.putComponentTemplate({
|
||||
name: "component_template1",
|
||||
template: {
|
||||
mappings: {
|
||||
properties: {
|
||||
"@timestamp": {
|
||||
type: "date",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.cluster.putComponentTemplate({
|
||||
name: "runtime_component_template",
|
||||
template: {
|
||||
mappings: {
|
||||
runtime: {
|
||||
day_of_week: {
|
||||
type: "keyword",
|
||||
script: {
|
||||
source:
|
||||
"emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH))",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
10
docs/doc_examples/01bc0f2ed30eb3dd23511d01ce0ac6e1.asciidoc
Normal file
10
docs/doc_examples/01bc0f2ed30eb3dd23511d01ce0ac6e1.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.transform.startTransform({
|
||||
transform_id: "ecommerce_transform",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
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);
|
||||
----
|
||||
@ -4,18 +4,14 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
index: "my-index-000001",
|
||||
aggs: {
|
||||
"my-agg-name": {
|
||||
terms: {
|
||||
user: [
|
||||
'kimchy',
|
||||
'elasticsearch'
|
||||
],
|
||||
boost: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
field: "my-field",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
10
docs/doc_examples/01dc7bdc223bd651574ed2d3954a5b1c.asciidoc
Normal file
10
docs/doc_examples/01dc7bdc223bd651574ed2d3954a5b1c.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.watcher.executeWatch({
|
||||
id: "my_watch",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
39
docs/doc_examples/01f50acf7998b24969f451e922d145eb.asciidoc
Normal file
39
docs/doc_examples/01f50acf7998b24969f451e922d145eb.asciidoc
Normal file
@ -0,0 +1,39 @@
|
||||
// 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: "basque_example",
|
||||
settings: {
|
||||
analysis: {
|
||||
filter: {
|
||||
basque_stop: {
|
||||
type: "stop",
|
||||
stopwords: "_basque_",
|
||||
},
|
||||
basque_keywords: {
|
||||
type: "keyword_marker",
|
||||
keywords: ["Adibidez"],
|
||||
},
|
||||
basque_stemmer: {
|
||||
type: "stemmer",
|
||||
language: "basque",
|
||||
},
|
||||
},
|
||||
analyzer: {
|
||||
rebuilt_basque: {
|
||||
tokenizer: "standard",
|
||||
filter: [
|
||||
"lowercase",
|
||||
"basque_stop",
|
||||
"basque_keywords",
|
||||
"basque_stemmer",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/020c95db88ef356093f03be84893ddf9.asciidoc
Normal file
10
docs/doc_examples/020c95db88ef356093f03be84893ddf9.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.ccr.followStats({
|
||||
index: "<index>",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
20
docs/doc_examples/020de6b6cb960a76297452725a38889f.asciidoc
Normal file
20
docs/doc_examples/020de6b6cb960a76297452725a38889f.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.search({
|
||||
query: {
|
||||
has_child: {
|
||||
type: "child",
|
||||
query: {
|
||||
match_all: {},
|
||||
},
|
||||
max_children: 10,
|
||||
min_children: 2,
|
||||
score_mode: "min",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
19
docs/doc_examples/0246f73cc2ed3dfec577119e8cd15404.asciidoc
Normal file
19
docs/doc_examples/0246f73cc2ed3dfec577119e8cd15404.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.putMapping({
|
||||
index: "my-index-000001",
|
||||
properties: {
|
||||
name: {
|
||||
properties: {
|
||||
last: {
|
||||
type: "text",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
28
docs/doc_examples/025155da86802ebf4c3aeee5aab692f9.asciidoc
Normal file
28
docs/doc_examples/025155da86802ebf4c3aeee5aab692f9.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: "sales",
|
||||
mappings: {
|
||||
properties: {
|
||||
tags: {
|
||||
type: "keyword",
|
||||
},
|
||||
comments: {
|
||||
type: "nested",
|
||||
properties: {
|
||||
username: {
|
||||
type: "keyword",
|
||||
},
|
||||
comment: {
|
||||
type: "text",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
11
docs/doc_examples/02520ac7816b2c4cf8fb413fd16122f2.asciidoc
Normal file
11
docs/doc_examples/02520ac7816b2c4cf8fb413fd16122f2.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.flushJob({
|
||||
job_id: "low_request_rate",
|
||||
calc_interim: true,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
23
docs/doc_examples/0264e994a7e68561e2ca6be0f0d90ee9.asciidoc
Normal file
23
docs/doc_examples/0264e994a7e68561e2ca6be0f0d90ee9.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.search({
|
||||
aggs: {
|
||||
JapaneseCars: {
|
||||
terms: {
|
||||
field: "make",
|
||||
include: ["mazda", "honda"],
|
||||
},
|
||||
},
|
||||
ActiveCarManufacturers: {
|
||||
terms: {
|
||||
field: "make",
|
||||
exclude: ["rover", "jensen"],
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/0280247e0cf2e561c548f22c9fb31163.asciidoc
Normal file
10
docs/doc_examples/0280247e0cf2e561c548f22c9fb31163.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.invalidateToken({
|
||||
username: "myuser",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
28
docs/doc_examples/02853293a5b7cd9cc7a886eb413bbeb6.asciidoc
Normal file
28
docs/doc_examples/02853293a5b7cd9cc7a886eb413bbeb6.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.analyze({
|
||||
tokenizer: "keyword",
|
||||
char_filter: [
|
||||
{
|
||||
type: "mapping",
|
||||
mappings: [
|
||||
"٠ => 0",
|
||||
"١ => 1",
|
||||
"٢ => 2",
|
||||
"٣ => 3",
|
||||
"٤ => 4",
|
||||
"٥ => 5",
|
||||
"٦ => 6",
|
||||
"٧ => 7",
|
||||
"٨ => 8",
|
||||
"٩ => 9",
|
||||
],
|
||||
},
|
||||
],
|
||||
text: "My license plate is ٢٥٠١٥",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -1,43 +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({
|
||||
body: {
|
||||
aggs: {
|
||||
countries: {
|
||||
terms: {
|
||||
field: 'artist.country',
|
||||
order: [
|
||||
{
|
||||
'rock>playback_stats.avg': 'desc'
|
||||
},
|
||||
{
|
||||
_count: 'desc'
|
||||
}
|
||||
]
|
||||
},
|
||||
aggs: {
|
||||
rock: {
|
||||
filter: {
|
||||
term: {
|
||||
genre: 'rock'
|
||||
}
|
||||
},
|
||||
aggs: {
|
||||
playback_stats: {
|
||||
stats: {
|
||||
field: 'play_count'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/029de2f5383a42e1ac4ca1565bd2a130.asciidoc
Normal file
21
docs/doc_examples/029de2f5383a42e1ac4ca1565bd2a130.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.indices.create({
|
||||
index: "my-index-000001",
|
||||
mappings: {
|
||||
properties: {
|
||||
full_name: {
|
||||
type: "text",
|
||||
index_prefixes: {
|
||||
min_chars: 1,
|
||||
max_chars: 10,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
16
docs/doc_examples/02b00f21e9d23d82276ace0dd154d779.asciidoc
Normal file
16
docs/doc_examples/02b00f21e9d23d82276ace0dd154d779.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.search({
|
||||
index: "my-index-000001",
|
||||
routing: "user1,user2",
|
||||
query: {
|
||||
match: {
|
||||
title: "document",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,9 +4,7 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
index: '*',
|
||||
q: 'user:kimchy'
|
||||
})
|
||||
console.log(response)
|
||||
index: "my-data-stream",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
24
docs/doc_examples/02c48d461536709c3fc8a0e8147c3787.asciidoc
Normal file
24
docs/doc_examples/02c48d461536709c3fc8a0e8147c3787.asciidoc
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: "pipelineB",
|
||||
description: "outer pipeline",
|
||||
processors: [
|
||||
{
|
||||
pipeline: {
|
||||
name: "pipelineA",
|
||||
},
|
||||
},
|
||||
{
|
||||
set: {
|
||||
field: "outer_pipeline_set",
|
||||
value: "outer",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/02f65c6bab8f40bf3ce18160623d1870.asciidoc
Normal file
10
docs/doc_examples/02f65c6bab8f40bf3ce18160623d1870.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.getTemplate({
|
||||
name: "template_1",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
38
docs/doc_examples/02fad6b80bb29c2a7e6840db2fc67b18.asciidoc
Normal file
38
docs/doc_examples/02fad6b80bb29c2a7e6840db2fc67b18.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.indices.create({
|
||||
index: "my-index-000001",
|
||||
mappings: {
|
||||
properties: {
|
||||
my_wildcard: {
|
||||
type: "wildcard",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.index({
|
||||
index: "my-index-000001",
|
||||
id: 1,
|
||||
document: {
|
||||
my_wildcard: "This string can be quite lengthy",
|
||||
},
|
||||
});
|
||||
console.log(response1);
|
||||
|
||||
const response2 = await client.search({
|
||||
index: "my-index-000001",
|
||||
query: {
|
||||
wildcard: {
|
||||
my_wildcard: {
|
||||
value: "*quite*lengthy",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response2);
|
||||
----
|
||||
@ -4,10 +4,9 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.get({
|
||||
index: 'twitter',
|
||||
id: '2',
|
||||
routing: 'user1'
|
||||
})
|
||||
console.log(response)
|
||||
index: "my-index-000001",
|
||||
id: 0,
|
||||
_source: "*.id",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
10
docs/doc_examples/032eac56b798bea29390e102538f4a26.asciidoc
Normal file
10
docs/doc_examples/032eac56b798bea29390e102538f4a26.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.refresh({
|
||||
index: "my-index-000001,my-index-000002",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -1,22 +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({
|
||||
body: {
|
||||
aggs: {
|
||||
genres: {
|
||||
terms: {
|
||||
script: {
|
||||
source: "doc['genre'].value",
|
||||
lang: 'painless'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
26
docs/doc_examples/033838729cfb5d1a28d04f69ee78d924.asciidoc
Normal file
26
docs/doc_examples/033838729cfb5d1a28d04f69ee78d924.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.index({
|
||||
index: "example",
|
||||
document: {
|
||||
location: {
|
||||
type: "Polygon",
|
||||
orientation: "LEFT",
|
||||
coordinates: [
|
||||
[
|
||||
[-177, 10],
|
||||
[176, 15],
|
||||
[172, 0],
|
||||
[176, -15],
|
||||
[-177, -10],
|
||||
[-177, 10],
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
36
docs/doc_examples/0350410d11579f4e876c798ce1eaef5b.asciidoc
Normal file
36
docs/doc_examples/0350410d11579f4e876c798ce1eaef5b.asciidoc
Normal file
@ -0,0 +1,36 @@
|
||||
// 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: "my-index-000001",
|
||||
id: 5,
|
||||
refresh: "true",
|
||||
document: {
|
||||
query: {
|
||||
bool: {
|
||||
should: [
|
||||
{
|
||||
match: {
|
||||
message: {
|
||||
query: "Japanese art",
|
||||
_name: "query1",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
match: {
|
||||
message: {
|
||||
query: "Holand culture",
|
||||
_name: "query2",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
38
docs/doc_examples/0350ff5ebb8207c004eb771088339cb4.asciidoc
Normal file
38
docs/doc_examples/0350ff5ebb8207c004eb771088339cb4.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.search({
|
||||
index: "example-index",
|
||||
retriever: {
|
||||
rrf: {
|
||||
retrievers: [
|
||||
{
|
||||
standard: {
|
||||
query: {
|
||||
term: {
|
||||
text: "blue shoes sale",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
standard: {
|
||||
query: {
|
||||
sparse_vector: {
|
||||
field: "ml.tokens",
|
||||
inference_id: "my_elser_model",
|
||||
query: "What blue shoes are on sale?",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
rank_window_size: 50,
|
||||
rank_constant: 20,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
29
docs/doc_examples/03582fc93683e573062bcfda45e01d69.asciidoc
Normal file
29
docs/doc_examples/03582fc93683e573062bcfda45e01d69.asciidoc
Normal file
@ -0,0 +1,29 @@
|
||||
// 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-000001",
|
||||
settings: {
|
||||
analysis: {
|
||||
analyzer: {
|
||||
my_custom_analyzer: {
|
||||
type: "custom",
|
||||
tokenizer: "standard",
|
||||
char_filter: ["html_strip"],
|
||||
filter: ["lowercase", "asciifolding"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.indices.analyze({
|
||||
index: "my-index-000001",
|
||||
analyzer: "my_custom_analyzer",
|
||||
text: "Is this déjà vu</b>?",
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
11
docs/doc_examples/035a7a919eb6513b4769a3727b7d6447.asciidoc
Normal file
11
docs/doc_examples/035a7a919eb6513b4769a3727b7d6447.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.indices.analyze({
|
||||
analyzer: "whitespace",
|
||||
text: "The quick brown fox.",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -0,0 +1,8 @@
|
||||
// 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.getServiceAccounts();
|
||||
console.log(response);
|
||||
----
|
||||
35
docs/doc_examples/0393ca5a2942e1f00ed87546d0d50732.asciidoc
Normal file
35
docs/doc_examples/0393ca5a2942e1f00ed87546d0d50732.asciidoc
Normal file
@ -0,0 +1,35 @@
|
||||
// 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-000003",
|
||||
mappings: {
|
||||
properties: {
|
||||
metrics: {
|
||||
subobjects: false,
|
||||
properties: {
|
||||
time: {
|
||||
type: "object",
|
||||
properties: {
|
||||
min: {
|
||||
type: "long",
|
||||
},
|
||||
max: {
|
||||
type: "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.indices.getMapping({
|
||||
index: "my-index-000003",
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
14
docs/doc_examples/03b1d76fa0b773d5b7d74ecb7e1e1a80.asciidoc
Normal file
14
docs/doc_examples/03b1d76fa0b773d5b7d74ecb7e1e1a80.asciidoc
Normal file
@ -0,0 +1,14 @@
|
||||
// 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.snapshot.restore({
|
||||
repository: "my_repository",
|
||||
snapshot: "my_snapshot_2099.05.06",
|
||||
indices: "my-index,logs-my_app-default",
|
||||
rename_pattern: "(.+)",
|
||||
rename_replacement: "restored-$1",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
11
docs/doc_examples/03c4b815bf1e6a8c5cfcc6ddf94bc093.asciidoc
Normal file
11
docs/doc_examples/03c4b815bf1e6a8c5cfcc6ddf94bc093.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.sql.query({
|
||||
format: "txt",
|
||||
query: "SELECT * FROM library ORDER BY page_count DESC LIMIT 5",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
12
docs/doc_examples/04412d11783dac25b5fd2ec5407078a3.asciidoc
Normal file
12
docs/doc_examples/04412d11783dac25b5fd2ec5407078a3.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.connector.updateApiKeyId({
|
||||
connector_id: "my-connector",
|
||||
api_key_id: "my-api-key-id",
|
||||
api_key_secret_id: "my-connector-secret-id",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
12
docs/doc_examples/044b2f99e7438e408685b258db17f863.asciidoc
Normal file
12
docs/doc_examples/044b2f99e7438e408685b258db17f863.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.eql.search({
|
||||
index: "my-data-stream",
|
||||
query: '\n process where process.name == "regsvr32.exe"\n ',
|
||||
size: 50,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
52
docs/doc_examples/046b2249bbc49e77848c114cee940f17.asciidoc
Normal file
52
docs/doc_examples/046b2249bbc49e77848c114cee940f17.asciidoc
Normal file
@ -0,0 +1,52 @@
|
||||
// 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: "my-index",
|
||||
retriever: {
|
||||
rrf: {
|
||||
retrievers: [
|
||||
{
|
||||
standard: {
|
||||
query: {
|
||||
multi_match: {
|
||||
query: "How is the weather in Jamaica?",
|
||||
fields: ["title", "description"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
standard: {
|
||||
query: {
|
||||
text_expansion: {
|
||||
"ml.inference.title_expanded.predicted_value": {
|
||||
model_id: ".elser_model_2",
|
||||
model_text: "How is the weather in Jamaica?",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
standard: {
|
||||
query: {
|
||||
text_expansion: {
|
||||
"ml.inference.description_expanded.predicted_value": {
|
||||
model_id: ".elser_model_2",
|
||||
model_text: "How is the weather in Jamaica?",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
window_size: 10,
|
||||
rank_constant: 20,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
27
docs/doc_examples/0470d7101637568b9d3d1239f06325a7.asciidoc
Normal file
27
docs/doc_examples/0470d7101637568b9d3d1239f06325a7.asciidoc
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: "PUT",
|
||||
path: "/_internal/desired_nodes/<history_id>/<version>",
|
||||
body: {
|
||||
nodes: [
|
||||
{
|
||||
settings: {
|
||||
"node.name": "instance-000187",
|
||||
"node.external_id": "instance-000187",
|
||||
"node.roles": ["data_hot", "master"],
|
||||
"node.attr.data": "hot",
|
||||
"node.attr.logical_availability_zone": "zone-0",
|
||||
},
|
||||
processors: 8,
|
||||
memory: "58gb",
|
||||
storage: "2tb",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,20 +4,14 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
multi_match: {
|
||||
query: 'Will Smith',
|
||||
type: 'cross_fields',
|
||||
fields: [
|
||||
'first_name',
|
||||
'last_name'
|
||||
],
|
||||
operator: 'and'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
query: {
|
||||
multi_match: {
|
||||
query: "Will Smith",
|
||||
type: "cross_fields",
|
||||
fields: ["first_name", "last_name"],
|
||||
operator: "and",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
|
||||
10
docs/doc_examples/048652b6abfe195da8ea8cef10ee01b1.asciidoc
Normal file
10
docs/doc_examples/048652b6abfe195da8ea8cef10ee01b1.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.transform.resetTransform({
|
||||
transform_id: "ecommerce_transform",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -1,17 +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.create({
|
||||
index: 'twitter',
|
||||
id: '1',
|
||||
body: {
|
||||
user: 'kimchy',
|
||||
post_date: '2009-11-15T14:12:12',
|
||||
message: 'trying out Elasticsearch'
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
31
docs/doc_examples/04d586a536061ec1045d0bb2dc3d1a5f.asciidoc
Normal file
31
docs/doc_examples/04d586a536061ec1045d0bb2dc3d1a5f.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.ingest.putPipeline({
|
||||
id: "set_os",
|
||||
description: "sets the value of host.os.name from the field os",
|
||||
processors: [
|
||||
{
|
||||
set: {
|
||||
field: "host.os.name",
|
||||
value: "{{{os}}}",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.ingest.simulate({
|
||||
id: "set_os",
|
||||
docs: [
|
||||
{
|
||||
_source: {
|
||||
os: "Ubuntu",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
27
docs/doc_examples/04d6ce0c903bd468afbecd3aa1c4a78a.asciidoc
Normal file
27
docs/doc_examples/04d6ce0c903bd468afbecd3aa1c4a78a.asciidoc
Normal file
@ -0,0 +1,27 @@
|
||||
// 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: "my-pipeline-id",
|
||||
description: "My optional pipeline description",
|
||||
processors: [
|
||||
{
|
||||
set: {
|
||||
description: "My optional processor description",
|
||||
field: "my-keyword-field",
|
||||
value: "foo",
|
||||
},
|
||||
},
|
||||
],
|
||||
_meta: {
|
||||
reason: "set my-keyword-field to foo",
|
||||
serialization: {
|
||||
class: "MyPipeline",
|
||||
id: 10,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
20
docs/doc_examples/04de2e3a9c00c2056b07bf9cf9e63a99.asciidoc
Normal file
20
docs/doc_examples/04de2e3a9c00c2056b07bf9cf9e63a99.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: "google_vertex_ai_embeddings",
|
||||
inference_config: {
|
||||
service: "googlevertexai",
|
||||
service_settings: {
|
||||
service_account_json: "<service_account_json>",
|
||||
model_id: "<model_id>",
|
||||
location: "<location>",
|
||||
project_id: "<project_id>",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,9 +4,8 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.cluster.health({
|
||||
wait_for_status: 'yellow',
|
||||
timeout: '50s'
|
||||
})
|
||||
console.log(response)
|
||||
wait_for_status: "yellow",
|
||||
timeout: "50s",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
|
||||
@ -1,30 +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({
|
||||
body: {
|
||||
query: {
|
||||
term: {
|
||||
user: 'kimchy'
|
||||
}
|
||||
},
|
||||
sort: {
|
||||
_script: {
|
||||
type: 'number',
|
||||
script: {
|
||||
lang: 'painless',
|
||||
source: "doc['field_name'].value * params.factor",
|
||||
params: {
|
||||
factor: 1.1
|
||||
}
|
||||
},
|
||||
order: 'asc'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
37
docs/doc_examples/0502284d4685c478eb68761f979f4303.asciidoc
Normal file
37
docs/doc_examples/0502284d4685c478eb68761f979f4303.asciidoc
Normal file
@ -0,0 +1,37 @@
|
||||
// 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.evaluateDataFrame({
|
||||
index: "house_price_predictions",
|
||||
query: {
|
||||
bool: {
|
||||
filter: [
|
||||
{
|
||||
term: {
|
||||
"ml.is_training": false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
evaluation: {
|
||||
regression: {
|
||||
actual_field: "price",
|
||||
predicted_field: "ml.price_prediction",
|
||||
metrics: {
|
||||
r_squared: {},
|
||||
mse: {},
|
||||
msle: {
|
||||
offset: 10,
|
||||
},
|
||||
huber: {
|
||||
delta: 1.5,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
12
docs/doc_examples/050b3947025fee403232b8e6e9112dab.asciidoc
Normal file
12
docs/doc_examples/050b3947025fee403232b8e6e9112dab.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.sql.query({
|
||||
format: "yaml",
|
||||
query: "SELECT * FROM library ORDER BY page_count DESC",
|
||||
fetch_size: 5,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
54
docs/doc_examples/05148cc541f447486d9daf15ab77292b.asciidoc
Normal file
54
docs/doc_examples/05148cc541f447486d9daf15ab77292b.asciidoc
Normal file
@ -0,0 +1,54 @@
|
||||
// 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.ilm.putLifecycle({
|
||||
name: "logs",
|
||||
policy: {
|
||||
phases: {
|
||||
hot: {
|
||||
actions: {
|
||||
rollover: {
|
||||
max_primary_shard_size: "50gb",
|
||||
},
|
||||
},
|
||||
},
|
||||
warm: {
|
||||
min_age: "30d",
|
||||
actions: {
|
||||
shrink: {
|
||||
number_of_shards: 1,
|
||||
},
|
||||
forcemerge: {
|
||||
max_num_segments: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
cold: {
|
||||
min_age: "60d",
|
||||
actions: {
|
||||
searchable_snapshot: {
|
||||
snapshot_repository: "found-snapshots",
|
||||
},
|
||||
},
|
||||
},
|
||||
frozen: {
|
||||
min_age: "90d",
|
||||
actions: {
|
||||
searchable_snapshot: {
|
||||
snapshot_repository: "found-snapshots",
|
||||
},
|
||||
},
|
||||
},
|
||||
delete: {
|
||||
min_age: "735d",
|
||||
actions: {
|
||||
delete: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
23
docs/doc_examples/0518c673094fb18ecb491a3b78af4695.asciidoc
Normal file
23
docs/doc_examples/0518c673094fb18ecb491a3b78af4695.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.ilm.putLifecycle({
|
||||
name: "my_policy",
|
||||
policy: {
|
||||
phases: {
|
||||
warm: {
|
||||
actions: {
|
||||
allocate: {
|
||||
include: {
|
||||
box_type: "hot,warm",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/05284c8ea91769c09c8db47db8a6629a.asciidoc
Normal file
10
docs/doc_examples/05284c8ea91769c09c8db47db8a6629a.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.cat.repositories({
|
||||
v: "true",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
19
docs/doc_examples/053497b6960f80fd7b005b7c6d54358f.asciidoc
Normal file
19
docs/doc_examples/053497b6960f80fd7b005b7c6d54358f.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.ilm.putLifecycle({
|
||||
name: "my_policy",
|
||||
policy: {
|
||||
phases: {
|
||||
delete: {
|
||||
actions: {
|
||||
delete: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
24
docs/doc_examples/05500e77aef581d92f6c605f7a48f7df.asciidoc
Normal file
24
docs/doc_examples/05500e77aef581d92f6c605f7a48f7df.asciidoc
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: "example",
|
||||
document: {
|
||||
location: {
|
||||
type: "polygon",
|
||||
coordinates: [
|
||||
[
|
||||
[1000, -1001],
|
||||
[1001, -1001],
|
||||
[1001, -1000],
|
||||
[1000, -1000],
|
||||
[1000, -1001],
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
20
docs/doc_examples/059e04aaf093379401f665c33ac796dc.asciidoc
Normal file
20
docs/doc_examples/059e04aaf093379401f665c33ac796dc.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.analyze({
|
||||
tokenizer: "whitespace",
|
||||
filter: [
|
||||
{
|
||||
type: "keyword_marker",
|
||||
keywords: ["jumping"],
|
||||
},
|
||||
"stemmer",
|
||||
],
|
||||
text: "fox running and jumping",
|
||||
explain: true,
|
||||
attributes: "keyword",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
78
docs/doc_examples/05a09078fe1016e900e445ad4039cf97.asciidoc
Normal file
78
docs/doc_examples/05a09078fe1016e900e445ad4039cf97.asciidoc
Normal file
@ -0,0 +1,78 @@
|
||||
// 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: "clientips",
|
||||
mappings: {
|
||||
properties: {
|
||||
client_ip: {
|
||||
type: "keyword",
|
||||
},
|
||||
env: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.bulk({
|
||||
index: "clientips",
|
||||
operations: [
|
||||
{
|
||||
index: {},
|
||||
},
|
||||
{
|
||||
client_ip: "172.21.0.5",
|
||||
env: "Development",
|
||||
},
|
||||
{
|
||||
index: {},
|
||||
},
|
||||
{
|
||||
client_ip: "172.21.2.113",
|
||||
env: "QA",
|
||||
},
|
||||
{
|
||||
index: {},
|
||||
},
|
||||
{
|
||||
client_ip: "172.21.2.162",
|
||||
env: "QA",
|
||||
},
|
||||
{
|
||||
index: {},
|
||||
},
|
||||
{
|
||||
client_ip: "172.21.3.15",
|
||||
env: "Production",
|
||||
},
|
||||
{
|
||||
index: {},
|
||||
},
|
||||
{
|
||||
client_ip: "172.21.3.16",
|
||||
env: "Production",
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response1);
|
||||
|
||||
const response2 = await client.enrich.putPolicy({
|
||||
name: "clientip_policy",
|
||||
match: {
|
||||
indices: "clientips",
|
||||
match_field: "client_ip",
|
||||
enrich_fields: ["env"],
|
||||
},
|
||||
});
|
||||
console.log(response2);
|
||||
|
||||
const response3 = await client.enrich.executePolicy({
|
||||
name: "clientip_policy",
|
||||
wait_for_completion: "false",
|
||||
});
|
||||
console.log(response3);
|
||||
----
|
||||
10
docs/doc_examples/05ba0fdd0215e313ecea8a2f8f5a43b4.asciidoc
Normal file
10
docs/doc_examples/05ba0fdd0215e313ecea8a2f8f5a43b4.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.getDataStream({
|
||||
name: "my-data-stream",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
21
docs/doc_examples/05bee3adf46b9d6a2fef96c51bf958da.asciidoc
Normal file
21
docs/doc_examples/05bee3adf46b9d6a2fef96c51bf958da.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.security.putRole({
|
||||
name: "click_role",
|
||||
indices: [
|
||||
{
|
||||
names: ["events-*"],
|
||||
privileges: ["read"],
|
||||
query: {
|
||||
match: {
|
||||
category: "click",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
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);
|
||||
----
|
||||
17
docs/doc_examples/05f4a4b284f68f7fb13603d7cd854083.asciidoc
Normal file
17
docs/doc_examples/05f4a4b284f68f7fb13603d7cd854083.asciidoc
Normal file
@ -0,0 +1,17 @@
|
||||
// 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.putSettings({
|
||||
index: "logs-my_app-default",
|
||||
settings: {
|
||||
index: {
|
||||
lifecycle: {
|
||||
name: "new-lifecycle-policy",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -0,0 +1,8 @@
|
||||
// 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.ssl.certificates();
|
||||
console.log(response);
|
||||
----
|
||||
11
docs/doc_examples/0601b5cb5328c9ebff30f4be1b210f93.asciidoc
Normal file
11
docs/doc_examples/0601b5cb5328c9ebff30f4be1b210f93.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.snapshot.status({
|
||||
repository: "my_repository",
|
||||
snapshot: "snapshot_2",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
32
docs/doc_examples/060a56477e39f272fc5a9cfe47443cf1.asciidoc
Normal file
32
docs/doc_examples/060a56477e39f272fc5a9cfe47443cf1.asciidoc
Normal file
@ -0,0 +1,32 @@
|
||||
// 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-000001",
|
||||
settings: {
|
||||
analysis: {
|
||||
analyzer: {
|
||||
my_analyzer: {
|
||||
tokenizer: "my_tokenizer",
|
||||
},
|
||||
},
|
||||
tokenizer: {
|
||||
my_tokenizer: {
|
||||
type: "simple_pattern",
|
||||
pattern: "[0123456789]{3}",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.indices.analyze({
|
||||
index: "my-index-000001",
|
||||
analyzer: "my_analyzer",
|
||||
text: "fd-786-335-514-x",
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
@ -4,9 +4,8 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
index: 'twitter',
|
||||
size: 'surprise_me'
|
||||
})
|
||||
console.log(response)
|
||||
index: "my-index-000001",
|
||||
size: "surprise_me",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
12
docs/doc_examples/06454a8e85e2d3479c90390bb955eb39.asciidoc
Normal file
12
docs/doc_examples/06454a8e85e2d3479c90390bb955eb39.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.snapshot.get({
|
||||
repository: "my_repository",
|
||||
snapshot: "snapshot*,-snapshot_3",
|
||||
sort: "name",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
16
docs/doc_examples/066e0bdcdfa3b8afa5d1e5777f73fccb.asciidoc
Normal file
16
docs/doc_examples/066e0bdcdfa3b8afa5d1e5777f73fccb.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.indices.rollover({
|
||||
alias: "my-alias",
|
||||
conditions: {
|
||||
max_age: "7d",
|
||||
max_docs: 1000,
|
||||
max_primary_shard_size: "50gb",
|
||||
max_primary_shard_docs: "2000",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
58
docs/doc_examples/069030e5f43d8f8ce3e3eca40205027e.asciidoc
Normal file
58
docs/doc_examples/069030e5f43d8f8ce3e3eca40205027e.asciidoc
Normal file
@ -0,0 +1,58 @@
|
||||
// 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-000001",
|
||||
mappings: {
|
||||
properties: {
|
||||
manager: {
|
||||
properties: {
|
||||
age: {
|
||||
type: "integer",
|
||||
},
|
||||
name: {
|
||||
type: "text",
|
||||
},
|
||||
},
|
||||
},
|
||||
employees: {
|
||||
type: "nested",
|
||||
properties: {
|
||||
age: {
|
||||
type: "integer",
|
||||
},
|
||||
name: {
|
||||
type: "text",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.index({
|
||||
index: "my-index-000001",
|
||||
id: 1,
|
||||
document: {
|
||||
region: "US",
|
||||
manager: {
|
||||
name: "Alice White",
|
||||
age: 30,
|
||||
},
|
||||
employees: [
|
||||
{
|
||||
name: "John Smith",
|
||||
age: 34,
|
||||
},
|
||||
{
|
||||
name: "Peter Brown",
|
||||
age: 26,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
15
docs/doc_examples/06a761823a694850a6efe5d5bf61478c.asciidoc
Normal file
15
docs/doc_examples/06a761823a694850a6efe5d5bf61478c.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.enrich.putPolicy({
|
||||
name: "users-policy",
|
||||
match: {
|
||||
indices: "users",
|
||||
match_field: "email",
|
||||
enrich_fields: ["first_name", "last_name", "city", "zip", "state"],
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -1,48 +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({
|
||||
body: {
|
||||
query: {
|
||||
bool: {
|
||||
must: {
|
||||
term: {
|
||||
user: 'kimchy'
|
||||
}
|
||||
},
|
||||
filter: {
|
||||
term: {
|
||||
tag: 'tech'
|
||||
}
|
||||
},
|
||||
must_not: {
|
||||
range: {
|
||||
age: {
|
||||
gte: 10,
|
||||
lte: 20
|
||||
}
|
||||
}
|
||||
},
|
||||
should: [
|
||||
{
|
||||
term: {
|
||||
tag: 'wow'
|
||||
}
|
||||
},
|
||||
{
|
||||
term: {
|
||||
tag: 'elasticsearch'
|
||||
}
|
||||
}
|
||||
],
|
||||
minimum_should_match: 1,
|
||||
boost: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
28
docs/doc_examples/06b5d3d56c4d4e3b61ae42ea26401c40.asciidoc
Normal file
28
docs/doc_examples/06b5d3d56c4d4e3b61ae42ea26401c40.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.msearch({
|
||||
index: "my-index-000001",
|
||||
searches: [
|
||||
{},
|
||||
{
|
||||
query: {
|
||||
match: {
|
||||
message: "this is a test",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
index: "my-index-000002",
|
||||
},
|
||||
{
|
||||
query: {
|
||||
match_all: {},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
19
docs/doc_examples/06c0db0f42223761e32fa418066b275f.asciidoc
Normal file
19
docs/doc_examples/06c0db0f42223761e32fa418066b275f.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.snapshot.createRepository({
|
||||
name: "my-repo",
|
||||
repository: {
|
||||
type: "s3",
|
||||
settings: {
|
||||
bucket: "repo-bucket",
|
||||
client: "elastic-internal-71bcd3",
|
||||
base_path: "myrepo",
|
||||
readonly: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,12 +4,9 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.cluster.putSettings({
|
||||
body: {
|
||||
transient: {
|
||||
'logger.org.elasticsearch.transport': 'trace'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
persistent: {
|
||||
"cluster.routing.allocation.total_shards_per_node": 400,
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
24
docs/doc_examples/070cf72783cfe534a04f2f64e4016052.asciidoc
Normal file
24
docs/doc_examples/070cf72783cfe534a04f2f64e4016052.asciidoc
Normal file
@ -0,0 +1,24 @@
|
||||
// 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-000001",
|
||||
mappings: {
|
||||
subobjects: false,
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.index({
|
||||
index: "my-index-000001",
|
||||
id: "metric_1",
|
||||
document: {
|
||||
time: "100ms",
|
||||
"time.min": "10ms",
|
||||
"time.max": "900ms",
|
||||
},
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
19
docs/doc_examples/0718a0b4f4905a8c90c1ff93de557e56.asciidoc
Normal file
19
docs/doc_examples/0718a0b4f4905a8c90c1ff93de557e56.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.search({
|
||||
index: "exams",
|
||||
size: 0,
|
||||
aggs: {
|
||||
grades_stats: {
|
||||
extended_stats: {
|
||||
field: "grade",
|
||||
sigma: 3,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
12
docs/doc_examples/0721c8adec544d5ecea3fcc410e45feb.asciidoc
Normal file
12
docs/doc_examples/0721c8adec544d5ecea3fcc410e45feb.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.security.activateUserProfile({
|
||||
grant_type: "password",
|
||||
username: "jacknich",
|
||||
password: "l0ng-r4nd0m-p@ssw0rd",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
21
docs/doc_examples/0737ebaea33631f001fb3f4226948492.asciidoc
Normal file
21
docs/doc_examples/0737ebaea33631f001fb3f4226948492.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.indices.create({
|
||||
index: "my_ip_locations",
|
||||
mappings: {
|
||||
properties: {
|
||||
geoip: {
|
||||
properties: {
|
||||
location: {
|
||||
type: "geo_point",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/073864d3f52f8f79aafdaa85a88ac46a.asciidoc
Normal file
10
docs/doc_examples/073864d3f52f8f79aafdaa85a88ac46a.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.clearCachedRealms({
|
||||
realms: "*",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/0755471d7dce4785d2e7ed0c10182ea3.asciidoc
Normal file
10
docs/doc_examples/0755471d7dce4785d2e7ed0c10182ea3.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.transform.getTransformStats({
|
||||
transform_id: "ecommerce-customer-transform",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
12
docs/doc_examples/07a5fdeb7805cec1d28ba288b28f5ff5.asciidoc
Normal file
12
docs/doc_examples/07a5fdeb7805cec1d28ba288b28f5ff5.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.rollup.stopJob({
|
||||
id: "sensor",
|
||||
wait_for_completion: "true",
|
||||
timeout: "10s",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
22
docs/doc_examples/07ba3eaa931f2cf110052e3544db51f8.asciidoc
Normal file
22
docs/doc_examples/07ba3eaa931f2cf110052e3544db51f8.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.reindex({
|
||||
max_docs: 10,
|
||||
source: {
|
||||
index: "my-index-000001",
|
||||
query: {
|
||||
function_score: {
|
||||
random_score: {},
|
||||
min_score: 0.9,
|
||||
},
|
||||
},
|
||||
},
|
||||
dest: {
|
||||
index: "my-new-index-000001",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
14
docs/doc_examples/07c07f6d497b1a3012aa4320f830e09e.asciidoc
Normal file
14
docs/doc_examples/07c07f6d497b1a3012aa4320f830e09e.asciidoc
Normal file
@ -0,0 +1,14 @@
|
||||
// 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.ccr.forgetFollower({
|
||||
index: "leader_index",
|
||||
follower_cluster: "follower_cluster",
|
||||
follower_index: "follower_index",
|
||||
follower_index_uuid: "vYpnaWPRQB6mNspmoCeYyA",
|
||||
leader_remote_cluster: "leader_cluster",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
16
docs/doc_examples/07dadb9b0a774bd8e7f3527cf8a44afc.asciidoc
Normal file
16
docs/doc_examples/07dadb9b0a774bd8e7f3527cf8a44afc.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.search({
|
||||
index: "my-index-000001",
|
||||
query: {
|
||||
semantic: {
|
||||
field: "inference_field",
|
||||
query: "Best surfing places",
|
||||
},
|
||||
},
|
||||
});
|
||||
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