Format index name with namespace (#4758)

* Format index name with namespace

Signed-off-by: Gao Hongtao <hanahmily@gmail.com>

* Use another variable to compare index name

Signed-off-by: Gao Hongtao <hanahmily@gmail.com>

Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
This commit is contained in:
Gao Hongtao 2020-05-08 20:12:56 +08:00 committed by GitHub
parent b5c9a64fa9
commit 1d5a0b0f1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -67,7 +67,8 @@ public class HistoryDeleteEsDAO extends EsDAO implements IHistoryDeleteDAO {
client.deleteByIndexName(prepareDeleteIndex);
}
String latestIndex = TimeSeriesUtils.latestWriteIndexName(model);
if (!leftIndices.contains(latestIndex)) {
String formattedLatestIndex = client.formatIndexName(latestIndex);
if (!leftIndices.contains(formattedLatestIndex)) {
client.createIndex(latestIndex);
}
}