|
@@ -143,7 +143,7 @@ func SearchReportV2(keyWord string, classifyIdFirsts []int, classifyIdSeconds []
|
|
|
query := elastic.NewBoolQuery()
|
|
|
query = query.Must(elastic.NewMatchPhraseQuery("Title", keyWord)).Boost(5)
|
|
|
query = query.Should(elastic.NewMatchPhraseQuery("State", 1))
|
|
|
- query = query.Should(elastic.NewMatchQuery("PublishState", 2))
|
|
|
+ query = query.Should(elastic.NewMatchPhraseQuery("PublishState", 2))
|
|
|
sort := elastic.NewFieldSort("PublishTime.keyword").Desc()
|
|
|
searchResp, err = utils.EsClient.Search().
|
|
|
Index(indices...).
|
|
@@ -163,6 +163,7 @@ func SearchReportV2(keyWord string, classifyIdFirsts []int, classifyIdSeconds []
|
|
|
fmt.Println(err.Error())
|
|
|
return
|
|
|
}
|
|
|
+ total = searchResp.TotalHits()
|
|
|
|
|
|
if searchResp.Status != 0 {
|
|
|
err = errors.New("查询失败")
|