Skip to content

Commit

Permalink
Add Cardinality for Dictionary to reflect interface change
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavdangeti committed Feb 4, 2025
1 parent 17671b3 commit 81013ef
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 @@ -35,6 +35,13 @@ type Dictionary struct {
// represents an immutable, empty dictionary
var emptyDictionary = &Dictionary{}

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

// PostingsList returns the postings list for the specified term
func (d *Dictionary) PostingsList(term []byte, except *roaring.Bitmap,
prealloc segment.PostingsList) (segment.PostingsList, error) {
Expand Down

0 comments on commit 81013ef

Please sign in to comment.