Documentation ¶
Index ¶
- Constants
- Variables
- type BooleanField
- func NewBooleanField(name string, arrayPositions []uint64, b bool) *BooleanField
- func NewBooleanFieldFromBytes(name string, arrayPositions []uint64, value []byte) *BooleanField
- func NewBooleanFieldWithIndexingOptions(name string, arrayPositions []uint64, b bool, options IndexingOptions) *BooleanField
- func (b *BooleanField) Analyze() (int, analysis.TokenFrequencies)
- func (b *BooleanField) ArrayPositions() []uint64
- func (b *BooleanField) Boolean() (bool, error)
- func (b *BooleanField) GoString() string
- func (b *BooleanField) Name() string
- func (b *BooleanField) NumPlainTextBytes() uint64
- func (b *BooleanField) Options() IndexingOptions
- func (b *BooleanField) Value() []byte
- type CompositeField
- func (c *CompositeField) Analyze() (int, analysis.TokenFrequencies)
- func (c *CompositeField) ArrayPositions() []uint64
- func (c *CompositeField) Compose(field string, length int, freq analysis.TokenFrequencies)
- func (c *CompositeField) Name() string
- func (c *CompositeField) NumPlainTextBytes() uint64
- func (c *CompositeField) Options() IndexingOptions
- func (c *CompositeField) Value() []byte
- type DateTimeField
- func NewDateTimeField(name string, arrayPositions []uint64, dt time.Time) (*DateTimeField, error)
- func NewDateTimeFieldFromBytes(name string, arrayPositions []uint64, value []byte) *DateTimeField
- func NewDateTimeFieldWithIndexingOptions(name string, arrayPositions []uint64, dt time.Time, options IndexingOptions) (*DateTimeField, error)
- func (n *DateTimeField) Analyze() (int, analysis.TokenFrequencies)
- func (n *DateTimeField) ArrayPositions() []uint64
- func (n *DateTimeField) DateTime() (time.Time, error)
- func (n *DateTimeField) GoString() string
- func (n *DateTimeField) Name() string
- func (n *DateTimeField) NumPlainTextBytes() uint64
- func (n *DateTimeField) Options() IndexingOptions
- func (n *DateTimeField) Value() []byte
- type Document
- type Field
- type IndexingOptions
- type NumericField
- func NewNumericField(name string, arrayPositions []uint64, number float64) *NumericField
- func NewNumericFieldFromBytes(name string, arrayPositions []uint64, value []byte) *NumericField
- func NewNumericFieldWithIndexingOptions(name string, arrayPositions []uint64, number float64, options IndexingOptions) *NumericField
- func (n *NumericField) Analyze() (int, analysis.TokenFrequencies)
- func (n *NumericField) ArrayPositions() []uint64
- func (n *NumericField) GoString() string
- func (n *NumericField) Name() string
- func (n *NumericField) NumPlainTextBytes() uint64
- func (n *NumericField) Number() (float64, error)
- func (n *NumericField) Options() IndexingOptions
- func (n *NumericField) Value() []byte
- type TextField
- func NewTextField(name string, arrayPositions []uint64, value []byte) *TextField
- func NewTextFieldCustom(name string, arrayPositions []uint64, value []byte, options IndexingOptions, ...) *TextField
- func NewTextFieldWithAnalyzer(name string, arrayPositions []uint64, value []byte, ...) *TextField
- func NewTextFieldWithIndexingOptions(name string, arrayPositions []uint64, value []byte, options IndexingOptions) *TextField
- func (t *TextField) Analyze() (int, analysis.TokenFrequencies)
- func (t *TextField) ArrayPositions() []uint64
- func (t *TextField) GoString() string
- func (t *TextField) Name() string
- func (t *TextField) NumPlainTextBytes() uint64
- func (t *TextField) Options() IndexingOptions
- func (t *TextField) Value() []byte
Constants ¶
View Source
const DefaultBooleanIndexingOptions = StoreField | IndexField
View Source
const DefaultCompositeIndexingOptions = IndexField
View Source
const DefaultDateTimeIndexingOptions = StoreField | IndexField
View Source
const DefaultDateTimePrecisionStep uint = 4
View Source
const DefaultNumericIndexingOptions = StoreField | IndexField
View Source
const DefaultPrecisionStep uint = 4
View Source
const DefaultTextIndexingOptions = IndexField
Variables ¶
View Source
var MaxTimeRepresentable = time.Unix(0, math.MaxInt64)
View Source
var MinTimeRepresentable = time.Unix(0, math.MinInt64)
Functions ¶
This section is empty.
Types ¶
type BooleanField ¶
type BooleanField struct {
// contains filtered or unexported fields
}
func NewBooleanField ¶
func NewBooleanField(name string, arrayPositions []uint64, b bool) *BooleanField
func NewBooleanFieldFromBytes ¶
func NewBooleanFieldFromBytes(name string, arrayPositions []uint64, value []byte) *BooleanField
func NewBooleanFieldWithIndexingOptions ¶
func NewBooleanFieldWithIndexingOptions(name string, arrayPositions []uint64, b bool, options IndexingOptions) *BooleanField
func (*BooleanField) Analyze ¶
func (b *BooleanField) Analyze() (int, analysis.TokenFrequencies)
func (*BooleanField) ArrayPositions ¶
func (b *BooleanField) ArrayPositions() []uint64
func (*BooleanField) Boolean ¶
func (b *BooleanField) Boolean() (bool, error)
func (*BooleanField) GoString ¶
func (b *BooleanField) GoString() string
func (*BooleanField) Name ¶
func (b *BooleanField) Name() string
func (*BooleanField) NumPlainTextBytes ¶
func (b *BooleanField) NumPlainTextBytes() uint64
func (*BooleanField) Options ¶
func (b *BooleanField) Options() IndexingOptions
func (*BooleanField) Value ¶
func (b *BooleanField) Value() []byte
type CompositeField ¶
type CompositeField struct {
// contains filtered or unexported fields
}
func NewCompositeField ¶
func NewCompositeField(name string, defaultInclude bool, include []string, exclude []string) *CompositeField
func NewCompositeFieldWithIndexingOptions ¶
func NewCompositeFieldWithIndexingOptions(name string, defaultInclude bool, include []string, exclude []string, options IndexingOptions) *CompositeField
func (*CompositeField) Analyze ¶
func (c *CompositeField) Analyze() (int, analysis.TokenFrequencies)
func (*CompositeField) ArrayPositions ¶
func (c *CompositeField) ArrayPositions() []uint64
func (*CompositeField) Compose ¶
func (c *CompositeField) Compose(field string, length int, freq analysis.TokenFrequencies)
func (*CompositeField) Name ¶
func (c *CompositeField) Name() string
func (*CompositeField) NumPlainTextBytes ¶
func (c *CompositeField) NumPlainTextBytes() uint64
func (*CompositeField) Options ¶
func (c *CompositeField) Options() IndexingOptions
func (*CompositeField) Value ¶
func (c *CompositeField) Value() []byte
type DateTimeField ¶
type DateTimeField struct {
// contains filtered or unexported fields
}
func NewDateTimeField ¶
func NewDateTimeFieldFromBytes ¶
func NewDateTimeFieldFromBytes(name string, arrayPositions []uint64, value []byte) *DateTimeField
func NewDateTimeFieldWithIndexingOptions ¶
func NewDateTimeFieldWithIndexingOptions(name string, arrayPositions []uint64, dt time.Time, options IndexingOptions) (*DateTimeField, error)
func (*DateTimeField) Analyze ¶
func (n *DateTimeField) Analyze() (int, analysis.TokenFrequencies)
func (*DateTimeField) ArrayPositions ¶
func (n *DateTimeField) ArrayPositions() []uint64
func (*DateTimeField) GoString ¶
func (n *DateTimeField) GoString() string
func (*DateTimeField) Name ¶
func (n *DateTimeField) Name() string
func (*DateTimeField) NumPlainTextBytes ¶
func (n *DateTimeField) NumPlainTextBytes() uint64
func (*DateTimeField) Options ¶
func (n *DateTimeField) Options() IndexingOptions
func (*DateTimeField) Value ¶
func (n *DateTimeField) Value() []byte
type Document ¶
type Document struct { ID string `json:"id"` Fields []Field `json:"fields"` CompositeFields []*CompositeField Number uint64 `json:"-"` }
func NewDocument ¶
func (*Document) NumPlainTextBytes ¶
type Field ¶
type Field interface { // Name returns the path of the field from the root DocumentMapping. // A root field path is "field", a subdocument field is "parent.field". Name() string // ArrayPositions returns the intermediate document and field indices // required to resolve the field value in the document. For example, if the // field path is "doc1.doc2.field" where doc1 and doc2 are slices or // arrays, ArrayPositions returns 2 indices used to resolve "doc2" value in // "doc1", then "field" in "doc2". ArrayPositions() []uint64 Options() IndexingOptions Analyze() (int, analysis.TokenFrequencies) Value() []byte // NumPlainTextBytes should return the number of plain text bytes // that this field represents - this is a common metric for tracking // the rate of indexing NumPlainTextBytes() uint64 }
type IndexingOptions ¶
type IndexingOptions int
const ( IndexField IndexingOptions = 1 << iota StoreField IncludeTermVectors )
func (IndexingOptions) IncludeTermVectors ¶
func (o IndexingOptions) IncludeTermVectors() bool
func (IndexingOptions) IsIndexed ¶
func (o IndexingOptions) IsIndexed() bool
func (IndexingOptions) IsStored ¶
func (o IndexingOptions) IsStored() bool
func (IndexingOptions) String ¶
func (o IndexingOptions) String() string
type NumericField ¶
type NumericField struct {
// contains filtered or unexported fields
}
func NewNumericField ¶
func NewNumericField(name string, arrayPositions []uint64, number float64) *NumericField
func NewNumericFieldFromBytes ¶
func NewNumericFieldFromBytes(name string, arrayPositions []uint64, value []byte) *NumericField
func NewNumericFieldWithIndexingOptions ¶
func NewNumericFieldWithIndexingOptions(name string, arrayPositions []uint64, number float64, options IndexingOptions) *NumericField
func (*NumericField) Analyze ¶
func (n *NumericField) Analyze() (int, analysis.TokenFrequencies)
func (*NumericField) ArrayPositions ¶
func (n *NumericField) ArrayPositions() []uint64
func (*NumericField) GoString ¶
func (n *NumericField) GoString() string
func (*NumericField) Name ¶
func (n *NumericField) Name() string
func (*NumericField) NumPlainTextBytes ¶
func (n *NumericField) NumPlainTextBytes() uint64
func (*NumericField) Number ¶
func (n *NumericField) Number() (float64, error)
func (*NumericField) Options ¶
func (n *NumericField) Options() IndexingOptions
func (*NumericField) Value ¶
func (n *NumericField) Value() []byte
type TextField ¶
type TextField struct {
// contains filtered or unexported fields
}
func NewTextField ¶
func NewTextFieldCustom ¶
func NewTextFieldWithIndexingOptions ¶
func NewTextFieldWithIndexingOptions(name string, arrayPositions []uint64, value []byte, options IndexingOptions) *TextField
func (*TextField) ArrayPositions ¶
func (*TextField) NumPlainTextBytes ¶
func (*TextField) Options ¶
func (t *TextField) Options() IndexingOptions
Click to show internal directories.
Click to hide internal directories.