From 78f68b9c4fb0fcdd44c0f318bfa7474f5b076bec Mon Sep 17 00:00:00 2001 From: douxu Date: Fri, 10 Jul 2026 17:31:56 +0800 Subject: [PATCH] fix: fallback to current recommend group after hash filtering - Return current config group recommendations when matched config candidates fail hash validation - Return current measurement group recommendations when matched tag candidates fail hash validation --- model/redis_recommend.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/redis_recommend.go b/model/redis_recommend.go index d91b870..0fbc100 100644 --- a/model/redis_recommend.go +++ b/model/redis_recommend.go @@ -546,7 +546,7 @@ func fallbackConfigByInput(ctx context.Context, rdb *redis.Client, allSetKey str recommends := combineQueryResultByInput(constants.ConfigRecommendHierarchyType, recommendLenType, inputSlice, matchedMembers) recommends = confirmConfigRecommendResultsByHash(ctx, rdb, inputSlice, matchedMembers, recommends) if len(recommends) == 0 { - return []string{}, 0, nil + return fallbackConfigGroupByInput(ctx, rdb, recommendLenType, inputSlice, members) } return recommends, fuzzyRecommendOffset(strings.Join(prefixTokens, "."), matchedInput), nil } @@ -576,7 +576,7 @@ func fallbackMeasByInput(ctx context.Context, rdb *redis.Client, allSetKey strin recommends := combineQueryResultByInput(constants.MeasTagRecommendHierarchyType, recommendLenType, inputSlice, matchedMembers) recommends = confirmMeasRecommendResultsByHash(ctx, rdb, inputSlice, matchedMembers, recommends) if len(recommends) == 0 { - return []string{}, 0, nil + return fallbackMeasGroupByInput(ctx, rdb, recommendLenType, inputSlice) } return recommends, fuzzyRecommendOffset(strings.Join(inputSlice[:len(inputSlice)-1], "."), matchedInput), nil