Upload files to 'pages/students/2016/jan_holp/dp2021/zdrojove_subory'
skript na kontrolu indexovanych dat
This commit is contained in:
parent
7a64cf7592
commit
84a1e6d6ad
@ -0,0 +1,28 @@
|
|||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const elasticsearch = require('elasticsearch');
|
||||||
|
const esClient = new elasticsearch.Client({
|
||||||
|
host: '127.0.0.1:9200',
|
||||||
|
log: 'error'
|
||||||
|
});
|
||||||
|
|
||||||
|
const indices = function indices() {
|
||||||
|
return esClient.cat.indices({v: true})
|
||||||
|
.then(console.log)
|
||||||
|
.catch(err => console.error(`Error connecting to the es client: ${err}`));
|
||||||
|
};
|
||||||
|
|
||||||
|
// only for testing purposes
|
||||||
|
// all calls should be initiated through the module
|
||||||
|
const test = function test() {
|
||||||
|
console.log(`elasticsearch indices information:`);
|
||||||
|
indices();
|
||||||
|
};
|
||||||
|
|
||||||
|
test();
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
indices
|
||||||
|
};
|
||||||
|
} ());
|
Loading…
Reference in New Issue
Block a user