From b1fd7104004b9646f541afbc0add3047dbff59a7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 13 Jul 2024 17:03:08 +0200 Subject: fix: nil panics rendering last page of search results --- internal/index/search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal') 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] -- cgit 1.4.1