From 95cb962ce8b1cab750fb49a42940ac2abfa46864 Mon Sep 17 00:00:00 2001 From: Nikolay Karadzhov Date: Tue, 11 Nov 2025 11:33:30 +0200 Subject: [PATCH] chore: mark 8.4 features as experimental --- packages/client/lib/commands/DELEX.ts | 3 +++ packages/client/lib/commands/DIGEST.ts | 3 +++ packages/client/lib/commands/SET.ts | 7 +++-- packages/search/lib/commands/HYBRID.ts | 37 +++++++++++++------------- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/packages/client/lib/commands/DELEX.ts b/packages/client/lib/commands/DELEX.ts index e32c292f22..c42bb3e449 100644 --- a/packages/client/lib/commands/DELEX.ts +++ b/packages/client/lib/commands/DELEX.ts @@ -25,6 +25,9 @@ type DelexCondition = (typeof DelexCondition)[keyof typeof DelexCondition]; export default { IS_READ_ONLY: false, /** + * + * @experimental + * * Conditionally removes the specified key based on value or digest comparison. * * @param parser - The Redis command parser diff --git a/packages/client/lib/commands/DIGEST.ts b/packages/client/lib/commands/DIGEST.ts index 249bb78740..1e1e752e25 100644 --- a/packages/client/lib/commands/DIGEST.ts +++ b/packages/client/lib/commands/DIGEST.ts @@ -4,6 +4,9 @@ import { Command, RedisArgument, SimpleStringReply } from "../RESP/types"; export default { IS_READ_ONLY: true, /** + * + * @experimental + * * Returns the XXH3 hash of a string value. * * @param parser - The Redis command parser diff --git a/packages/client/lib/commands/SET.ts b/packages/client/lib/commands/SET.ts index 16a2a0216c..429a3f2bce 100644 --- a/packages/client/lib/commands/SET.ts +++ b/packages/client/lib/commands/SET.ts @@ -33,6 +33,9 @@ export interface SetOptions { * Condition for setting the key: * - `NX` - Set if key does not exist * - `XX` - Set if key already exists + * + * @experimental + * * - `IFEQ` - Set if current value equals match-value (since 8.4, requires `matchValue`) * - `IFNE` - Set if current value does not equal match-value (since 8.4, requires `matchValue`) * - `IFDEQ` - Set if current value digest equals match-digest (since 8.4, requires `matchValue`) @@ -53,14 +56,14 @@ export interface SetOptions { * @deprecated Use `{ condition: 'XX' }` instead. */ XX?: boolean; - + GET?: boolean; } export default { /** * Constructs the SET command - * + * * @param parser - The command parser * @param key - The key to set * @param value - The value to set diff --git a/packages/search/lib/commands/HYBRID.ts b/packages/search/lib/commands/HYBRID.ts index c8b8ad0e9f..3773659de5 100644 --- a/packages/search/lib/commands/HYBRID.ts +++ b/packages/search/lib/commands/HYBRID.ts @@ -116,11 +116,11 @@ function parseVectorExpression(parser: CommandParser, vsim: FtHybridVectorExpres if (vsim.method.KNN) { const knn = vsim.method.KNN; parser.push('KNN', '1', 'K', knn.K.toString()); - + if (knn.EF_RUNTIME !== undefined) { parser.push('EF_RUNTIME', knn.EF_RUNTIME.toString()); } - + if (knn.YIELD_DISTANCE_AS) { parser.push('YIELD_DISTANCE_AS', knn.YIELD_DISTANCE_AS); } @@ -129,11 +129,11 @@ function parseVectorExpression(parser: CommandParser, vsim: FtHybridVectorExpres if (vsim.method.RANGE) { const range = vsim.method.RANGE; parser.push('RANGE', '1', 'RADIUS', range.RADIUS.toString()); - + if (range.EPSILON !== undefined) { parser.push('EPSILON', range.EPSILON.toString()); } - + if (range.YIELD_DISTANCE_AS) { parser.push('YIELD_DISTANCE_AS', range.YIELD_DISTANCE_AS); } @@ -142,10 +142,10 @@ function parseVectorExpression(parser: CommandParser, vsim: FtHybridVectorExpres if (vsim.FILTER) { parser.push('FILTER', vsim.FILTER.expression); - + if (vsim.FILTER.POLICY) { parser.push('POLICY', vsim.FILTER.POLICY); - + if (vsim.FILTER.POLICY === 'BATCHES' && vsim.FILTER.BATCHES) { parser.push('BATCHES', 'BATCH_SIZE', vsim.FILTER.BATCHES.BATCH_SIZE.toString()); } @@ -165,11 +165,11 @@ function parseCombineMethod(parser: CommandParser, combine: FtHybridOptions['COM if (combine.method.RRF) { const rrf = combine.method.RRF; parser.push('RRF', rrf.count.toString()); - + if (rrf.WINDOW !== undefined) { parser.push('WINDOW', rrf.WINDOW.toString()); } - + if (rrf.CONSTANT !== undefined) { parser.push('CONSTANT', rrf.CONSTANT.toString()); } @@ -178,11 +178,11 @@ function parseCombineMethod(parser: CommandParser, combine: FtHybridOptions['COM if (combine.method.LINEAR) { const linear = combine.method.LINEAR; parser.push('LINEAR', linear.count.toString()); - + if (linear.ALPHA !== undefined) { parser.push('ALPHA', linear.ALPHA.toString()); } - + if (linear.BETA !== undefined) { parser.push('BETA', linear.BETA.toString()); } @@ -216,7 +216,7 @@ function parseHybridOptions(parser: CommandParser, options?: FtHybridOptions) { if (options.GROUPBY) { parseOptionalVariadicArgument(parser, 'GROUPBY', options.GROUPBY.fields); - + if (options.GROUPBY.REDUCE) { parser.push('REDUCE', options.GROUPBY.REDUCE.function, options.GROUPBY.REDUCE.count.toString()); parser.push(...options.GROUPBY.REDUCE.args); @@ -257,11 +257,11 @@ function parseHybridOptions(parser: CommandParser, options?: FtHybridOptions) { if (options.WITHCURSOR) { parser.push('WITHCURSOR'); - + if (options.WITHCURSOR.COUNT !== undefined) { parser.push('COUNT', options.WITHCURSOR.COUNT.toString()); } - + if (options.WITHCURSOR.MAXIDLE !== undefined) { parser.push('MAXIDLE', options.WITHCURSOR.MAXIDLE.toString()); } @@ -274,10 +274,11 @@ export default { /** * Performs a hybrid search combining multiple search expressions. * Supports multiple SEARCH and VECTOR expressions with various fusion methods. - * + * + * @experimental * NOTE: FT.Hybrid is still in experimental state - * It's behavioud and function signature may change` - * + * It's behaviour and function signature may change + * * @param parser - The command parser * @param index - The index name to search * @param options - Hybrid search options including: @@ -300,7 +301,7 @@ export default { // This is a cursor reply const [searchResults, cursor] = reply; const transformedResults = transformHybridSearchResults(searchResults); - + return { ...transformedResults, cursor @@ -345,7 +346,7 @@ function documentValue(tuples: any) { while (i < tuples.length) { const key = tuples[i++]; const value = tuples[i++]; - + if (key === '$') { // might be a JSON reply try { Object.assign(message, JSON.parse(value));