修改es查询岗位类别时,条件改为类比和名称

This commit is contained in:
sh
2025-12-01 12:45:36 +08:00
parent da3307a7b7
commit ffa68734bc

View File

@@ -406,7 +406,11 @@ public class ESJobSearchImpl implements IESJobSearchService
wrapper.and(x->x.le(ESJobDocument::getExperience_int,maxValue)); wrapper.and(x->x.le(ESJobDocument::getExperience_int,maxValue));
} }
if(!StringUtil.isEmptyOrNull(esJobSearch.getJobCategory())){ if(!StringUtil.isEmptyOrNull(esJobSearch.getJobCategory())){
wrapper.and(x->x.eq(ESJobDocument::getJobCategory,esJobSearch.getJobCategory())); //wrapper.and(x->x.eq(ESJobDocument::getJobCategory,esJobSearch.getJobCategory()));
String targetValue = esJobSearch.getJobCategory();
wrapper.and(x -> x.like(ESJobDocument::getJobCategory, targetValue)
.or()
.like(ESJobDocument::getJobTitle, targetValue));
} }
if(!StringUtil.isEmptyOrNull(esJobSearch.getScale())){ if(!StringUtil.isEmptyOrNull(esJobSearch.getScale())){
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getScale()); Integer maxValue = StringUtil.findMaxValue(esJobSearch.getScale());