Skip to content

Commit

Permalink
[BP: v11.x] MB-58901: BM25 scoring helper API (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thejas-bhat authored Jan 8, 2025
1 parent 71356f3 commit 966e831
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dict.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ func (d *Dictionary) PostingsList(term []byte, except *roaring.Bitmap,
return d.postingsList(term, except, preallocPL)
}

func (d *Dictionary) Cardinality() int {
if d.fst != nil {
return d.fst.Len()
}
return 0
}

func (d *Dictionary) postingsList(term []byte, except *roaring.Bitmap, rv *PostingsList) (*PostingsList, error) {
if d.fstReader == nil {
if rv == nil || rv == emptyPostingsList {
Expand Down

0 comments on commit 966e831

Please sign in to comment.