Authored by wangnan

自动客服 fix

package com.yoho.search.consumer.index.fullbuild;
import com.yoho.search.consumer.index.common.IIndexBuilder;
import com.yoho.search.consumer.service.daoService.RobotQuestionService;
import com.yoho.search.dal.model.RobotQuestion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* Created by wangnan on 2016/11/29.
*/
@Component
public class RobotQuestionOldIndexBuilder extends IIndexBuilder {
@Autowired
private RobotQuestionService robotQuestionService;
@Override
public int getTotalCount() throws Exception {
return robotQuestionService.count();
}
@Override
public List<?> getPageLists(int offset, int limit) throws Exception {
return robotQuestionService.getSizePageLists(offset, limit);
}
@Override
public String getId(Object object) {
return ((RobotQuestion) object).getId().toString();
}
}
... ...
... ... @@ -59,6 +59,7 @@ public class IndexRebuildJob implements ApplicationEventPublisherAware {
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_STYLE);
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_STANDARD);
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_ROBOTQUESTION);
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_ROBOTQUESTION_OLD);
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_PRODUCT_PRICE_PLAN);
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_HELPER);
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_SHOPS);
... ...
index.analysis.analyzer.default.type: keyword
... ...
{
"robotquestionold": {
"_all":{
"enabled":false
},
"_source":{
"enabled":true
},
"properties": {
"id": {
"type": "integer"
},
"maxSortId": {
"type": "integer"
},
"middleSortId": {
"type": "integer"
},
"smallSortId": {
"type": "integer"
},
"question": {
"type": "text",
"analyzer": "ik_max_word"
},
"keywords": {
"type": "text",
"analyzer": "ik_max_word"
},
"pid": {
"type": "integer"
},
"createTime": {
"type": "integer"
},
"isDisable": {
"type": "integer"
},
"effectTime": {
"type": "integer"
},
"updatePid": {
"type": "integer"
},
"updateTime": {
"type": "integer"
},
"questionSeq": {
"type": "integer"
},
"clickTimes": {
"type": "integer"
},
"answer": {
"type": "text",
"index": "no"
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -153,6 +153,19 @@
</index>
<index>
<name>robotquestionold</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="1"/>
<property key="refresh_interval" value="10s"/>
<property key="translog.flush_threshold_size" value="100mb"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.RobotQuestionOldIndexBuilder</builderClass>
<mappingFile>esmapping/robotquestionold.json</mappingFile>
<analysisFile>analysis/robotquestionold.yml</analysisFile>
</index>
<index>
<name>shops</name>
<properties>
<property key="number_of_shards" value="1"/>
... ...
... ... @@ -106,7 +106,9 @@
<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.SuggestConversionIndexBuilder,com.yoho.search.consumer.index.fullbuild.SuggestConversionFromBrandIndexBuilder,com.yoho.search.consumer.index.fullbuild.SuggestConversionCustomIndexBuilder</builderClass>
<builderClass>
com.yoho.search.consumer.index.fullbuild.SuggestConversionIndexBuilder,com.yoho.search.consumer.index.fullbuild.SuggestConversionFromBrandIndexBuilder,com.yoho.search.consumer.index.fullbuild.SuggestConversionCustomIndexBuilder
</builderClass>
<mappingFile>esmapping/conversion.json</mappingFile>
<analysisFile>analysis/conversion.yml</analysisFile>
</index>
... ... @@ -151,6 +153,19 @@
</index>
<index>
<name>robotquestionold</name>
<properties>
<property key="number_of_shards" value="1"/>
<property key="number_of_replicas" value="${search.index.number_of_replicas}"/>
<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.RobotQuestionOldIndexBuilder</builderClass>
<mappingFile>esmapping/robotquestionold.json</mappingFile>
<analysisFile>analysis/robotquestionold.yml</analysisFile>
</index>
<index>
<name>shops</name>
<properties>
<property key="number_of_shards" value="1"/>
... ...