From fba6a3e155aab7c31b5c8710927302ce95ee2dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Gill=C3=A9?= Date: Mon, 4 Mar 2024 20:54:14 +0100 Subject: [PATCH] Fix length of result slice --- query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query.go b/query.go index dd73cf8..3e34573 100644 --- a/query.go +++ b/query.go @@ -99,7 +99,7 @@ func documentMatchesFilters(document *Document, where, whereDocument map[string] } func calcDocSimilarity(ctx context.Context, queryVectors []float32, docs []*Document) ([]Result, error) { - res := make([]Result, len(docs)) + res := make([]Result, 0, len(docs)) resLock := sync.Mutex{} // Determine concurrency. Use number of docs or CPUs, whichever is smaller.