From 176a6e7a0d270f08fcc97ba702dbf882b812a570 Mon Sep 17 00:00:00 2001 From: Danny Tylman Date: Wed, 10 Aug 2016 11:35:47 +0300 Subject: [PATCH] Adding sort to SearchRequest. --- search/collectors/collector_heap.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/search/collectors/collector_heap.go b/search/collectors/collector_heap.go index 7a6e542a..4a02e4d0 100644 --- a/search/collectors/collector_heap.go +++ b/search/collectors/collector_heap.go @@ -235,8 +235,8 @@ func (hc *HeapCollector) Less(i, j int) bool { scori := hc.results[i].match.Score scorj := hc.results[j].match.Score // make sure the list is ordered if everything else is the same... - if scori==scorj{ - return hc.results[i].match.ID < hc.results[j].match.ID + if scori == scorj { + return hc.results[i].match.ID > hc.results[j].match.ID } return scori < scorj }