Skip to content

Commit

Permalink
fixed the way we fetch the info about the index
Browse files Browse the repository at this point in the history
  • Loading branch information
zotya committed Mar 15, 2023
1 parent da60c15 commit 9289e39
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions searchlib/lib/getIndexInfo.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import superagent from 'superagent';
import * as path from 'path';

function trim_slash(text) {
return text.replace(/^\/+|\/+$/g, '');
}

export default async function getIndexInfo(config) {
const { host, elastic_index } = config;
const settings_url = path.join(host, elastic_index, '_settings');
const alias_url = path.join(host, elastic_index, '_alias');
const settings_url =
trim_slash(host) + '/' + trim_slash(elastic_index) + '/_settings';
const alias_url =
trim_slash(host) + '/' + trim_slash(elastic_index) + '/_alias';

try {
const settings_resp = await superagent
Expand Down

0 comments on commit 9289e39

Please sign in to comment.