Documentation ¶
Index ¶
- Constants
- Variables
- func Bigrams(s string) []string
- func Biunigrams(s string) []string
- func Prefixes(s string) []string
- func Suffixes(s string) []string
- type Bit
- type Config
- type Filters
- func (filters *Filters) Add(label string, indexes ...string) *Filters
- func (filters *Filters) AddBigrams(label string, s string) *Filters
- func (filters *Filters) AddBiunigrams(label string, s string) *Filters
- func (filters *Filters) AddPrefix(label string, s string) *Filters
- func (filters *Filters) AddSomething(label string, indexes interface{}) *Filters
- func (filters *Filters) AddSuffix(label string, s string) *Filters
- func (filters *Filters) Build() (map[string]bool, error)
- func (filters Filters) MustBuild() map[string]bool
- type InBuilder
- type Indexes
- func (idxs *Indexes) Add(label string, indexes ...string) *Indexes
- func (idxs *Indexes) AddBigrams(label string, s string) *Indexes
- func (idxs *Indexes) AddBiunigrams(label string, s string) *Indexes
- func (idxs *Indexes) AddPrefixes(label string, s string) *Indexes
- func (idxs *Indexes) AddSomething(label string, indexes interface{}) *Indexes
- func (idxs *Indexes) AddSuffixes(label string, s string) *Indexes
- func (idxs Indexes) Build() (map[string]bool, error)
- func (idxs Indexes) MustBuild() map[string]bool
Constants ¶
const ( IndexNoFilters = "_NF_" // index to be used for no-filters. MaxIndexesSize = 512 // maximum size of indexes. MaxCompositeIndexLabels = 8 // maximum number of labels for composite index. )
Variables ¶
var DefaultConfig = new(Config)
DefaultConfig - default configuration.
Functions ¶
func Biunigrams ¶
Biunigrams - returns bigram and unigram tokens from s.
Types ¶
type Config ¶
type Config struct { CompositeIdxLabels []string // label list which defines composite indexes to improve the search performance IgnoreCase bool // defines whether to ignore case on search SaveNoFiltersIndex bool // defines whether to save IndexNoFilters index. }
Config - describe extra indexes configuration.
func MustValidateConfig ¶
MustValidateConfig - validates fields and panics if it's invalid.
func ValidateConfig ¶
ValidateConfig - validates Config fields.
type Filters ¶
type Filters struct {
// contains filtered or unexported fields
}
Filters - filters builder for extra indexes.
func NewFilters ¶
NewFilters - creates and initializes a new Filters.
func (*Filters) AddBigrams ¶
AddBigrams - adds new bigram filters with a label.
func (*Filters) AddBiunigrams ¶
AddBiunigrams - adds new biunigram filters with a label.
func (*Filters) AddSomething ¶
AddSomething - adds new filter with a label. The indexes can be a slice or a string convertible value.
type InBuilder ¶
type InBuilder struct {
// contains filtered or unexported fields
}
InBuilder - creates Bit for In-Filter
type Indexes ¶
type Indexes struct {
// contains filtered or unexported fields
}
Indexes - extra indexes for firestore query.
func NewIndexes ¶
NewIndexes - creates and initializes a new Indexes.
func (*Indexes) AddBigrams ¶
AddBigrams - adds new bigram indexes with a label.
func (*Indexes) AddBiunigrams ¶
AddBiunigrams - adds new biunigram indexes with a label.
func (*Indexes) AddPrefixes ¶
AddPrefixes - adds new prefix indexes with a label.
func (*Indexes) AddSomething ¶
AddSomething - adds new indexes with a label. The indexes can be a slice or a string convertible value.
func (*Indexes) AddSuffixes ¶
AddSuffixes - adds new prefix indexes with a label.