-
Notifications
You must be signed in to change notification settings - Fork 990
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): Fix LOAD fields parsing in the FT.AGGREGATE and FT.SEARCH commands #4012
fix(search_family): Fix LOAD fields parsing in the FT.AGGREGATE and FT.SEARCH commands #4012
Conversation
73c5897
to
2170419
Compare
2170419
to
1ea8bf4
Compare
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.
It feels a bit to complicated for the task. Feel free to change Schema struct to be easier to use, feel free to simplify the flow. I'd also suggest to simplify the SearchField struct
I'll be offline the next 3 days, if you're in a hurry you can ping anyone else 🙂 (for example Kostas is always happy to review 😆) |
Thanks for review, but I don't understand what you mean by "Feel free to change Schema struct to be easier to use"? I see that I can make |
@BagritsevichStepan I will continue the review and I agree with the sentiment of Vlad. |
1ea8bf4
to
95d86c2
Compare
Do not review, I'm refactoring another part of code |
|
||
StringOrView name = StringOrView::FromString(std::string{str}); | ||
if (parser->Check("AS")) { | ||
load_fields->value().emplace_back(name, true, |
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 see you add aliases as strings. Where do you benefit from string_view, in other words, why using StringOrView
types?
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.
We are storing field names as strings in the indexes (see Schema class here). At some stage we are joining load_fields and already indexed fields (from Schema) to one container. So the problem is that we can move strings from load_fields, but not strings from Schema. That's why we should use string_views
a62cf79
to
8375d3f
Compare
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.
Noticeably shorter than the previous version
f384ec6
to
3b845f1
Compare
…T.SEARCH commands fixes dragonflydb#3989 Signed-off-by: Stsiapan Bahrytsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
3b845f1
to
75b4df8
Compare
fixes #3989