-
Notifications
You must be signed in to change notification settings - Fork 968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(search_family): Support multiple fields in SORTBY option in the FT.AGGREGATE command. SECOND PR #4232
base: main
Are you sure you want to change the base?
Conversation
…GATE command fixes dragonflydb#4230 Signed-off-by: Stepan Bagritsevich <[email protected]>
…T.AGGREGATE command fixes dragonfly#3631 Signed-off-by: Stepan Bagritsevich <[email protected]>
@@ -11,10 +11,10 @@ namespace dfly::aggregate { | |||
namespace { | |||
|
|||
struct GroupStep { | |||
PipelineResult operator()(std::vector<DocValues> values) { | |||
PipelineResult operator()(PipelineResult result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PipelineResult contains more than result.values but you use only this field, maybe you don't need to change the type of parameter
absl::flat_hash_set<std::string> fields_to_print; | ||
}; | ||
|
||
using PipelineStep = std::function<PipelineResult(PipelineResult)>; // Group, Sort, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider modifying current values instead of doing move
/* Fields to sort by. If multiple fields are provided, sorting works hierarchically: | ||
- First, the i-th field is compared. | ||
- If the i-th field values are equal, the (i + 1)-th field is compared, and so on. */ | ||
absl::InlinedVector<std::pair<std::string, SortOrder>, 1> fields; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest using a bigger default capacity
fixes #3631
Second PR for complete support of the SORTBY option. Please review first #4231