Compare commits
3 Commits
3a7b648e1b
...
6225af2d42
Author | SHA1 | Date |
---|---|---|
wangliwen | 6225af2d42 | |
wangliwen | af93de247d | |
wangliwen | a087eea1bf |
|
@ -101,6 +101,8 @@ import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -601,8 +603,15 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean nonChinese = jsonObject.containsKey("nonChinese") ? jsonObject.getBoolean("nonChinese") : Boolean.FALSE; // 不传默认为中文走全文索引
|
Boolean nonChinese = jsonObject.containsKey("nonChinese") ? jsonObject.getBoolean("nonChinese") : Boolean.FALSE; // 不传默认为中文走全文索引
|
||||||
|
Pattern isChinese = Pattern.compile("[\u4e00-\u9fa5]"); // 中文
|
||||||
|
String name = jsonObject.containsKey("name") ? jsonObject.getString("name") : "";
|
||||||
|
Matcher isChineseMatcher = isChinese.matcher(name);
|
||||||
|
if (!nonChinese && (isChineseMatcher.matches() && name.length() < 2)) {
|
||||||
|
nonChinese = Boolean.TRUE;
|
||||||
|
} else if (name.length() < 2) { // 长度小于分词长度2
|
||||||
|
nonChinese = Boolean.TRUE;
|
||||||
|
}
|
||||||
//默认按上架时间降序排列
|
//默认按上架时间降序排列
|
||||||
String orderField;
|
String orderField;
|
||||||
if (StringUtils.isBlank(jsonObject.getString("orderField"))) {
|
if (StringUtils.isBlank(jsonObject.getString("orderField"))) {
|
||||||
|
|
Loading…
Reference in New Issue