...
|
...
|
@@ -187,8 +187,10 @@ public class YohoIndexServiceImpl implements IYohoIndexService, ApplicationEvent |
|
|
indexSettings.putAll(index.getAnalysisSettings());//设置分词器信息
|
|
|
indexSettings.put("max_result_window", "100000000");
|
|
|
indexSettings.put("number_of_replicas", this.genNumberOfReplicas(client, index.getIndexSettings()));//处理复制分片
|
|
|
|
|
|
client.createIndex(newRealIndexName, type, indexSettings, mappingContent);
|
|
|
// 打印索引设置
|
|
|
INDEX_REBUILD_LOG.info("rebuild [{}],step=[3.createTempIndex success],newRealIndexName = [{}], mappingContent=[{}],indexSettings=[{}]", yohoIndexName, newRealIndexName, mappingContent, indexSettings);
|
|
|
|
|
|
// 5、删除旧索引别名
|
|
|
if (oldRealIndexNames != null && !oldRealIndexNames.isEmpty()) {
|
|
|
client.removeAlias(oldRealIndexNames, alias);
|
...
|
...
|
@@ -333,10 +335,6 @@ public class YohoIndexServiceImpl implements IYohoIndexService, ApplicationEvent |
|
|
|
|
|
// 3、获取临时索引的别名
|
|
|
String yohoTemplateIndexName = yohoIndexNameHelper.genYohoTemplateIndexName(yohoIndexName);
|
|
|
|
|
|
// 4、创建临时索引
|
|
|
INDEX_REBUILD_LOG.info("rebuild [{}],step=[3.createTempIndex begin],mappingContent=[{}],properties=[{}]", yohoIndexName, yohoIndex.getMappingContent(),
|
|
|
yohoIndex.getIndexSettings());
|
|
|
String tempIndexRealName = this.createIndex(yohoIndexName, yohoTemplateIndexName, false);
|
|
|
INDEX_REBUILD_LOG.info("rebuild [{}],step=[3.createTempIndex success],tempIndexRealName=[{}],", yohoIndexName, tempIndexRealName);
|
|
|
|
...
|
...
|
|