@elastic/elasticsearch 8.8.1 → 8.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.projections.json +7 -0
- package/.tool-versions +1 -0
- package/README.md +42 -81
- package/free-report-junit.xml +0 -6
- package/junit-output/junit-foobar.xml +13947 -0
- package/lib/api/api/async_search.d.ts +16 -0
- package/lib/api/api/async_search.js.map +1 -1
- package/lib/api/api/autoscaling.d.ts +16 -0
- package/lib/api/api/autoscaling.js.map +1 -1
- package/lib/api/api/bulk.d.ts +4 -0
- package/lib/api/api/bulk.js.map +1 -1
- package/lib/api/api/cat.d.ts +104 -0
- package/lib/api/api/cat.js.map +1 -1
- package/lib/api/api/ccr.d.ts +52 -0
- package/lib/api/api/ccr.js.map +1 -1
- package/lib/api/api/clear_scroll.d.ts +4 -0
- package/lib/api/api/clear_scroll.js.map +1 -1
- package/lib/api/api/close_point_in_time.d.ts +4 -0
- package/lib/api/api/close_point_in_time.js.map +1 -1
- package/lib/api/api/cluster.d.ts +60 -0
- package/lib/api/api/cluster.js.map +1 -1
- package/lib/api/api/count.d.ts +4 -0
- package/lib/api/api/count.js.map +1 -1
- package/lib/api/api/create.d.ts +4 -0
- package/lib/api/api/create.js.map +1 -1
- package/lib/api/api/dangling_indices.d.ts +12 -0
- package/lib/api/api/dangling_indices.js.map +1 -1
- package/lib/api/api/delete.d.ts +4 -0
- package/lib/api/api/delete.js.map +1 -1
- package/lib/api/api/delete_by_query.d.ts +4 -0
- package/lib/api/api/delete_by_query.js.map +1 -1
- package/lib/api/api/delete_by_query_rethrottle.d.ts +4 -0
- package/lib/api/api/delete_by_query_rethrottle.js.map +1 -1
- package/lib/api/api/delete_script.d.ts +4 -0
- package/lib/api/api/delete_script.js.map +1 -1
- package/lib/api/api/enrich.d.ts +20 -0
- package/lib/api/api/enrich.js.map +1 -1
- package/lib/api/api/eql.d.ts +16 -0
- package/lib/api/api/eql.js.map +1 -1
- package/lib/api/api/exists.d.ts +4 -0
- package/lib/api/api/exists.js.map +1 -1
- package/lib/api/api/exists_source.d.ts +4 -0
- package/lib/api/api/exists_source.js.map +1 -1
- package/lib/api/api/explain.d.ts +4 -0
- package/lib/api/api/explain.js.map +1 -1
- package/lib/api/api/features.d.ts +8 -0
- package/lib/api/api/features.js.map +1 -1
- package/lib/api/api/field_caps.d.ts +4 -0
- package/lib/api/api/field_caps.js.map +1 -1
- package/lib/api/api/fleet.d.ts +10 -0
- package/lib/api/api/fleet.js.map +1 -1
- package/lib/api/api/get.d.ts +4 -0
- package/lib/api/api/get.js.map +1 -1
- package/lib/api/api/get_script.d.ts +4 -0
- package/lib/api/api/get_script.js.map +1 -1
- package/lib/api/api/get_script_context.d.ts +4 -0
- package/lib/api/api/get_script_context.js.map +1 -1
- package/lib/api/api/get_script_languages.d.ts +4 -0
- package/lib/api/api/get_script_languages.js.map +1 -1
- package/lib/api/api/get_source.d.ts +4 -0
- package/lib/api/api/get_source.js.map +1 -1
- package/lib/api/api/graph.d.ts +4 -0
- package/lib/api/api/graph.js.map +1 -1
- package/lib/api/api/health_report.d.ts +4 -0
- package/lib/api/api/health_report.js.map +1 -1
- package/lib/api/api/ilm.d.ts +44 -0
- package/lib/api/api/ilm.js.map +1 -1
- package/lib/api/api/index.d.ts +4 -0
- package/lib/api/api/index.js.map +1 -1
- package/lib/api/api/indices.d.ts +232 -0
- package/lib/api/api/indices.js.map +1 -1
- package/lib/api/api/info.d.ts +4 -0
- package/lib/api/api/info.js.map +1 -1
- package/lib/api/api/ingest.d.ts +24 -0
- package/lib/api/api/ingest.js.map +1 -1
- package/lib/api/api/knn_search.d.ts +4 -0
- package/lib/api/api/knn_search.js.map +1 -1
- package/lib/api/api/license.d.ts +28 -0
- package/lib/api/api/license.js.map +1 -1
- package/lib/api/api/logstash.d.ts +12 -0
- package/lib/api/api/logstash.js.map +1 -1
- package/lib/api/api/mget.d.ts +4 -0
- package/lib/api/api/mget.js.map +1 -1
- package/lib/api/api/migration.d.ts +12 -0
- package/lib/api/api/migration.js.map +1 -1
- package/lib/api/api/ml.d.ts +292 -0
- package/lib/api/api/ml.js.map +1 -1
- package/lib/api/api/monitoring.d.ts +4 -0
- package/lib/api/api/monitoring.js.map +1 -1
- package/lib/api/api/msearch.d.ts +4 -0
- package/lib/api/api/msearch.js.map +1 -1
- package/lib/api/api/msearch_template.d.ts +4 -0
- package/lib/api/api/msearch_template.js.map +1 -1
- package/lib/api/api/mtermvectors.d.ts +4 -0
- package/lib/api/api/mtermvectors.js.map +1 -1
- package/lib/api/api/nodes.d.ts +28 -0
- package/lib/api/api/nodes.js.map +1 -1
- package/lib/api/api/open_point_in_time.d.ts +4 -0
- package/lib/api/api/open_point_in_time.js.map +1 -1
- package/lib/api/api/ping.d.ts +4 -0
- package/lib/api/api/ping.js.map +1 -1
- package/lib/api/api/put_script.d.ts +4 -0
- package/lib/api/api/put_script.js.map +1 -1
- package/lib/api/api/rank_eval.d.ts +4 -0
- package/lib/api/api/rank_eval.js.map +1 -1
- package/lib/api/api/reindex.d.ts +4 -0
- package/lib/api/api/reindex.js.map +1 -1
- package/lib/api/api/reindex_rethrottle.d.ts +4 -0
- package/lib/api/api/reindex_rethrottle.js.map +1 -1
- package/lib/api/api/render_search_template.d.ts +4 -0
- package/lib/api/api/render_search_template.js.map +1 -1
- package/lib/api/api/rollup.d.ts +32 -0
- package/lib/api/api/rollup.js.map +1 -1
- package/lib/api/api/scripts_painless_execute.d.ts +4 -0
- package/lib/api/api/scripts_painless_execute.js.map +1 -1
- package/lib/api/api/scroll.d.ts +4 -0
- package/lib/api/api/scroll.js.map +1 -1
- package/lib/api/api/search.d.ts +4 -0
- package/lib/api/api/search.js.map +1 -1
- package/lib/api/api/search_application.d.ts +36 -0
- package/lib/api/api/search_application.js.map +1 -1
- package/lib/api/api/search_mvt.d.ts +4 -0
- package/lib/api/api/search_mvt.js.map +1 -1
- package/lib/api/api/search_shards.d.ts +4 -0
- package/lib/api/api/search_shards.js.map +1 -1
- package/lib/api/api/search_template.d.ts +4 -0
- package/lib/api/api/search_template.js.map +1 -1
- package/lib/api/api/searchable_snapshots.d.ts +16 -0
- package/lib/api/api/searchable_snapshots.js.map +1 -1
- package/lib/api/api/security.d.ts +220 -0
- package/lib/api/api/security.js.map +1 -1
- package/lib/api/api/shutdown.d.ts +12 -0
- package/lib/api/api/shutdown.js.map +1 -1
- package/lib/api/api/slm.d.ts +36 -0
- package/lib/api/api/slm.js.map +1 -1
- package/lib/api/api/snapshot.d.ts +48 -0
- package/lib/api/api/snapshot.js.map +1 -1
- package/lib/api/api/sql.d.ts +24 -0
- package/lib/api/api/sql.js.map +1 -1
- package/lib/api/api/ssl.d.ts +4 -0
- package/lib/api/api/ssl.js.map +1 -1
- package/lib/api/api/tasks.d.ts +12 -0
- package/lib/api/api/tasks.js.map +1 -1
- package/lib/api/api/terms_enum.d.ts +4 -0
- package/lib/api/api/terms_enum.js.map +1 -1
- package/lib/api/api/termvectors.d.ts +4 -0
- package/lib/api/api/termvectors.js.map +1 -1
- package/lib/api/api/text_structure.d.ts +4 -0
- package/lib/api/api/text_structure.js.map +1 -1
- package/lib/api/api/transform.d.ts +44 -0
- package/lib/api/api/transform.js.map +1 -1
- package/lib/api/api/update.d.ts +4 -0
- package/lib/api/api/update.js.map +1 -1
- package/lib/api/api/update_by_query.d.ts +4 -0
- package/lib/api/api/update_by_query.js.map +1 -1
- package/lib/api/api/update_by_query_rethrottle.d.ts +4 -0
- package/lib/api/api/update_by_query_rethrottle.js.map +1 -1
- package/lib/api/api/watcher.d.ts +52 -0
- package/lib/api/api/watcher.js.map +1 -1
- package/lib/api/api/xpack.d.ts +8 -0
- package/lib/api/api/xpack.js.map +1 -1
- package/lib/api/types.d.ts +6 -5
- package/lib/api/typesWithBodyKey.d.ts +6 -5
- package/lib/client.js +1 -1
- package/lib/client.js.map +1 -1
- package/lib/helpers/esql.d.ts +3 -0
- package/lib/helpers/esql.js +31 -0
- package/lib/helpers/esql.js.map +1 -0
- package/lib/helpers.d.ts +5 -3
- package/lib/helpers.js +8 -9
- package/lib/helpers.js.map +1 -1
- package/package.json +3 -3
- package/platinum-report-junit.xml +0 -14
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"test/*": {"make": "npm run test:unit"},
|
|
3
|
+
"src/client.ts": { "alternate": "test/unit/client.test.ts", "type": "test" },
|
|
4
|
+
"test/unit/client.test.ts": { "alternate": "src/client.ts", "type": "src" },
|
|
5
|
+
"src/helpers.ts": { "alternate": "test/unit/helpers/", "type": "test" },
|
|
6
|
+
"test/unit/helpers/*.test.ts": { "alternate": "src/helpers.ts", "type": "src" }
|
|
7
|
+
}
|
package/.tool-versions
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodejs 21.7.2
|
package/README.md
CHANGED
|
@@ -6,19 +6,25 @@
|
|
|
6
6
|
|
|
7
7
|
The official Node.js client for Elasticsearch.
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Refer to the [Installation section](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_installation)
|
|
12
|
+
of the getting started documentation.
|
|
13
|
+
|
|
14
|
+
## Connecting
|
|
15
|
+
|
|
16
|
+
Refer to the [Connecting section](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_connecting)
|
|
17
|
+
of the getting started documentation.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
* [Creating an index](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_creating_an_index)
|
|
22
|
+
* [Indexing a document](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_indexing_documents)
|
|
23
|
+
* [Getting documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_getting_documents)
|
|
24
|
+
* [Searching documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_searching_documents)
|
|
25
|
+
* [Updating documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_updating_documents)
|
|
26
|
+
* [Deleting documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_deleting_documents)
|
|
27
|
+
* [Deleting an index](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_deleting_an_index)
|
|
22
28
|
|
|
23
29
|
### Node.js support
|
|
24
30
|
|
|
@@ -72,93 +78,45 @@ We recommend that you write a lightweight proxy that uses this client instead, y
|
|
|
72
78
|
|
|
73
79
|
## Documentation
|
|
74
80
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
## Quick start
|
|
88
|
-
|
|
89
|
-
```js
|
|
90
|
-
'use strict'
|
|
91
|
-
|
|
92
|
-
const { Client } = require('@elastic/elasticsearch')
|
|
93
|
-
const client = new Client({
|
|
94
|
-
cloud: { id: '<cloud-id>' },
|
|
95
|
-
auth: { apiKey: 'base64EncodedKey' }
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
async function run () {
|
|
99
|
-
// Let's start by indexing some data
|
|
100
|
-
await client.index({
|
|
101
|
-
index: 'game-of-thrones',
|
|
102
|
-
document: {
|
|
103
|
-
character: 'Ned Stark',
|
|
104
|
-
quote: 'Winter is coming.'
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
await client.index({
|
|
109
|
-
index: 'game-of-thrones',
|
|
110
|
-
document: {
|
|
111
|
-
character: 'Daenerys Targaryen',
|
|
112
|
-
quote: 'I am the blood of the dragon.'
|
|
113
|
-
}
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
await client.index({
|
|
117
|
-
index: 'game-of-thrones',
|
|
118
|
-
document: {
|
|
119
|
-
character: 'Tyrion Lannister',
|
|
120
|
-
quote: 'A mind needs books like a sword needs a whetstone.'
|
|
121
|
-
}
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
// here we are forcing an index refresh, otherwise we will not
|
|
125
|
-
// get any result in the consequent search
|
|
126
|
-
await client.indices.refresh({ index: 'game-of-thrones' })
|
|
127
|
-
|
|
128
|
-
// Let's search!
|
|
129
|
-
const result= await client.search({
|
|
130
|
-
index: 'game-of-thrones',
|
|
131
|
-
query: {
|
|
132
|
-
match: { quote: 'winter' }
|
|
133
|
-
}
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
console.log(result.hits.hits)
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
run().catch(console.log)
|
|
140
|
-
```
|
|
81
|
+
* [Introduction](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/introduction.html)
|
|
82
|
+
* [Usage](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#client-usage)
|
|
83
|
+
* [Client configuration](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-configuration.html)
|
|
84
|
+
* [API reference](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html)
|
|
85
|
+
* [Authentication](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#authentication)
|
|
86
|
+
* [Observability](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/observability.html)
|
|
87
|
+
* [Creating a child client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/child.html)
|
|
88
|
+
* [Client helpers](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-helpers.html)
|
|
89
|
+
* [Typescript support](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/typescript.html)
|
|
90
|
+
* [Testing](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-testing.html)
|
|
91
|
+
* [Examples](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/examples.html)
|
|
141
92
|
|
|
142
93
|
## Install multiple versions
|
|
143
94
|
If you are using multiple versions of Elasticsearch, you need to use multiple versions of the client. In the past, install multiple versions of the same package was not possible, but with `npm v6.9`, you can do that via aliasing.
|
|
144
95
|
|
|
145
96
|
The command you must run to install different version of the client is:
|
|
97
|
+
|
|
146
98
|
```sh
|
|
147
99
|
npm install <alias>@npm:@elastic/elasticsearch@<version>
|
|
148
100
|
```
|
|
149
|
-
|
|
101
|
+
|
|
102
|
+
So for example if you need to install `7.x` and `6.x`, you will run:
|
|
103
|
+
|
|
150
104
|
```sh
|
|
151
105
|
npm install es6@npm:@elastic/elasticsearch@6
|
|
152
106
|
npm install es7@npm:@elastic/elasticsearch@7
|
|
153
107
|
```
|
|
108
|
+
|
|
154
109
|
And your `package.json` will look like the following:
|
|
110
|
+
|
|
155
111
|
```json
|
|
156
112
|
"dependencies": {
|
|
157
113
|
"es6": "npm:@elastic/elasticsearch@^6.7.0",
|
|
158
114
|
"es7": "npm:@elastic/elasticsearch@^7.0.0"
|
|
159
115
|
}
|
|
160
116
|
```
|
|
117
|
+
|
|
161
118
|
You will require the packages from your code by using the alias you have defined.
|
|
119
|
+
|
|
162
120
|
```js
|
|
163
121
|
const { Client: Client6 } = require('es6')
|
|
164
122
|
const { Client: Client7 } = require('es7')
|
|
@@ -176,7 +134,10 @@ client6.info().then(console.log, console.log)
|
|
|
176
134
|
client7.info().then(console.log, console.log)
|
|
177
135
|
```
|
|
178
136
|
|
|
179
|
-
Finally, if you want to install the client for the next version of Elasticsearch
|
|
137
|
+
Finally, if you want to install the client for the next version of Elasticsearch
|
|
138
|
+
*(the one that lives in Elasticsearch’s main branch)*, you can use the following
|
|
139
|
+
command:
|
|
140
|
+
|
|
180
141
|
```sh
|
|
181
142
|
npm install esmain@github:elastic/elasticsearch-js
|
|
182
143
|
```
|
package/free-report-junit.xml
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0"?>
|
|
2
|
-
<testsuites id="2023-05-11T19:33:10.237Z" name="Integration test for Free api" time="1" tests="1" failures="0" skipped="0">
|
|
3
|
-
<testsuite id="2023-05-11T19:33:10.310Z" name="free/aggregations - /free/aggregations/percentiles_bucket.yml" time="1" tests="1" failures="0" skipped="0">
|
|
4
|
-
<testcase id="2023-05-11T19:33:10.310Z" name="format" file="/free/aggregations/percentiles_bucket.yml" time="1"/>
|
|
5
|
-
</testsuite>
|
|
6
|
-
</testsuites>
|