diff --git a/storage/search.go b/storage/search.go index c4398f7..3020130 100644 --- a/storage/search.go +++ b/storage/search.go @@ -124,7 +124,7 @@ func DeleteSearch(search string) error { if len(ids) > 0 { total := len(ids) - // split ids into chunks + // split ids into chunks of 1000 ids var chunks [][]string if total > 1000 { chunkSize := 1000 @@ -132,6 +132,10 @@ func DeleteSearch(search string) error { for chunkSize < len(ids) { ids, chunks = ids[chunkSize:], append(chunks, ids[0:chunkSize:chunkSize]) } + if len(ids) > 0 { + // add remaining ids <= 1000 + chunks = append(chunks, ids) + } } else { chunks = append(chunks, ids) }