about summary refs log tree commit diff stats
path: root/internal/index
diff options
context:
space:
mode:
Diffstat (limited to 'internal/index')
-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
 }