0
0

Merge pull request #555 from mschoch/change-collector-heap

switch collector store impl from slice to heap
This commit is contained in:
Marty Schoch 2017-03-24 11:03:22 -07:00 committed by GitHub
commit 4702785f1f

View File

@ -41,7 +41,7 @@ type TopNCollector struct {
results search.DocumentMatchCollection results search.DocumentMatchCollection
facetsBuilder *search.FacetsBuilder facetsBuilder *search.FacetsBuilder
store *collectStoreSlice store *collectStoreHeap
needDocIds bool needDocIds bool
neededFields []string neededFields []string
@ -68,7 +68,7 @@ func NewTopNCollector(size int, skip int, sort search.SortOrder) *TopNCollector
backingSize = PreAllocSizeSkipCap + 1 backingSize = PreAllocSizeSkipCap + 1
} }
hc.store = newStoreSlice(backingSize, func(i, j *search.DocumentMatch) int { hc.store = newStoreHeap(backingSize, func(i, j *search.DocumentMatch) int {
return hc.sort.Compare(hc.cachedScoring, hc.cachedDesc, i, j) return hc.sort.Compare(hc.cachedScoring, hc.cachedDesc, i, j)
}) })