|
@@ -242,7 +242,7 @@ func EsComprehensiveSearch(keyWord string, startSize, pageSize int) (result []*S
|
|
searchItem.Body = append(searchItem.Body, vText)
|
|
searchItem.Body = append(searchItem.Body, vText)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ searchItem.IsSummary = article.IsSummary
|
|
if len(searchItem.Body) == 0 {
|
|
if len(searchItem.Body) == 0 {
|
|
bodyRune := []rune(article.BodyText)
|
|
bodyRune := []rune(article.BodyText)
|
|
bodyRuneLen := len(bodyRune)
|
|
bodyRuneLen := len(bodyRune)
|
|
@@ -731,6 +731,8 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
|
|
var condition string
|
|
var condition string
|
|
var pars []interface{}
|
|
var pars []interface{}
|
|
uid := user.UserId
|
|
uid := user.UserId
|
|
|
|
+ titleHighlight := make(map[int]string)
|
|
|
|
+ bodyHighlight := make(map[int][]string)
|
|
mapItems := make(map[string]*models.CygxResourceDataNewResp)
|
|
mapItems := make(map[string]*models.CygxResourceDataNewResp)
|
|
for _, v := range list {
|
|
for _, v := range list {
|
|
//预处理文章
|
|
//预处理文章
|
|
@@ -738,6 +740,14 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
|
|
item.SourceId = v.SourceId
|
|
item.SourceId = v.SourceId
|
|
item.Source = v.Source
|
|
item.Source = v.Source
|
|
item.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
|
|
item.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
|
|
|
|
+ if v.IsSummary == 1 {
|
|
|
|
+ item.BodyHighlight = v.Body
|
|
|
|
+ titleHighlight[v.SourceId] = v.Title
|
|
|
|
+ bodyHighlight[v.SourceId] = v.Body
|
|
|
|
+ //fmt.Println(v.Title)
|
|
|
|
+ } else {
|
|
|
|
+ item.BodyHighlight = make([]string, 0)
|
|
|
|
+ }
|
|
mapItems[fmt.Sprint(v.Source, v.SourceId)] = item
|
|
mapItems[fmt.Sprint(v.Source, v.SourceId)] = item
|
|
}
|
|
}
|
|
|
|
|
|
@@ -831,6 +841,16 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
|
|
}
|
|
}
|
|
for _, v := range articleList {
|
|
for _, v := range articleList {
|
|
v.Body = ""
|
|
v.Body = ""
|
|
|
|
+ if titleHighlight[v.ArticleId] != "" {
|
|
|
|
+ v.Title = titleHighlight[v.ArticleId]
|
|
|
|
+ }
|
|
|
|
+ if len(bodyHighlight[v.ArticleId]) > 0 {
|
|
|
|
+ v.Abstract = ""
|
|
|
|
+ v.Annotation = ""
|
|
|
|
+ v.BodyHighlight = bodyHighlight[v.ArticleId]
|
|
|
|
+ } else {
|
|
|
|
+ v.BodyHighlight = make([]string, 0)
|
|
|
|
+ }
|
|
mapItems[fmt.Sprint("article", v.ArticleId)].Article = v
|
|
mapItems[fmt.Sprint("article", v.ArticleId)].Article = v
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -979,6 +999,7 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ listIndustrialResourceIds, _ = HandleIndustryList(listIndustrialResourceIds, user, "Hz")
|
|
for _, v := range listIndustrialResourceIds {
|
|
for _, v := range listIndustrialResourceIds {
|
|
mapItems[fmt.Sprint("industrialsource", v.IndustrialManagementId)].IndustrialResource = v
|
|
mapItems[fmt.Sprint("industrialsource", v.IndustrialManagementId)].IndustrialResource = v
|
|
}
|
|
}
|