Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MB-58901: BM25 related constructs and API changes #59

Merged
merged 5 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ type FieldDict interface {
Next() (*DictEntry, error)
Close() error

Cardinality() int
BytesRead() uint64
}

Expand Down
15 changes: 15 additions & 0 deletions indexing_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ const (
SkipFreqNorm
)

const (
BM25Scoring = "bm25"
TFIDFScoring = "tfidf"
)

// Scoring model indicates the algorithm used to rank documents fetched
// for a query performed on a text field.
const DefaultScoringModel = TFIDFScoring

// Supported similarity models
var SupportedScoringModels = map[string]struct{}{
BM25Scoring: {},
TFIDFScoring: {},
}

func (o FieldIndexingOptions) IsIndexed() bool {
return o&IndexField != 0
}
Expand Down
4 changes: 2 additions & 2 deletions vector.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ const (
CosineSimilarity = "cosine"
)

const DefaultSimilarityMetric = EuclideanDistance
const DefaultVectorSimilarityMetric = EuclideanDistance

// Supported similarity metrics for vector fields
var SupportedSimilarityMetrics = map[string]struct{}{
var SupportedVectorSimilarityMetrics = map[string]struct{}{
EuclideanDistance: {},
InnerProduct: {},
CosineSimilarity: {},
Expand Down
Loading