Skip to content

Commit

Permalink
#2201 fix search does not work with default ES configuraiton
Browse files Browse the repository at this point in the history
  • Loading branch information
kscc25 committed Sep 5, 2017
1 parent bf9aabb commit c250d4d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion backend/core/elasticsearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ function getConfigurationHash(config) {
return md5sum.digest('hex');
}

/**
* Get default Elasticsearch configuration. We clone the default config because
* the ES client modifies the config object.
* See more at https://github.com/elastic/elasticsearch-js/issues/33
*
* @return {Object} a copy of default Elasticsearch configuration
*/
function getDefaultConfig() {
return Object.assign({}, DEFAULT_CONFIG);
}

/**
* Update the current Client
*
Expand All @@ -43,7 +54,7 @@ function updateClient(callback) {
}

if (!data) {
data = DEFAULT_CONFIG;
data = getDefaultConfig();
}

var hash = getConfigurationHash(data);
Expand Down

0 comments on commit c250d4d

Please sign in to comment.