|
@@ -45,14 +45,20 @@ SearchClient.prototype.shouldIndexed = function(page) {
|
|
|
return true;
|
|
return true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+// BONSAI_URL is following format:
|
|
|
|
|
+// => https://{ID}:{PASSWORD}@{HOST}
|
|
|
SearchClient.prototype.parseUri = function(uri) {
|
|
SearchClient.prototype.parseUri = function(uri) {
|
|
|
- if (!(m = uri.match(/^elasticsearch:\/\/([^:]+):([^\/]+)\/(.+)$/))) {
|
|
|
|
|
- throw new Error('Invalid ELASTICSEARCH_URI format. Should be elasticsearch://host:port/index_name');
|
|
|
|
|
|
|
+ var index_name = 'crowi';
|
|
|
|
|
+ var host = uri;
|
|
|
|
|
+ if (m = uri.match(/^(https?:\/\/[^\/]+)\/(.+)$/)) {
|
|
|
|
|
+ host = m[1];
|
|
|
|
|
+ index_name = m[2];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
- host: m[1] + ':' + m[2],
|
|
|
|
|
- index_name: m[3],
|
|
|
|
|
|
|
+ host,
|
|
|
|
|
+ index_name,
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
|