This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// credit goes to this stack overflow post - http://stackoverflow.com/questions/20646836/is-there-any-way-to-import-a-json-filecontains-100-documents-in-elasticsearch | |
var elasticsearch = require('elasticsearch'), | |
fs = require('fs'), | |
pubs = JSON.parse(fs.readFileSync(__dirname + '/pubs.json')), // name of my first file to parse | |
forms = JSON.parse(fs.readFileSync(__dirname + '/forms.json')); // and the second set | |
var client = new elasticsearch.Client({ // default is fine for me, change as you see fit | |
host: 'localhost:9200', | |
log: 'trace' | |
}); |