Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
CascadingRadium committed Dec 13, 2024
1 parent 3609ffc commit bde3bf8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion section_faiss_vector_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const defaultFaissOMPThreads = 1
func init() {
rand.Seed(time.Now().UTC().UnixNano())
registerSegmentSection(SectionFaissVectorIndex, &faissVectorIndexSection{})
invertedIndexExclusionChecks = append(invertedIndexExclusionChecks, func(field index.Field) bool {
invertedTextIndexSectionExclusionChecks = append(invertedTextIndexSectionExclusionChecks, func(field index.Field) bool {
_, ok := field.(index.VectorField)
return ok
})
Expand Down
18 changes: 9 additions & 9 deletions section_inverted_text_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ func init() {
type invertedTextIndexSection struct {
}

// This function checks whether the inverted index section should process
// a particular field, avoiding unnecessary work if another section will handle it.
var isFieldExcludedFromInvertedIndex = func(field index.Field) bool {
for _, excludeField := range invertedIndexExclusionChecks {
// This function checks whether the inverted text index section should avoid processing
// a particular field, preventing unnecessary work if another section will handle it.
var isFieldExcludedFromInvertedTextIndexSection = func(field index.Field) bool {
for _, excludeField := range invertedTextIndexSectionExclusionChecks {
if excludeField(field) {
// atleast one section has agreed to exclude this field
// from inverted index processing and has agreed to process it
// independently
// from inverted text index section processing and has
// agreed to process it independently
return true
}
}
Expand All @@ -50,11 +50,11 @@ var isFieldExcludedFromInvertedIndex = func(field index.Field) bool {
return false
}

// List of checks to determine if a field is excluded from the inverted index section
var invertedIndexExclusionChecks = make([]func(field index.Field) bool, 0)
// List of checks to determine if a field is excluded from the inverted text index section
var invertedTextIndexSectionExclusionChecks = make([]func(field index.Field) bool, 0)

func (i *invertedTextIndexSection) Process(opaque map[int]resetable, docNum uint32, field index.Field, fieldID uint16) {
if !isFieldExcludedFromInvertedIndex(field) {
if !isFieldExcludedFromInvertedTextIndexSection(field) {
invIndexOpaque := i.getInvertedIndexOpaque(opaque)
invIndexOpaque.process(field, fieldID, docNum)
}
Expand Down
2 changes: 1 addition & 1 deletion section_synonym.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

func init() {
registerSegmentSection(SectionSynonymIndex, &synonymIndexSection{})
invertedIndexExclusionChecks = append(invertedIndexExclusionChecks, func(field index.Field) bool {
invertedTextIndexSectionExclusionChecks = append(invertedTextIndexSectionExclusionChecks, func(field index.Field) bool {
_, ok := field.(index.SynonymField)
return ok
})
Expand Down

0 comments on commit bde3bf8

Please sign in to comment.