Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BagritsevichStepan
Copy link
Contributor

@BagritsevichStepan BagritsevichStepan commented Nov 29, 2024

fixes #3631

Second PR for complete support of the SORTBY option. Please review first #4231

…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) {
Copy link
Contributor

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.
Copy link
Contributor

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;
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FT.AGGREGATE does not fully support the SORTBY option
2 participants