{"id":"78337be9e2c06b09","repo":"go-redis/redis","slug":"invalid-suggestion-score-value","errorCode":null,"errorMessage":"invalid suggestion score value","messagePattern":"invalid suggestion score value","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"search_commands.go","lineNumber":2564,"sourceCode":"\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,\n\t\t\t\tSuggestion: suggestion,\n\t\t\t})\n\t\t}\n\n\t\tresults = append(results, SpellCheckResult{\n\t\t\tTerm:        term,\n\t\t\tSuggestions: suggestions,\n\t\t})\n\t}","sourceCodeStart":2546,"sourceCodeEnd":2582,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/search_commands.go#L2546-L2582","documentation":"Returned by parseFTSpellCheck (RESP2 path) when the suggestion score string cannot be parsed by strconv.ParseFloat. The score slot is a string but not a valid floating-point number (e.g. empty, \"inf\", \"nan\"-like, or garbage). Guard at search_commands.go:2562-2564.","triggerScenarios":"A RESP2 FT.SPELLCHECK reply whose score bulk string is non-numeric. The assertion to string passes but ParseFloat fails.","commonSituations":"Corrupted or truncated reply over the wire, a server bug emitting a placeholder string, or a proxy injecting bad data.","solutions":["Capture the raw score string via cmd.RawResult() to see exactly what was returned.","Upgrade RediSearch; treat a non-numeric score as a server/module defect.","Check for network-level corruption (TLS issues, buffering proxy)."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"invalid suggestion score value\") {\n    // RawResult to capture the offending score string; treat as server defect\n}","preventionTips":["Treat a non-numeric score as a server/module bug; upgrade RediSearch.","Check for network/TLS/proxy corruption of replies.","Use RawResult() to recover the exact bad value."],"tags":["redisearch","ft-spellcheck","resp2","parsing","score"],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}