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.