فهرست منبع

fix:数据导出分词处理

duxin 3 سال پیش
والد
کامیت
905f09e50a
1فایلهای تغییر یافته به همراه12 افزوده شده و 4 حذف شده
  1. 12 4
      src/jfw/modules/common/src/qfw/util/dataexport/dataexport.go

+ 12 - 4
src/jfw/modules/common/src/qfw/util/dataexport/dataexport.go

@@ -251,17 +251,25 @@ func getDataExportSql(scd *SieveCondition) string {
 				scd.Keyword = []KeyWord{KeyWordSearch}
 			}
 		}
-
 		for _, v := range scd.Keyword {
 			shoulds := []string{}
 			must_not := []string{}
-			//附加词
+
 			if v.Keyword != "" {
-				for _, vk := range strings.Split(v.Keyword, " ") {
-					shoulds = append(shoulds, fmt.Sprintf(multi_match, "\""+vk+"\""))
+				if strings.Contains(scd.Keyword[0].Keyword, "+") {
+					for _, vk := range strings.Split(v.Keyword, "+") {
+						shoulds = append(shoulds, fmt.Sprintf(multi_match, "\""+vk+"\""))
+					}
+				} else if strings.Contains(scd.Keyword[0].Keyword, " ") {
+					for _, vk := range strings.Split(v.Keyword, " ") {
+						shoulds = append(shoulds, fmt.Sprintf(multi_match, "\""+vk+"\""))
+					}
+				} else {
+					shoulds = append(shoulds, fmt.Sprintf(multi_match, "\""+scd.Keyword[0].Keyword+"\""))
 				}
 			}
 
+			//附加词
 			for _, vv := range v.Appended {
 				shoulds = append(shoulds, fmt.Sprintf(multi_match, "\""+vv+"\""))
 			}