Browse Source

REPORT-71309 && REPORT-71298 搜索展示异常

final/11.0
hades 3 years ago
parent
commit
43f7b03a3e
  1. 16
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java

16
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java

@ -32,6 +32,10 @@ public class AlphaFineUtil {
private static String getReplacedString(String modelName, String string) {
// 如果是直接包含了高亮字符 返回
if (modelName.contains(string)) {
return string;
}
//需要考虑modelName有空格的情况
//比如现在是work boo k 搜索词是workb,应该要替换的部分是work b
//先去掉已经匹配替换过的部分,因为考虑到分词的情况,可能会进行多次替换
@ -53,6 +57,18 @@ public class AlphaFineUtil {
return result.toString();
}
public static String escapeExprSpecialWord(String keyword) {
if (StringUtils.isNotBlank(keyword)) {
String[] fbsArr = { "\\", "$", "(", ")", "*", "+", ".", "[", "]", "?", "^", "{", "}", "|" };
for (String key : fbsArr) {
if (keyword.contains(key)) {
keyword = keyword.replace(key, "\\" + key);
}
}
}
return keyword;
}
public static boolean unread() {
Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet();
Set<Long> idSet = ProductNewsSearchManager.getInstance().getIdSet();

Loading…
Cancel
Save