remove temporary doc id sorting from bm25
now that the Map type in the lsmkv supports sorted keys and the doc ids
are encoded is big endian, any time we retrieve doc ids, we can be
certain that they are already sorted.
@@ -116,17 +116,6 @@ func (b *BM25Searcher) retrieveScoreAndSortForSingleTerm(ctx context.Context,
}
fmt.Printf("term %q: score ids took %s\n", term, time.Since(before))
- before = time.Now()
- // TODO: this runtime sorting is only because the storage is not implemented
- // in an always sorted manner. Once we have that implemented, we can skip
- // this expensive runtime-sort
- sort.Slice(ids.docIDs, func(a, b int) bool {
- return ids.docIDs[a].id < ids.docIDs[b].id
- })
-
- // TODO: structured logging
- fmt.Printf("term %q: sorting by doc ids took %s\n", term, time.Since(before))
-
return ids, nil
}
