修改标题检索bug

This commit is contained in:
梁琦涛
2024-07-24 16:28:37 +08:00
parent c52f2cff2d
commit a8d4cf994b
@@ -168,9 +168,18 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
select.append("( ");
for (int i = 0; i < searchContent.length; i++) {
regexp.append(searchContent[i]);
String str = searchContent[i].length() > 1 ?
searchContent[i].substring(0, searchContent[i].length() - 1) : "";
if(!StringUtils.isEmpty(str)){
int arr = str.length();
StringBuilder ss = new StringBuilder();
for (int i1 = 0; i1 < arr; i1++) {
ss.append("");
}
str = ss.toString();
}
select.append(" LENGTH(standard_name) - LENGTH(REPLACE(standard_name, '").append(searchContent[i])
.append("',").append(" '").append(searchContent[i].length() > 1 ?
searchContent[i].substring(0, searchContent[i].length() - 1) : "").append("')) ");
.append("',").append(" '").append(str).append("')) ");
if(i != searchContent.length - 1){
regexp.append("|");
select.append("+");