Compare commits
2 Commits
9e7d473749
...
af93de247d
Author | SHA1 | Date |
---|---|---|
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