Using the REST API it is possible to determine the server version number (in this case "7.10.2")
curl 'https://search-elasticsearch-aws-710-public-v7fycso36gekt3vjabelkne2fa.eu-west-1.es.amazonaws.com'
{
"name" : "3af17e13e3e29b64cd0f32c57edadc0e",
"cluster_name" : "206020203570:elasticsearch-aws-710-public",
"cluster_uuid" : "i19BVkuJTjmivIeg0VRWwA",
"version" : {
"number" : "7.10.2",
"build_flavor" : "oss",
"build_type" : "tar",
"build_hash" : "unknown",
"build_date" : "2021-07-20T13:48:00.963660Z",
"build_snapshot" : false,
"lucene_version" : "8.7.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
Is it possible to return the same information using only the @elastic/elasticsearch
js library?
CodePudding user response:
Figured it out!
- https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#_info
const elasticsearch = require('@elastic/elasticsearch');
const client = new elasticsearch.Client(options);
client.info().then(info => {
console.log(info);
});
{
"name": "65efdbcd59450304fa4d07a7faf0cd83",
"cluster_name": "891817851964:content-api-es7-test",
"cluster_uuid": "5soRYzoSQPiinSp4kDIG8B",
"version": {
"number": "7.10.2",
"build_flavor": "oss",
"build_type": "tar",
"build_hash": "unknown",
"build_date": "2021-07-20T13:48:00.963660Z",
"build_snapshot": false,
"lucene_version": "8.7.0",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
},
"tagline": "You Know, for Search"
}