优化代码,修复自动生成的es分词无效问题
This commit is contained in:
@@ -42,7 +42,7 @@ public class SystemLogVO implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "日志记录时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Field(type = FieldType.Date, format = DateFormat.basic_date_time)
|
||||
@Field(type = FieldType.Date, format = DateFormat.basic_date_time, fielddata = true)
|
||||
private Date createTime = new Date();
|
||||
|
||||
@ApiModelProperty(value = "请求用户")
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CustomWords extends BaseEntity {
|
||||
private String name;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "是否禁用")
|
||||
@ApiModelProperty(value = "是否禁用: 0,禁用;1,不禁用")
|
||||
private Integer disabled;
|
||||
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements
|
||||
for (EsGoodsAttribute esGoodsAttribute : goods.getAttrList()) {
|
||||
if (keywordsList.stream().noneMatch(i -> i.toLowerCase(Locale.ROOT).equals(esGoodsAttribute.getValue().toLowerCase(Locale.ROOT)))) {
|
||||
keywordsList.add(esGoodsAttribute.getValue());
|
||||
customWordsList.add(new CustomWords(esGoodsAttribute.getValue(), 0));
|
||||
customWordsList.add(new CustomWords(esGoodsAttribute.getValue(), 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -302,7 +302,7 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements
|
||||
for (AnalyzeResponse.AnalyzeToken token : tokens) {
|
||||
if (keywordsList.stream().noneMatch(i -> i.toLowerCase(Locale.ROOT).equals(token.getTerm().toLowerCase(Locale.ROOT)))) {
|
||||
keywordsList.add(token.getTerm());
|
||||
customWordsList.add(new CustomWords(token.getTerm(), 0));
|
||||
customWordsList.add(new CustomWords(token.getTerm(), 1));
|
||||
}
|
||||
//保存词条进入数据库
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user