Browse Source

no message

xingzai 1 year ago
parent
commit
32d3e6a680
1 changed files with 18 additions and 14 deletions
  1. 18 14
      services/es_comprehensive.go

+ 18 - 14
services/es_comprehensive.go

@@ -885,15 +885,15 @@ func EsComprehensiveSearch(keyWord string, startSize, pageSize int) (result []*S
 					}
 				}
 				//searchItem.IsSummary = article.IsSummary
-				if len(searchItem.Body) == 0 {
-					bodyRune := []rune(article.BodyText)
-					bodyRuneLen := len(bodyRune)
-					if bodyRuneLen > 100 {
-						bodyRuneLen = 100
-					}
-					body := string(bodyRune[:bodyRuneLen])
-					searchItem.Body = []string{body}
-				}
+				//if len(searchItem.Body) == 0 {
+				//	bodyRune := []rune(article.BodyText)
+				//	bodyRuneLen := len(bodyRune)
+				//	if bodyRuneLen > 100 {
+				//		bodyRuneLen = 100
+				//	}
+				//	body := string(bodyRune[:bodyRuneLen])
+				//	searchItem.Body = []string{body}
+				//}
 				var title string
 				if len(v.Highlight["Title"]) > 0 {
 					title = v.Highlight["Title"][0]
@@ -1447,14 +1447,18 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
 			if v.ProductInterior != nil && v.SourceId == vList.SourceId {
 				v.ProductInterior.Title = vList.Title
 			}
-			if v.IndustrialResource != nil && v.SourceId == vList.SourceId {
-				v.Source = "industrialsource"
-				v.IndustrialResource.PublishDate = vList.PublishDate
-			}
-			if v.SourceId == vList.SourceId {
+			//if v.IndustrialResource != nil && v.SourceId == vList.SourceId {
+			//	v.IndustrialResource.UpdateTime = vList.PublishDate
+			//}
+			if v.SourceId == vList.SourceId && v.Source == vList.Source {
 				items = append(items, v)
 			}
 		}
 	}
+	for _, v := range items {
+		if v.IndustrialResource != nil {
+			v.Source = "industrialsource"
+		}
+	}
 	return
 }