about summary refs log tree commit diff stats
path: root/internal/index/search.go
diff options
context:
space:
mode:
authorAlan Pearce2024-08-17 14:43:42 +0200
committerAlan Pearce2024-08-17 14:43:42 +0200
commitb427c2657582caa9b2cce8bcfd82624663dda780 (patch)
tree352f6739436df438a0313278af3382a4090c7ac4 /internal/index/search.go
parent7ce45a76aebde0249a78e044ae9d416f86473038 (diff)
downloadsearchix-b427c2657582caa9b2cce8bcfd82624663dda780.tar.lz
searchix-b427c2657582caa9b2cce8bcfd82624663dda780.tar.zst
searchix-b427c2657582caa9b2cce8bcfd82624663dda780.zip
fix: don't error when item not found
Diffstat (limited to 'internal/index/search.go')
-rw-r--r--internal/index/search.go4
1 files changed, 4 insertions, 0 deletions
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
 }