Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
0717e3c7
Commit
0717e3c7
authored
Jun 15, 2017
by
rsubhank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NRediSearch-Sorting
parent
e0343c18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Query.cs
NRediSearch/Query.cs
+8
-8
No files found.
NRediSearch/Query.cs
View file @
0717e3c7
...
...
@@ -164,12 +164,12 @@ public Paging(int offset, int count)
/// <summary>
/// Set the query parameter to sort by
/// </summary>
public
string
_s
ortBy
{
get
;
set
;
}
public
string
S
ortBy
{
get
;
set
;
}
/// <summary>
/// Set the query parameter to sort by ASC by default
/// </summary>
public
bool
_sortAsc
=
true
;
public
bool
SortAscending
{
get
;
set
;}
=
true
;
/// <summary>
/// Create a new index
...
...
@@ -215,11 +215,11 @@ internal void SerializeRedisArgs(List<object> args)
args
.
AddRange
(
_fields
);
}
if
(
_s
ortBy
!=
null
)
if
(
S
ortBy
!=
null
)
{
args
.
Add
(
"SORTBY"
.
Literal
());
args
.
Add
(
_sortBy
.
Literal
()
);
args
.
Add
((
_sortAsc
?
"ASC"
:
"DESC"
).
Literal
());
args
.
Add
(
SortBy
);
args
.
Add
((
SortAscending
?
"ASC"
:
"DESC"
).
Literal
());
}
if
(
Payload
!=
null
)
...
...
@@ -284,10 +284,10 @@ public Query LimitFields(params string[] fields)
/// <param name="field">the sorting field's name</param>
/// <param name="ascending">if set to true, the sorting order is ascending, else descending</param>
/// <returns>the query object itself</returns>
public
Query
SetSortBy
(
string
field
,
bool
ascending
)
public
Query
SetSortBy
(
string
field
,
bool
ascending
=
true
)
{
_s
ortBy
=
field
;
_sortAsc
=
ascending
;
S
ortBy
=
field
;
SortAscending
=
ascending
;
return
this
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment