Skip to content
New issue

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

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

Already on GitHub? Sign in 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 all 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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.19.x, 1.20.x, 1.21.x]
go-version: [1.20.x, 1.21.x, 1.22.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/blevesearch/bleve_index_api

go 1.20
go 1.21
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