Browse Source

no message

xingzai 1 year ago
parent
commit
8eeeacd328
2 changed files with 12 additions and 10 deletions
  1. 11 9
      controllers/search.go
  2. 1 1
      services/es_comprehensive.go

+ 11 - 9
controllers/search.go

@@ -671,15 +671,14 @@ func (this *SearchController) ListHomeArtAndChartPage() {
 		}
 	}
 	//记录用户搜索关键词
-	var source int
-	if listType == 1 {
-		source = 3
-	} else if listType == 2 {
-		source = 1
-	} else {
-		source = 2
-	}
-	go services.AddSearchKeyWord(user, keyWord, source)
+	//var source int
+	//if listType == 1 {
+	//	source = 3
+	//} else if listType == 2 {
+	//	source = 1
+	//} else {
+	//	source = 2
+	//}
 
 	if chartTotal > int(total) {
 		total = int64(chartTotal)
@@ -750,6 +749,9 @@ func (this *SearchController) ComprehensiveList() {
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
 		return
 	}
+	if currentIndex == 1 {
+		go services.AddSearchKeyWord(user, keyWord, 1)
+	}
 
 	resp.List = list
 	page := paging.GetPaging(currentIndex, pageSize, int(tmpTotalResult))

+ 1 - 1
services/es_comprehensive.go

@@ -574,7 +574,7 @@ func EsAddOrEditComprehensiveData(item *ElasticComprehensiveDetail) (err error)
 		var script string
 		script += fmt.Sprint("ctx._source['SubjectNames'] = '", item.SubjectNames, "';")
 		script += fmt.Sprint("ctx._source['PublishDate'] = '", item.PublishDate, "';")
-		script += fmt.Sprint("ctx._source['IsSummary'] = '", item.IsSummary, "';")
+		script += fmt.Sprint("ctx._source['IsSummary'] = ", item.IsSummary, ";")
 		script += fmt.Sprint("ctx._source['Abstract'] = '", item.Abstract, "';")
 		script += fmt.Sprint("ctx._source['Title'] = '", item.Title, "';")
 		script += fmt.Sprint("ctx._source['BodyText'] = '", item.BodyText, "';")