From b427c2657582caa9b2cce8bcfd82624663dda780 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 17 Aug 2024 14:43:42 +0200 Subject: fix: don't error when item not found --- internal/index/search.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'internal/index') diff --git a/internal/index/search.go b/internal/index/search.go index e7cec4c..cdffc1e 100644 --- a/internal/index/search.go +++ b/internal/index/search.go @@ -189,5 +189,9 @@ func (index *ReadIndex) GetDocument( return nil, err } + if result.Total == 0 { + return nil, nil + } + return &result.Hits[0].Data, err } -- cgit 1.4.1