Skip to content

fix(test): sort results in example test #3292

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

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions doctests/query_range_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ func ExampleClient_query_range() {
FieldName: "price",
},
},
SortBy: []redis.FTSearchSortBy{
{
FieldName: "price",
Asc: true,
},
},
},
).Result()

Expand Down Expand Up @@ -263,6 +269,12 @@ func ExampleClient_query_range() {
FieldName: "price",
},
},
SortBy: []redis.FTSearchSortBy{
{
FieldName: "price",
Asc: true,
},
},
},
).Result()

Expand All @@ -289,6 +301,12 @@ func ExampleClient_query_range() {
FieldName: "price",
},
},
SortBy: []redis.FTSearchSortBy{
{
FieldName: "price",
Asc: true,
},
},
Filters: []redis.FTSearchFilter{
{
FieldName: "price",
Expand Down Expand Up @@ -354,19 +372,19 @@ func ExampleClient_query_range() {

// Output:
// 3
// bicycle:2 : price 815
// bicycle:5 : price 810
// bicycle:2 : price 815
// bicycle:9 : price 815
// 3
// bicycle:2 : price 815
// bicycle:5 : price 810
// bicycle:2 : price 815
// bicycle:9 : price 815
// 5
// bicycle:1 : price 1200
// bicycle:4 : price 3200
// bicycle:8 : price 1200
// bicycle:6 : price 2300
// bicycle:4 : price 3200
// bicycle:3 : price 3400
// bicycle:8 : price 1200
// 7
// bicycle:0 : price 270
// bicycle:7 : price 430
Expand Down
Loading