Authored by hugufei

重建索引时支持自动扩容

... ... @@ -9,6 +9,12 @@ import java.util.Map;
public interface IYohoIndex {
/**
* 获取索引属于的客户端
* @return
*/
public IElasticsearchClient getIndexClient();
/**
* 获取索引名
*
* @return
... ... @@ -22,7 +28,6 @@ public interface IYohoIndex {
*/
public void setYohoIndexName(String name);
/**
* 获取索引配置属性
*
... ... @@ -86,14 +91,6 @@ public interface IYohoIndex {
*/
public String getMappingContent();
/**
* 返回indexClient列表,按优先级排列
*
* @return
*/
public IElasticsearchClient getIndexClient();
/**
* 获取重建分页数
*/
... ...
... ... @@ -2,12 +2,15 @@ package com.yoho.search.consumer.common.impl;
import com.yoho.search.base.utils.FileUtils;
import com.yoho.search.base.utils.JaxbBinder;
import com.yoho.search.consumer.common.*;
import com.yoho.search.consumer.index.fullbuild.IIndexBuilder;
import com.yoho.search.consumer.index.fullbuild.listener.IndexRebuildListenerMgr;
import com.yoho.search.consumer.common.IYohoIndex;
import com.yoho.search.consumer.common.IYohoIndexDataLoader;
import com.yoho.search.consumer.common.IYohoIndexService;
import com.yoho.search.consumer.common.YohoIndexNameHelper;
import com.yoho.search.consumer.common.config.ClientConfig;
import com.yoho.search.consumer.common.config.IndexConfig;
import com.yoho.search.consumer.common.config.IndexConfigs;
import com.yoho.search.consumer.index.fullbuild.IIndexBuilder;
import com.yoho.search.consumer.index.fullbuild.listener.IndexRebuildListenerMgr;
import com.yoho.search.consumer.index.rebuild.RebuildFlagService;
import com.yoho.search.core.es.IElasticsearchClient;
import com.yoho.search.core.es.IYohoIndexClientFactory;
... ... @@ -15,6 +18,7 @@ import com.yoho.search.core.es.impl.YohoIndexClientFactoryImpl;
import com.yoho.search.core.es.model.ESBluk;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import org.apache.commons.collections.MapUtils;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse.AnalyzeToken;
import org.elasticsearch.action.bulk.BulkResponse;
... ... @@ -91,6 +95,7 @@ public class YohoIndexServiceImpl implements IYohoIndexService, ApplicationEvent
String servers = clientConfig.getProperties().get("es.servers");
IElasticsearchClient client = indexClientFactory.createIndexClient(clusterName, servers, "consumer");
for (IndexConfig indexConfig : clientConfig.getIndexConfigs()) {
Map<String, String> indexSettings = indexConfig.getProperties();
IYohoIndex index = new YohoIndexImpl(indexConfig.getName(), client, indexConfig.getProperties());
// 构造数据提供者
index.setIndexBuilderClassName(indexConfig.getBuilderClass());
... ... @@ -124,6 +129,32 @@ public class YohoIndexServiceImpl implements IYohoIndexService, ApplicationEvent
}
/**
* 每次重建索引时,根据集群状态决定分支分片数
*
* @param client
* @param indexSettings
* @return
*/
private int genNumberOfReplicas(IElasticsearchClient client, Map<String, String> indexSettings) {
try {
int numberOfDataNodes = client.getClusterHealthResponse().getNumberOfDataNodes();
if (numberOfDataNodes <= 1) {
return 0;
}
String numberOfReplicas = MapUtils.getString(indexSettings, "number_of_replicas");//配置的复制分片数
if (!"auto".equalsIgnoreCase(numberOfReplicas)) {
return Integer.valueOf(numberOfReplicas);
}
//获取索引配置的主分片数
int numberOfShards = MapUtils.getIntValue(indexSettings, "number_of_shards", 1);
return Math.max(1, numberOfDataNodes - numberOfShards);
} catch (Exception e) {
INDEX_REBUILD_LOG.error(e.getMessage(), e);
return 0;
}
}
/**
* 创建索引,并返回真实索引名称
*
* @param yohoIndexName
... ... @@ -155,6 +186,8 @@ public class YohoIndexServiceImpl implements IYohoIndexService, ApplicationEvent
indexSettings.putAll(index.getIndexSettings());
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);
// 5、删除旧索引别名
if (oldRealIndexNames != null && !oldRealIndexNames.isEmpty()) {
... ... @@ -280,10 +313,8 @@ public class YohoIndexServiceImpl implements IYohoIndexService, ApplicationEvent
if (yohoIndex == null) {
return;
}
Exception exception = null;
IElasticsearchClient client = yohoIndex.getIndexClient();
;
try {
long begin = System.currentTimeMillis();
INDEX_REBUILD_LOG.info("rebuild [{}],step=[1.rebuild begin], begin=[{}] ", yohoIndexName, begin);
... ... @@ -432,8 +463,7 @@ public class YohoIndexServiceImpl implements IYohoIndexService, ApplicationEvent
return false;
}
IElasticsearchClient client = index.getIndexClient();
client.indexHealth(indexName);
return false;
return client.indexHealth(indexName);
}
}
... ...
... ... @@ -11,7 +11,7 @@
<name>brand</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -25,7 +25,7 @@
<name>size</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -39,7 +39,7 @@
<name>style</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -53,7 +53,7 @@
<name>productcolor</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -67,7 +67,7 @@
<name>productsort</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -81,7 +81,7 @@
<name>productindex</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -95,7 +95,7 @@
<name>suggest</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -109,7 +109,7 @@
<name>conversion</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -125,7 +125,7 @@
<name>tblproductnew</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -139,7 +139,7 @@
<name>tblbrand</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -153,7 +153,7 @@
<name>standard</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -167,7 +167,7 @@
<name>robotquestion</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -181,7 +181,7 @@
<name>robotquestionold</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -195,7 +195,7 @@
<name>shops</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -209,7 +209,7 @@
<name>productpriceplan</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -223,7 +223,7 @@
<name>helper</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -237,7 +237,7 @@
<name>zqname</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -251,7 +251,7 @@
<name>sknimagevectors</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -265,7 +265,7 @@
<name>promotionindex</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -280,7 +280,7 @@
<name>customizetag</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -294,7 +294,7 @@
<name>bigdatasimilarskn</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -308,7 +308,7 @@
<name>promotiontype</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -322,7 +322,7 @@
<name>bigdatasortbrandvector</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -336,7 +336,7 @@
<name>bigdatasortbrandvectorw2v</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -350,7 +350,7 @@
<name>bigdatabrandvector</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -364,7 +364,7 @@
<name>bigdatabrandvectorw2v</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -378,7 +378,7 @@
<name>imagerepertory</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -392,7 +392,7 @@
<name>csrecallconfigcommon</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -406,7 +406,7 @@
<name>csrecallconfigproduct</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -420,7 +420,7 @@
<name>csrecallconfigsortbrand</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -434,7 +434,7 @@
<name>sknflow</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -448,7 +448,7 @@
<name>yohoproductanalysis</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -462,7 +462,7 @@
<name>shopsbrands</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -476,7 +476,7 @@
<name>bigdatasknimagevector</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
... ... @@ -490,130 +490,140 @@
<name>collageactivity</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.CollageActivityIndexBuilder</builderClass>
<mappingFile>esmapping/collageactivity.json</mappingFile>
<analysisFile>analysis/collageactivity.yml</analysisFile>
<rebuildPageSize>2500</rebuildPageSize>
</index>
<index>
<name>collageproduct</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.CollageProductIndexBuilder</builderClass>
<mappingFile>esmapping/collageproduct.json</mappingFile>
<analysisFile>analysis/collageproduct.yml</analysisFile>
<rebuildPageSize>2500</rebuildPageSize>
</index>
<index>
<name>cutpriceconfig</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="0"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.CutpriceConfigIndexBuilder</builderClass>
<mappingFile>esmapping/cutpriceconfig.json</mappingFile>
<analysisFile>analysis/cutpriceconfig.yml</analysisFile>
<rebuildPageSize>2500</rebuildPageSize>
</index>
<index>
<name>ufoproductindex</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ufo.UfoProductIndexBuilder</builderClass>
<mappingFile>esmapping/ufoproductindex.json</mappingFile>
<analysisFile>analysis/ufoproductindex.yml</analysisFile>
<rebuildPageSize>2500</rebuildPageSize>
</index>
<index>
<name>ufobrand</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ufo.UfoBrandIndexBuilder</builderClass>
<mappingFile>esmapping/ufobrand.json</mappingFile>
<analysisFile>analysis/ufobrand.yml</analysisFile>
<rebuildPageSize>2500</rebuildPageSize>
</index>
<index>
<name>ufosort</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ufo.UfoSortIndexBuilder</builderClass>
<mappingFile>esmapping/ufosort.json</mappingFile>
<analysisFile>analysis/ufosort.yml</analysisFile>
<rebuildPageSize>2500</rebuildPageSize>
</index>
<index>
<name>ufocolor</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ufo.UfoColorIndexBuilder</builderClass>
<mappingFile>esmapping/ufocolor.json</mappingFile>
<analysisFile>analysis/ufocolor.yml</analysisFile>
<rebuildPageSize>2500</rebuildPageSize>
</index>
<index>
<name>ufosize</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ufo.UfoSizeIndexBuilder</builderClass>
<mappingFile>esmapping/ufosize.json</mappingFile>
<analysisFile>analysis/ufosize.yml</analysisFile>
<rebuildPageSize>2500</rebuildPageSize>
</index>
<index>
<name>cutdownpriceactivity</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.CutdownPriceActivityIndexBuilder</builderClass>
<mappingFile>esmapping/cutdownpriceactivity.json</mappingFile>
<analysisFile>analysis/cutdownpriceactivity.yml</analysisFile>
<rebuildPageSize>2500</rebuildPageSize>
</index>
<index>
<name>cutdownpriceproduct</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.CutdownPriceProductIndexBuilder</builderClass>
<mappingFile>esmapping/cutdownpriceproduct.json</mappingFile>
<analysisFile>analysis/cutdownpriceproduct.yml</analysisFile>
<rebuildPageSize>2500</rebuildPageSize>
</index>
</client>
... ...
... ... @@ -11,7 +11,7 @@
<name>brand</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -25,7 +25,7 @@
<name>size</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -39,7 +39,7 @@
<name>style</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -53,7 +53,7 @@
<name>productcolor</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -67,7 +67,7 @@
<name>productsort</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -81,7 +81,7 @@
<name>productindex</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -95,7 +95,7 @@
<name>suggest</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -109,7 +109,7 @@
<name>conversion</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -123,7 +123,7 @@
<name>tblproductnew</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -137,7 +137,7 @@
<name>tblbrand</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -151,7 +151,7 @@
<name>standard</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -165,7 +165,7 @@
<name>robotquestion</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -179,7 +179,7 @@
<name>robotquestionold</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -193,7 +193,7 @@
<name>shops</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -207,7 +207,7 @@
<name>productpriceplan</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -221,7 +221,7 @@
<name>helper</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -235,7 +235,7 @@
<name>zqname</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -249,7 +249,7 @@
<name>sknimagevectors</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -263,7 +263,7 @@
<name>promotionindex</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -278,7 +278,7 @@
<name>customizetag</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -292,7 +292,7 @@
<name>bigdatasimilarskn</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -306,7 +306,7 @@
<name>promotiontype</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -320,7 +320,7 @@
<name>bigdatasortbrandvector</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -334,7 +334,7 @@
<name>bigdatasortbrandvectorw2v</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -348,7 +348,7 @@
<name>bigdatabrandvector</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -362,7 +362,7 @@
<name>bigdatabrandvectorw2v</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -378,7 +378,7 @@
<name>imagerepertory</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -393,7 +393,7 @@
<name>csrecallconfigcommon</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -409,7 +409,7 @@
<name>csrecallconfigproduct</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -423,7 +423,7 @@
<name>csrecallconfigsortbrand</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -437,7 +437,7 @@
<name>sknflow</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -451,7 +451,7 @@
<name>yohoproductanalysis</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -465,7 +465,7 @@
<name>shopsbrands</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
... ... @@ -493,130 +493,140 @@
<name>collageactivity</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.CollageActivityIndexBuilder</builderClass>
<mappingFile>esmapping/collageactivity.json</mappingFile>
<analysisFile>analysis/collageactivity.yml</analysisFile>
<rebuildPageSize>${search.index.batch.limit}</rebuildPageSize>
</index>
<index>
<name>collageproduct</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.CollageProductIndexBuilder</builderClass>
<mappingFile>esmapping/collageproduct.json</mappingFile>
<analysisFile>analysis/collageproduct.yml</analysisFile>
<rebuildPageSize>${search.index.batch.limit}</rebuildPageSize>
</index>
<index>
<name>cutpriceconfig</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.CutpriceConfigIndexBuilder</builderClass>
<mappingFile>esmapping/cutpriceconfig.json</mappingFile>
<analysisFile>analysis/cutpriceconfig.yml</analysisFile>
<rebuildPageSize>${search.index.batch.limit}</rebuildPageSize>
</index>
<index>
<name>ufoproductindex</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ufo.UfoProductIndexBuilder</builderClass>
<mappingFile>esmapping/ufoproductindex.json</mappingFile>
<analysisFile>analysis/ufoproductindex.yml</analysisFile>
<rebuildPageSize>${search.index.batch.limit}</rebuildPageSize>
</index>
<index>
<name>ufobrand</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ufo.UfoBrandIndexBuilder</builderClass>
<mappingFile>esmapping/ufobrand.json</mappingFile>
<analysisFile>analysis/ufobrand.yml</analysisFile>
<rebuildPageSize>${search.index.batch.limit}</rebuildPageSize>
</index>
<index>
<name>ufosort</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ufo.UfoSortIndexBuilder</builderClass>
<mappingFile>esmapping/ufosort.json</mappingFile>
<analysisFile>analysis/ufosort.yml</analysisFile>
<rebuildPageSize>${search.index.batch.limit}</rebuildPageSize>
</index>
<index>
<name>ufocolor</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ufo.UfoColorIndexBuilder</builderClass>
<mappingFile>esmapping/ufocolor.json</mappingFile>
<analysisFile>analysis/ufocolor.yml</analysisFile>
<rebuildPageSize>${search.index.batch.limit}</rebuildPageSize>
</index>
<index>
<name>ufosize</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ufo.UfoSizeIndexBuilder</builderClass>
<mappingFile>esmapping/ufosize.json</mappingFile>
<analysisFile>analysis/ufosize.yml</analysisFile>
<rebuildPageSize>${search.index.batch.limit}</rebuildPageSize>
</index>
<index>
<name>cutdownpriceactivity</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.CutdownPriceActivityIndexBuilder</builderClass>
<mappingFile>esmapping/cutdownpriceactivity.json</mappingFile>
<analysisFile>analysis/cutdownpriceactivity.yml</analysisFile>
<rebuildPageSize>${search.index.batch.limit}</rebuildPageSize>
</index>
<index>
<name>cutdownpriceproduct</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<property key="number_of_replicas" value="auto"/>
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_size" value="${search.index.translog.flush_threshold_size}"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.CutdownPriceProductIndexBuilder</builderClass>
<mappingFile>esmapping/cutdownpriceproduct.json</mappingFile>
<analysisFile>analysis/cutdownpriceproduct.yml</analysisFile>
<rebuildPageSize>${search.index.batch.limit}</rebuildPageSize>
</index>
</client>
... ...