{"id":"0834818b9a8baece","repo":"go-redis/redis","slug":"invalid-suggestion-format","errorCode":null,"errorMessage":"invalid suggestion format","messagePattern":"invalid suggestion format","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"search_commands.go","lineNumber":2555,"sourceCode":"\t\tif !ok || len(termInfo) != 3 {\n\t\t\treturn nil, fmt.Errorf(\"invalid term format\")\n\t\t}\n\n\t\tterm, ok := termInfo[1].(string)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"invalid term format\")\n\t\t}\n\n\t\tsuggestionsData, ok := termInfo[2].([]interface{})\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"invalid suggestions format\")\n\t\t}\n\n\t\tsuggestions := make([]SpellCheckSuggestion, 0, len(suggestionsData))\n\t\tfor _, suggestionData := range suggestionsData {\n\t\t\tsuggestionInfo, ok := suggestionData.([]interface{})\n\t\t\tif !ok || len(suggestionInfo) != 2 {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid suggestion format\")\n\t\t\t}\n\n\t\t\tscoreStr, ok := suggestionInfo[0].(string)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid suggestion score format\")\n\t\t\t}\n\t\t\tscore, err := strconv.ParseFloat(scoreStr, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid suggestion score value\")\n\t\t\t}\n\n\t\t\tsuggestion, ok := suggestionInfo[1].(string)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid suggestion format\")\n\t\t\t}\n\n\t\t\tsuggestions = append(suggestions, SpellCheckSuggestion{\n\t\t\t\tScore:      score,","sourceCodeStart":2537,"sourceCodeEnd":2573,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/search_commands.go#L2537-L2573","documentation":"Returned by parseFTSpellCheck (RESP2 path) when a suggestion element is not a 2-element array. Each suggestion is [score, suggestion]; any other arity or type is rejected at search_commands.go:2553.","triggerScenarios":"A RESP2 FT.SPELLCHECK reply whose inner suggestion tuples are not [score, suggestion] pairs of length 2.","commonSituations":"Server/module version that emits a different suggestion tuple shape, or a non-RediSearch backend.","solutions":["Upgrade Redis Stack/RediSearch to a version with the standard [score, suggestion] format.","Inspect the raw reply with cmd.RawResult() to confirm the offending tuple.","Ensure you are connected to a real RediSearch-enabled Redis."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"func isSuggestionTuple(v interface{}) bool {\n    t, ok := v.([]interface{})\n    return ok && len(t) == 2\n}","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"invalid suggestion format\") {\n    // RawResult to find which tuple is malformed\n}","preventionTips":["Upgrade RediSearch to emit the standard [score, suggestion] tuple.","Verify the endpoint is RediSearch, not a generic Redis.","Log raw replies on parse failure."],"tags":["redisearch","ft-spellcheck","resp2","parsing"],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}