by Robin at 20240821

This commit is contained in:
Leufolium 2024-08-21 22:19:56 +08:00
parent 7a3754550f
commit 18e50bbd86
1 changed files with 2 additions and 2 deletions

View File

@ -228,11 +228,11 @@ func (es *ElasticSearch) FilterStreamerAcctList(ctx *gin.Context, req *streamera
}
// 写入关于城市、星座的脚本打分
if req.City != nil {
if req.City != nil && util.DerefString(req.City) != "" {
funcScoreQuery.AddScoreFunc(util.CreateKeywordScriptScoreFunction("city", util.DerefString(req.City), req.RefStreamerFilter.CityWeight))
fullscore += 1.0
}
if req.Constellation != nil {
if req.Constellation != nil && util.DerefString(req.Constellation) != "" {
funcScoreQuery.AddScoreFunc(util.CreateKeywordScriptScoreFunction("constellation", util.DerefString(req.Constellation), req.RefStreamerFilter.ConstellationWeight))
fullscore += 1.0
}