-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Changing AggregationRequest to Generate Based on Provided Argument Order #259
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #259 +/- ##
==========================================
- Coverage 94.27% 94.17% -0.11%
==========================================
Files 87 87
Lines 5367 5270 -97
Branches 503 489 -14
==========================================
- Hits 5060 4963 -97
Misses 181 181
Partials 126 126 ☔ View full report in Codecov by Sentry. |
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.
LGTM, just some cosmetic comments.
src/NRedisStack/Search/Schema.cs
Outdated
/// <param name="phonetic">Declaring a text attribute as PHONETIC will perform phonetic matching on it in searches by default.</param> | ||
/// <param name="noIndex">Attributes can have the NOINDEX option, which means they will not be indexed.</param> | ||
/// <param name="unf">Set this to true to prevent the indexer from sorting on the normalized form. | ||
/// <param name=SearchArgs.name>The field's name.</param> |
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.
These docstring changes should be reverted, I guess.
|
||
private void SortBy() | ||
public AggregationRequest SortBy(int max, params SortedField[] fields) // TODO: check if it should be params |
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.
Sounds like no harm to make it params. But then the same can be done for other methods?
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 wasn't sure because this signature allows to send only MAX without any field, although at least one field must be sent, thats why I added the if(fields.Length > 0)
,
but right now I looked again and this is the syntax of sortby:
[ SORTBY nargs [ property ASC | DESC [ property ASC | DESC ...]] [MAX num]
so sending only MAX without any field should be possible.
Before this PR, the FT.AGGREGATE arguments would always appear in this order, 0 or 1 times, regardless of the order in which the user defined them:
According to the aggregation Core concepts :
So, after this PR the user can write more than one of each argument and the order is the order the user call the arguments.
Closes #230