Skip to content
Open
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
13 changes: 12 additions & 1 deletion indexing_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@

package index

type FieldIndexingOptions int
type FieldIndexingOptions uint64

const (
IndexField FieldIndexingOptions = 1 << iota
StoreField
IncludeTermVectors
DocValues
SkipFreqNorm
GPU
)

const (
Expand Down Expand Up @@ -59,6 +60,10 @@ func (o FieldIndexingOptions) SkipFreqNorm() bool {
return o&SkipFreqNorm != 0
}

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

func (o FieldIndexingOptions) String() string {
rv := ""
if o.IsIndexed() {
Expand Down Expand Up @@ -88,5 +93,11 @@ func (o FieldIndexingOptions) String() string {
}
rv += "FN"
}
if o.UseGPU() {
if rv != "" {
rv += ", "
}
rv += "GPU"
}
return rv
}
3 changes: 3 additions & 0 deletions vector.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
package index

type VectorField interface {
// Name of the vector field
Name() string
// The vector data
Vector() []float32
// Dimensionality of the vector
Dims() int
Expand Down