From 8313b16dfe703e21e13550c69df56ef1c50eaccb Mon Sep 17 00:00:00 2001 From: douxu Date: Tue, 23 Dec 2025 15:09:33 +0800 Subject: [PATCH] fix bug of measurement recommend of token6 complete op and token7 hierarchy recommend --- model/redis_recommend.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/model/redis_recommend.go b/model/redis_recommend.go index 74dfbd5..db059c1 100644 --- a/model/redis_recommend.go +++ b/model/redis_recommend.go @@ -387,6 +387,10 @@ func handleLevelFuzzySearch(ctx context.Context, rdb *redis.Client, hierarchy co if searchInput == "" { var specificalKey string specificalKeyIndex := searchInputIndex - 1 + if hierarchy == constants.MeasTagRecommendHierarchyType { + specificalKeyIndex = searchInputIndex - 2 + } + if specificalKeyIndex >= 0 { specificalKey = inputSlice[specificalKeyIndex] } @@ -489,7 +493,6 @@ func runFuzzySearch(ctx context.Context, searchInput string, searchPrefix string } for searchInputLen != 0 { fuzzyInput := strings.Join([]string{comparePrefix, searchInput}, ".") - results, err := ac.SuggestOpts(searchInput, redisearch.SuggestOptions{ results, err := ac.SuggestOpts(fuzzyInput, redisearch.SuggestOptions{ Num: math.MaxInt16, Fuzzy: true,