diff options
author | Alan Pearce | 2024-07-13 17:03:08 +0200 |
---|---|---|
committer | Alan Pearce | 2024-07-13 17:03:08 +0200 |
commit | b1fd7104004b9646f541afbc0add3047dbff59a7 (patch) | |
tree | 2604f03f314d659144b510764f276f251bbd9dd0 | |
parent | ee83dfd741c47bd25eac1ac7139f20875de0452c (diff) | |
download | searchix-b1fd7104004b9646f541afbc0add3047dbff59a7.tar.lz searchix-b1fd7104004b9646f541afbc0add3047dbff59a7.tar.zst searchix-b1fd7104004b9646f541afbc0add3047dbff59a7.zip |
fix: nil panics rendering last page of search results
-rw-r--r-- | internal/index/search.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/index/search.go b/internal/index/search.go index c5b8c6b..e7cec4c 100644 --- a/internal/index/search.go +++ b/internal/index/search.go @@ -109,7 +109,7 @@ func (index *ReadIndex) search( return nil, errors.WithMessage(err, "failed to execute search query") } - results := make([]DocumentMatch, min(ResultsPerPage, bleveResult.Total)) + results := make([]DocumentMatch, bleveResult.Hits.Len()) var buf bytes.Buffer for i, result := range bleveResult.Hits { results[i].DocumentMatch = bleveResult.Hits[i] |