|
|
package com.yoho.search.consumer.index.fullbuild;
|
|
|
|
|
|
import com.yoho.search.base.utils.MD5Util;
|
|
|
import com.yoho.search.consumer.index.common.IIndexBuilder;
|
|
|
import com.yoho.search.consumer.service.base.SuggestConversionService;
|
|
|
import com.yoho.search.consumer.service.bo.ConversionBO;
|
...
|
...
|
@@ -13,6 +14,8 @@ import java.util.List; |
|
|
@Component
|
|
|
public class SuggestConversionIndexBuilder extends IIndexBuilder {
|
|
|
|
|
|
private static final int VALID_STATUS = 1;
|
|
|
|
|
|
@Autowired
|
|
|
private SuggestConversionService suggestConversionService;
|
|
|
|
...
|
...
|
@@ -28,7 +31,7 @@ public class SuggestConversionIndexBuilder extends IIndexBuilder { |
|
|
// 构建结果
|
|
|
List<ConversionBO> results = new ArrayList<>();
|
|
|
for (SuggestConversion item : list) {
|
|
|
results.add(new ConversionBO(item.getId(), item.getSource(), item.getDest()));
|
|
|
results.add(new ConversionBO(item.getSource(), item.getDest(), item.getUpdateTime(), VALID_STATUS));
|
|
|
}
|
|
|
|
|
|
return results;
|
...
|
...
|
@@ -36,7 +39,7 @@ public class SuggestConversionIndexBuilder extends IIndexBuilder { |
|
|
|
|
|
@Override
|
|
|
public String getId(Object object) {
|
|
|
return ((ConversionBO) object).getId().toString();
|
|
|
return MD5Util.string2MD5(((ConversionBO) object).getSource().trim().toLowerCase());
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|