Skip to content

Commit

Permalink
GOCB-235: Change Search query sorting order from descending to desc
Browse files Browse the repository at this point in the history
Motivation
----------
A bug was reported by the community that field sort order
"descending" was wrong when sent to the server, and indeed
it needs to be "desc" on the wire.

Changes
-------
Updated the name used within search options to be desc rather
than descending.

Change-Id: I6062a99fa63c9f3af2ff18bbd4ee531d16e7d64e
Reviewed-on: http://review.couchbase.org/96506
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Charles Dixon <chvckd@gmail.com>
  • Loading branch information
chvck committed Jul 5, 2018
1 parent f664797 commit 03652b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cbft/sorting.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewSearchSortScore() *SearchSortScore {

// Descending specifies the ordering of the results.
func (q *SearchSortScore) Descending(descending bool) *SearchSortScore {
q.options["descending"] = descending
q.options["desc"] = descending
return q
}

Expand All @@ -55,7 +55,7 @@ func NewSearchSortId() *SearchSortId {

// Descending specifies the ordering of the results.
func (q *SearchSortId) Descending(descending bool) *SearchSortId {
q.options["descending"] = descending
q.options["desc"] = descending
return q
}

Expand Down Expand Up @@ -92,7 +92,7 @@ func (q *SearchSortField) Missing(missing string) *SearchSortField {

// Descending specifies the ordering of the results.
func (q *SearchSortField) Descending(descending bool) *SearchSortField {
q.options["descending"] = descending
q.options["desc"] = descending
return q
}

Expand All @@ -118,6 +118,6 @@ func (q *SearchSortGeoDistance) Unit(unit string) *SearchSortGeoDistance {

// Descending specifies the ordering of the results.
func (q *SearchSortGeoDistance) Descending(descending bool) *SearchSortGeoDistance {
q.options["descending"] = descending
q.options["desc"] = descending
return q
}

0 comments on commit 03652b9

Please sign in to comment.