Skip to content

Commit

Permalink
Fields/highlighting would only apply to "size" number of docs
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavdangeti committed Feb 5, 2021
1 parent 3d7c73e commit 6007f2e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions search.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,7 @@ func MemoryNeededForSearchResult(req *SearchRequest) uint64 {
// overhead from fields, highlighting
var d document.Document
if len(req.Fields) > 0 || req.Highlight != nil {
for i := 0; i < numDocMatches; i++ {
estimate += d.Size()
}
estimate += req.Size * d.Size()
}

return uint64(estimate)
Expand Down

0 comments on commit 6007f2e

Please sign in to comment.