by Robin at 20240822
This commit is contained in:
parent
18e50bbd86
commit
75413625fd
|
@ -204,37 +204,37 @@ func (es *ElasticSearch) FilterStreamerAcctList(ctx *gin.Context, req *streamera
|
|||
|
||||
if agefunc != nil {
|
||||
funcScoreQuery.Add(matchall, agefunc)
|
||||
fullscore += 1.0
|
||||
fullscore += req.RefStreamerFilter.Age.Weight
|
||||
}
|
||||
if fansfunc != nil {
|
||||
funcScoreQuery.Add(matchall, fansfunc)
|
||||
fullscore += 1.0
|
||||
fullscore += req.RefStreamerFilter.Fans.Weight
|
||||
}
|
||||
if heightfunc != nil {
|
||||
funcScoreQuery.Add(matchall, heightfunc)
|
||||
fullscore += 1.0
|
||||
fullscore += req.RefStreamerFilter.Height.Weight
|
||||
}
|
||||
if weightfunc != nil {
|
||||
funcScoreQuery.Add(matchall, weightfunc)
|
||||
fullscore += 1.0
|
||||
fullscore += req.RefStreamerFilter.Weight.Weight
|
||||
}
|
||||
if wechatcoinpricefunc != nil {
|
||||
funcScoreQuery.Add(matchall, wechatcoinpricefunc)
|
||||
fullscore += 1.0
|
||||
fullscore += req.RefStreamerFilter.WechatCoinPrice.Weight
|
||||
}
|
||||
if zoneadmissionpricefunc != nil {
|
||||
funcScoreQuery.Add(matchall, zoneadmissionpricefunc)
|
||||
fullscore += 1.0
|
||||
fullscore += req.RefStreamerFilter.ZoneAdmissionPrice.Weight
|
||||
}
|
||||
|
||||
// 写入关于城市、星座的脚本打分
|
||||
if req.City != nil && util.DerefString(req.City) != "" {
|
||||
funcScoreQuery.AddScoreFunc(util.CreateKeywordScriptScoreFunction("city", util.DerefString(req.City), req.RefStreamerFilter.CityWeight))
|
||||
fullscore += 1.0
|
||||
fullscore += req.RefStreamerFilter.CityWeight
|
||||
}
|
||||
if req.Constellation != nil && util.DerefString(req.Constellation) != "" {
|
||||
funcScoreQuery.AddScoreFunc(util.CreateKeywordScriptScoreFunction("constellation", util.DerefString(req.Constellation), req.RefStreamerFilter.ConstellationWeight))
|
||||
fullscore += 1.0
|
||||
fullscore += req.RefStreamerFilter.ConstellationWeight
|
||||
}
|
||||
|
||||
// 写入关于是否7日内有更新的脚本打分
|
||||
|
@ -245,7 +245,7 @@ func (es *ElasticSearch) FilterStreamerAcctList(ctx *gin.Context, req *streamera
|
|||
scriptStr := "doc['%s'].value >= %d ? %f : %f"
|
||||
script := elastic.NewScript(fmt.Sprintf(scriptStr, "last_zone_moment_create_day_start", daystartBeforeAWeek, 1.0, 0.0))
|
||||
funcScoreQuery.AddScoreFunc(elastic.NewScriptFunction(script).Weight(req.RefStreamerFilter.IsActiveWithinAWeekWeight))
|
||||
fullscore += 1.0
|
||||
fullscore += req.RefStreamerFilter.IsActiveWithinAWeekWeight
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue