I cannot seem to contact the elasticsearch database, below is a snippet on my code
var elasticsearch = require(['elasticsearch'], function() {
var client = new elasticsearch.Client({
host: 'localhost:9200',
log: 'trace'
});
});
var results = client.search(
{
"query": {
"bool": {
"must": [
{
"match_all": {}
},
]
}
}
})
The problem comes where I am unable to create a client, and it does not seem to recognise any elasticsearch when I try to import it using require.
Any help would be much appreciated.