{"record":{"id":"1ce69b9ba9e18e00","repo":"redis/jedis","slug":"binary-ft-search-is-not-implemented-with-resp3","errorCode":null,"errorMessage":"binary ft.search is not implemented with resp3.","messagePattern":"binary ft\\.search is not implemented with resp3\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"src/main/java/redis/clients/jedis/CommandObjects.java","lineNumber":4184,"sourceCode":"  }\n\n  public final CommandObject<SearchResult> ftSearch(String indexName, String query, FTSearchParams params) {\n    return new CommandObject<>(checkAndRoundRobinSearchCommand(SearchCommand.SEARCH, indexName)\n        .add(query).addParams(params.dialectOptional(searchDialect.get())),\n        getSearchResultBuilder(params.getReturnFieldDecodeMap(), () -> new SearchResultBuilder(\n            !params.getNoContent(), params.getWithScores(), true, params.getReturnFieldDecodeMap())));\n  }\n\n  public final CommandObject<SearchResult> ftSearch(String indexName, Query query) {\n    return new CommandObject<>(checkAndRoundRobinSearchCommand(SearchCommand.SEARCH, indexName)\n        .addParams(query.dialectOptional(searchDialect.get())), getSearchResultBuilder(null,\n        () -> new SearchResultBuilder(!query.getNoContent(), query.getWithScores(), true)));\n  }\n\n  @Deprecated\n  public final CommandObject<SearchResult> ftSearch(byte[] indexName, Query query) {\n    if (protocol == RedisProtocol.RESP3) {\n      throw new UnsupportedOperationException(\"binary ft.search is not implemented with resp3.\");\n    }\n    return new CommandObject<>(checkAndRoundRobinSearchCommand(SearchCommand.SEARCH, indexName)\n        .addParams(query.dialectOptional(searchDialect.get())), getSearchResultBuilder(null,\n        () -> new SearchResultBuilder(!query.getNoContent(), query.getWithScores(), false)));\n  }\n\n  public final CommandObject<String> ftExplain(String indexName, Query query) {\n    return new CommandObject<>(checkAndRoundRobinSearchCommand(SearchCommand.EXPLAIN, indexName)\n        .addParams(query.dialectOptional(searchDialect.get())), BuilderFactory.STRING);\n  }\n\n  public final CommandObject<List<String>> ftExplainCLI(String indexName, Query query) {\n    return new CommandObject<>(checkAndRoundRobinSearchCommand(SearchCommand.EXPLAINCLI, indexName)\n        .addParams(query.dialectOptional(searchDialect.get())), BuilderFactory.STRING_LIST);\n  }\n\n  public final CommandObject<AggregationResult> ftAggregate(String indexName, AggregationBuilder aggr) {\n    return new CommandObject<>(checkAndRoundRobinSearchCommand(SearchCommand.AGGREGATE, indexName)","sourceCodeStart":4166,"sourceCodeEnd":4202,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/CommandObjects.java#L4166-L4202","documentation":"The deprecated byte[]-based ftSearch(byte[], Query) in CommandObjects refuses to run under the RESP3 protocol because the binary search command path has not been implemented for RESP3. It throws UnsupportedOperationException before building the CommandObject.","triggerScenarios":"Calling ftSearch(byte[] indexName, Query query) while the client was negotiated/configured to use RedisProtocol.RESP3 (e.g. connected to Redis 6+ with default protocol RESP3).","commonSituations":"Migrating from legacy Jedis search usage to Redis 7+/RESP3 connections; using the deprecated binary overload because code passes byte[] index names; upgrading the server or setting protocol to RESP3 without noticing this overload is unimplemented.","solutions":["Use the String-based ftSearch(String indexName, Query query) overload which supports RESP3","Connect with RedisProtocol.RESP2 if the binary byte[] overload must be kept","Encode index name once with SafeEncoder and switch code to the String API"],"exampleFix":"// before\nSearchResult r = client.ftSearch(\"idx\".getBytes(), query); // RESP3 -> throw\n// after\nSearchResult r = client.ftSearch(\"idx\", query); // RESP3-safe","handlingStrategy":"fallback","validationCode":"if (indexName instanceof byte[] && clientProtocol == RedisProtocol.RESP3) { /* switch to String overload or RESP2 */ }","typeGuard":"static boolean binarySearchUnsupported(RedisProtocol p) { return p == RedisProtocol.RESP3; }","tryCatchPattern":"try { return client.ftSearch(indexBytes, query); } catch (UnsupportedOperationException e) { return client.ftSearch(new String(indexBytes, StandardCharsets.UTF_8), query); }","preventionTips":["Prefer the String-based ftSearch overloads","Do not use the deprecated byte[] ftSearch in new code","Pin RESP2 if legacy binary search paths are required"],"tags":["jedis","redis-search","resp3","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"6dac31d4c224fb3257c216f3985340c6f500cdcb","analyzedAt":"2026-09-08T04:55:01.204Z","contentChangedAt":"2026-09-08T04:55:01.204Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}