{"id":"4eb2a7fc3fe69889","repo":"go-redis/redis","slug":"invalid-result-item-format","errorCode":null,"errorMessage":"invalid result item format","messagePattern":"invalid result item format","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"search_commands.go","lineNumber":3098,"sourceCode":"\t\t\tcontinue\n\t\t}\n\n\t\t// Try parsing as map[interface{}]interface{} (alternative RESP3 format)\n\t\tif rawMap, ok := item.(map[interface{}]interface{}); ok {\n\t\t\titemMap := make(map[string]interface{})\n\t\t\tfor k, v := range rawMap {\n\t\t\t\tif keyStr, ok := k.(string); ok {\n\t\t\t\t\titemMap[keyStr] = v\n\t\t\t\t}\n\t\t\t}\n\t\t\tresults = append(results, itemMap)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Fall back to array format (RESP2 format - key-value pairs)\n\t\titemData, ok := item.([]interface{})\n\t\tif !ok {\n\t\t\treturn FTHybridResult{}, nil, fmt.Errorf(\"invalid result item format\")\n\t\t}\n\n\t\titemMap := make(map[string]interface{})\n\t\tfor i := 0; i < len(itemData); i += 2 {\n\t\t\tif i+1 < len(itemData) {\n\t\t\t\tkey, ok := itemData[i].(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn FTHybridResult{}, nil, fmt.Errorf(\"invalid item key format\")\n\t\t\t\t}\n\t\t\t\titemMap[key] = itemData[i+1]\n\t\t\t}\n\t\t}\n\t\tresults = append(results, itemMap)\n\t}\n\n\t// Optional warnings; accept both \"warning\" (as FT.SEARCH/FT.AGGREGATE) and \"warnings\".\n\tvar warnings []string\n\twarningsData, ok := resultMap[\"warning\"].([]interface{})","sourceCodeStart":3080,"sourceCodeEnd":3116,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/search_commands.go#L3080-L3116","documentation":"Returned in parseFTHybrid (search_commands.go:3094-3099): each entry in the results array must be either a map (RESP3 style) or an array of key/value pairs (RESP2 style). An item that is neither (scalar, nil) trips this error.","triggerScenarios":"FHybrid results array containing an item of an unexpected type — e.g. a bare string or integer where a per-result map/array was expected.","commonSituations":"Server returned a heterogeneous or partial result list, or a future reply variant go-redis does not handle.","solutions":["Inspect RawResult() and locate the offending result item.","Upgrade the server module and go-redis.","Reproduce via redis-cli.","File a go-redis issue with the raw reply if persistent."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"res, _, err := client.FTHybridWithArgs(ctx, idx, opts).Result()\nif err != nil && strings.Contains(err.Error(), \"invalid result item format\") {\n    raw, _ := cmd.RawVal()\n    log.Printf(\"fthybrid result item not map/array; raw=%#v\", raw)\n}","preventionTips":["Upgrade go-redis to handle current reply variants.","Capture RawVal() to find the offending item.","Reproduce via redis-cli."],"tags":["redisearch","ft-hybrid","response-parsing"],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}