浏览代码

feat:数据导出

wangshan 3 年之前
父节点
当前提交
d332fd46c3

+ 2 - 2
src/jfw/modules/common/src/qfw/util/bidsearch/search.go

@@ -273,7 +273,7 @@ func GetSearchQuery(keyword, industry, minprice, maxprice, hasBuyerTel, hasWinne
 			if len([]rune(elastic.ReplaceYH(v))) == 1 {
 				//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
 				if DetailFileORTitle(findfields) {
-					keyword_multi_match = fmt.Sprintf(multi_match, "%s", findfields+`"title"`)
+					keyword_multi_match = fmt.Sprintf(multi_match, "%s", findfields+`,"title"`)
 				}
 			} else {
 				//标题+全文搜索 搜索类型开关打开 默认搜索全文;(全文包含标题)(单字排除)
@@ -349,7 +349,7 @@ func GetSearchQuery(keyword, industry, minprice, maxprice, hasBuyerTel, hasWinne
 			if len([]rune(elastic.ReplaceYH(v))) == 1 {
 				//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
 				if DetailFileORTitle(findfields) {
-					notkey_multi_match = fmt.Sprintf(multi_match, "%s", findfields+`"title"`)
+					notkey_multi_match = fmt.Sprintf(multi_match, "%s", findfields+`,"title"`)
 				}
 			}
 			notkey_must_not = append(notkey_must_not, fmt.Sprintf(notkey_multi_match, elastic.ReplaceYH(v)))

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

@@ -268,7 +268,7 @@ func getDataExportSql(scd *SieveCondition) string {
 					for _, vk := range strings.Split(v.Keyword, "+") {
 						//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
 						if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(scd.SelectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
-							queryItem = strings.ReplaceAll(scd.SelectType+"title", ",", "\",\"")
+							queryItem = strings.ReplaceAll(scd.SelectType+",title", ",", "\",\"")
 							shouldsKey := fmt.Sprintf(multi_match, "\""+vk+"\"", "\""+queryItem+"\"")
 							shoulds = append(shoulds, shouldsKey)
 						} else {
@@ -279,7 +279,7 @@ func getDataExportSql(scd *SieveCondition) string {
 					for _, vk := range strings.Split(v.Keyword, " ") {
 						//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
 						if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(scd.SelectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
-							queryItem = strings.ReplaceAll(scd.SelectType+"title", ",", "\",\"")
+							queryItem = strings.ReplaceAll(scd.SelectType+",title", ",", "\",\"")
 							shouldsKey := fmt.Sprintf(multi_match, "\""+vk+"\"", "\""+queryItem+"\"")
 							shoulds = append(shoulds, shouldsKey)
 						} else {
@@ -289,7 +289,7 @@ func getDataExportSql(scd *SieveCondition) string {
 				} else {
 					//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
 					if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(scd.SelectType) && len([]rune(elastic.ReplaceYH(v.Keyword))) == 1 {
-						queryItem = strings.ReplaceAll(scd.SelectType+"title", ",", "\",\"")
+						queryItem = strings.ReplaceAll(scd.SelectType+",title", ",", "\",\"")
 						shouldsKey := fmt.Sprintf(multi_match, "\""+v.Keyword+"\"", "\""+queryItem+"\"")
 						shoulds = append(shoulds, shouldsKey)
 					} else {
@@ -307,7 +307,7 @@ func getDataExportSql(scd *SieveCondition) string {
 			for _, vv := range v.Exclude {
 				//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
 				if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(scd.SelectType) && len([]rune(elastic.ReplaceYH(vv))) == 1 {
-					queryItem = strings.ReplaceAll(scd.SelectType+"title", ",", "\",\"")
+					queryItem = strings.ReplaceAll(scd.SelectType+",title", ",", "\",\"")
 					shouldsKey := fmt.Sprintf(multi_match, "\""+vv+"\"", "\""+queryItem+"\"")
 					shoulds = append(shoulds, shouldsKey)
 				} else {