by Robin at 20240829 cut zero width unicode
This commit is contained in:
parent
2a12aee170
commit
22aebfe573
|
@ -1785,6 +1785,9 @@ func (s *Service) ApiFilterStreamer(ctx *gin.Context, req *streamerproto.ApiFilt
|
|||
return
|
||||
}
|
||||
|
||||
constellation := util.TrimZeroWidthUnicode(util.DerefString(req.Constellation))
|
||||
req.Constellation = goproto.String(constellation)
|
||||
|
||||
//1.从主播用户表中模糊匹配所有主播信息的用户侧数据,按mid正序排序
|
||||
streameraccts, scores, fullscore, err := _DefaultStreamerAcct.OpFilterStreamerAcct(ctx, &streameracctproto.OpFilterReq{
|
||||
Age: req.Age,
|
||||
|
|
|
@ -419,3 +419,10 @@ func CreateKeywordScriptScoreFunction(name string, value string, weight float64)
|
|||
script := elastic.NewScript(fmt.Sprintf(scriptStr, name, value, 1.0, 0.0))
|
||||
return elastic.NewScriptFunction(script).Weight(weight)
|
||||
}
|
||||
|
||||
func TrimZeroWidthUnicode(str string) string {
|
||||
str = strings.Trim(str, "\xe2\x80\x8b")
|
||||
str = strings.Trim(str, "\xe2\x80\x8c")
|
||||
str = strings.Trim(str, "\xe2\x80\x8d")
|
||||
return str
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue