Skip to content

Commit

Permalink
Remove references to elasticsearch client, use tlConfig.server in es.…
Browse files Browse the repository at this point in the history
…js. Closes elastic#6
  • Loading branch information
Rashid Khan committed Sep 15, 2015
1 parent d7b875a commit 52ddd1b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
4 changes: 0 additions & 4 deletions routes/validate_es.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
var Promise = require('bluebird');
var elasticsearch = require('elasticsearch');


module.exports = function (server) {
server.route({
method: 'GET',
Expand Down
5 changes: 1 addition & 4 deletions series_functions/es.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var _ = require('lodash');
var moment = require('moment');
var Datasource = require('../lib/classes/datasource');
var elasticsearch = require('elasticsearch');

var offset = {
request: function (request, offset) {
Expand Down Expand Up @@ -152,9 +151,7 @@ module.exports = new Datasource('es', {
throw new Error('url= is not allowed');
}

var client = new elasticsearch.Client({
host: config.url,
});
var client = tlConfig.server.plugins.elasticsearch.client;

var body = buildRequest(config, tlConfig);
return client.search(body).then(function (resp) {
Expand Down

0 comments on commit 52ddd1b

Please sign in to comment.