diff --git a/CHANGELOG.md b/CHANGELOG.md index 76ed811d..9c47e0f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 9.1.2 + +* Fix `FT.AGGREGATE` command with `SORTBY` operation + ## 9.1.1 * Fix tracing span names and missing fields diff --git a/Cargo.toml b/Cargo.toml index ccaf0541..a1582cf0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ name = "fred" readme = "README.md" repository = "https://github.com/aembke/fred.rs" rust-version = "1.75" -version = "9.1.1" +version = "9.1.2" [package.metadata.docs.rs] all-features = true diff --git a/src/commands/impls/redisearch.rs b/src/commands/impls/redisearch.rs index 176f7d72..680a25f4 100644 --- a/src/commands/impls/redisearch.rs +++ b/src/commands/impls/redisearch.rs @@ -111,7 +111,7 @@ fn gen_aggregate_op(args: &mut Vec, operation: AggregateOperation) - args.extend([static_val!(APPLY), expression.into(), static_val!(AS), name.into()]); }, AggregateOperation::SortBy { properties, max } => { - args.extend([static_val!(SORTBY), properties.len().try_into()?]); + args.extend([static_val!(SORTBY), (properties.len() * 2).try_into()?]); for (property, order) in properties.into_iter() { args.extend([property.into(), order.to_str().into()]); } diff --git a/src/utils.rs b/src/utils.rs index 2b31c484..35f4995d 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -381,11 +381,10 @@ pub async fn interrupt_blocked_connection( id }; - let mut args = Vec::with_capacity(2); - args.push(connection_id.into()); - args.push(flag.to_str().into()); - let command = RedisCommand::new(RedisCommandKind::ClientUnblock, args); - + let command = RedisCommand::new(RedisCommandKind::ClientUnblock, vec![ + connection_id.into(), + flag.to_str().into(), + ]); let frame = backchannel_request_response(inner, command, true).await?; protocol_utils::frame_to_results(frame).map(|_| ()) }