You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
447 B
JavaScript
20 lines
447 B
JavaScript
'use strict';
|
|
|
|
const fs = require("fs");
|
|
const Promise = require("bluebird");
|
|
const elasticSearch = new require("elasticsearch").Client({
|
|
host: "localhost:9200",
|
|
log: "trace"
|
|
});
|
|
|
|
let nodeTypes = JSON.parse(fs.readFileSync("./sample/elasticsearch-node-types.json"));
|
|
|
|
Promise.map(nodeTypes, (type) => {
|
|
return elasticSearch.create({
|
|
index: "node_types",
|
|
type: "node_type",
|
|
body: type
|
|
});
|
|
}).then((results) => {
|
|
console.log(results);
|
|
}); |