Skip to content
Open
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
25 changes: 25 additions & 0 deletions indexing_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const (
IncludeTermVectors
DocValues
SkipFreqNorm
SkipDVCompression
SkipDVChunking
)

const (
Expand All @@ -33,6 +35,9 @@ const (
// for a query performed on a text field.
const DefaultScoringModel = TFIDFScoring

// Sentinel value used to separate terms in doc values encoding
const DocValueTermSeparator byte = 0xff

// Supported similarity models
var SupportedScoringModels = map[string]struct{}{
BM25Scoring: {},
Expand All @@ -59,6 +64,14 @@ func (o FieldIndexingOptions) SkipFreqNorm() bool {
return o&SkipFreqNorm != 0
}

func (o FieldIndexingOptions) SkipDVCompression() bool {
return o&SkipDVCompression != 0
}

func (o FieldIndexingOptions) SkipDVChunking() bool {
return o&SkipDVChunking != 0
}

func (o FieldIndexingOptions) String() string {
rv := ""
if o.IsIndexed() {
Expand Down Expand Up @@ -88,5 +101,17 @@ func (o FieldIndexingOptions) String() string {
}
rv += "FN"
}
if !o.SkipDVCompression() {
if rv != "" {
rv += ", "
}
rv += "DV_COMPRESSION"
}
if !o.SkipDVChunking() {
if rv != "" {
rv += ", "
}
rv += "DV_CHUNKING"
}
return rv
}
Loading