Documentation
¶
Index ¶
- Variables
- func AnalyzerBuild(name string, config map[string]interface{}, cache *Cache) (interface{}, error)
- func AnalyzerTypesAndInstances() ([]string, []string)
- func CharFilterBuild(name string, config map[string]interface{}, cache *Cache) (interface{}, error)
- func CharFilterTypesAndInstances() ([]string, []string)
- func DateTimeParserBuild(name string, config map[string]interface{}, cache *Cache) (interface{}, error)
- func DateTimeParserTypesAndInstances() ([]string, []string)
- func FragmentFormatterBuild(name string, config map[string]interface{}, cache *Cache) (interface{}, error)
- func FragmentFormatterTypesAndInstances() ([]string, []string)
- func FragmenterBuild(name string, config map[string]interface{}, cache *Cache) (interface{}, error)
- func FragmenterTypesAndInstances() ([]string, []string)
- func HighlighterBuild(name string, config map[string]interface{}, cache *Cache) (interface{}, error)
- func HighlighterTypesAndInstances() ([]string, []string)
- func IndexTypesAndInstances() ([]string, []string)
- func KVStoreTypesAndInstances() ([]string, []string)
- func RegisterAnalyzer(name string, constructor AnalyzerConstructor) error
- func RegisterCharFilter(name string, constructor CharFilterConstructor) error
- func RegisterDateTimeParser(name string, constructor DateTimeParserConstructor) error
- func RegisterFragmentFormatter(name string, constructor FragmentFormatterConstructor) error
- func RegisterFragmenter(name string, constructor FragmenterConstructor) error
- func RegisterHighlighter(name string, constructor HighlighterConstructor) error
- func RegisterIndexType(name string, constructor IndexTypeConstructor) error
- func RegisterKVStore(name string, constructor KVStoreConstructor) error
- func RegisterSynonymSource(typ string, constructor SynonymSourceConstructor) error
- func RegisterTokenFilter(name string, constructor TokenFilterConstructor) error
- func RegisterTokenMap(name string, constructor TokenMapConstructor) error
- func RegisterTokenizer(name string, constructor TokenizerConstructor) error
- func SynonymSourceBuild(name string, config map[string]interface{}, cache *Cache) (interface{}, error)
- func TokenFilterBuild(name string, config map[string]interface{}, cache *Cache) (interface{}, error)
- func TokenFilterTypesAndInstances() ([]string, []string)
- func TokenMapBuild(name string, config map[string]interface{}, cache *Cache) (interface{}, error)
- func TokenMapTypesAndInstances() ([]string, []string)
- func TokenizerBuild(name string, config map[string]interface{}, cache *Cache) (interface{}, error)
- func TokenizerTypesAndInstances() ([]string, []string)
- type AnalyzerCache
- type AnalyzerConstructor
- type AnalyzerRegistry
- type Cache
- func (c *Cache) AnalyzerNamed(name string) (analysis.Analyzer, error)
- func (c *Cache) CharFilterNamed(name string) (analysis.CharFilter, error)
- func (c *Cache) DateTimeParserNamed(name string) (analysis.DateTimeParser, error)
- func (c *Cache) DefineAnalyzer(name string, config map[string]interface{}) (analysis.Analyzer, error)
- func (c *Cache) DefineCharFilter(name string, config map[string]interface{}) (analysis.CharFilter, error)
- func (c *Cache) DefineDateTimeParser(name string, config map[string]interface{}) (analysis.DateTimeParser, error)
- func (c *Cache) DefineFragmentFormatter(name string, config map[string]interface{}) (highlight.FragmentFormatter, error)
- func (c *Cache) DefineFragmenter(name string, config map[string]interface{}) (highlight.Fragmenter, error)
- func (c *Cache) DefineHighlighter(name string, config map[string]interface{}) (highlight.Highlighter, error)
- func (c *Cache) DefineSynonymSource(name string, config map[string]interface{}) (analysis.SynonymSource, error)
- func (c *Cache) DefineTokenFilter(name string, config map[string]interface{}) (analysis.TokenFilter, error)
- func (c *Cache) DefineTokenMap(name string, config map[string]interface{}) (analysis.TokenMap, error)
- func (c *Cache) DefineTokenizer(name string, config map[string]interface{}) (analysis.Tokenizer, error)
- func (c *Cache) FragmentFormatterNamed(name string) (highlight.FragmentFormatter, error)
- func (c *Cache) FragmenterNamed(name string) (highlight.Fragmenter, error)
- func (c *Cache) HighlighterNamed(name string) (highlight.Highlighter, error)
- func (c *Cache) SynonymSourceNamed(name string) (analysis.SynonymSource, error)
- func (c *Cache) TokenFilterNamed(name string) (analysis.TokenFilter, error)
- func (c *Cache) TokenMapNamed(name string) (analysis.TokenMap, error)
- func (c *Cache) TokenizerNamed(name string) (analysis.Tokenizer, error)
- type CacheBuild
- type CharFilterCache
- type CharFilterConstructor
- type CharFilterRegistry
- type ConcurrentCache
- type DateTimeParserCache
- type DateTimeParserConstructor
- type DateTimeParserRegistry
- type FragmentFormatterCache
- type FragmentFormatterConstructor
- type FragmentFormatterRegistry
- type FragmenterCache
- type FragmenterConstructor
- type FragmenterRegistry
- type HighlighterCache
- type HighlighterConstructor
- type HighlighterRegistry
- type IndexTypeConstructor
- type IndexTypeRegistry
- type KVStoreConstructor
- type KVStoreRegistry
- type NestedFieldCache
- type SynonymSourceCache
- func (c *SynonymSourceCache) DefineSynonymSource(name string, typ string, config map[string]interface{}, cache *Cache) (analysis.SynonymSource, error)
- func (c *SynonymSourceCache) SynonymSourceNamed(name string, cache *Cache) (analysis.SynonymSource, error)
- func (c *SynonymSourceCache) VisitSynonymSources(visitor analysis.SynonymSourceVisitor) error
- type SynonymSourceConstructor
- type SynonymSourceRegistry
- type TokenFilterCache
- type TokenFilterConstructor
- type TokenFilterRegistry
- type TokenMapCache
- type TokenMapConstructor
- type TokenMapRegistry
- type TokenizerCache
- type TokenizerConstructor
- type TokenizerRegistry
Constants ¶
This section is empty.
Variables ¶
var ErrAlreadyDefined = fmt.Errorf("item already defined")
Functions ¶
func AnalyzerBuild ¶
func CharFilterBuild ¶
func DateTimeParserBuild ¶
func FragmentFormatterBuild ¶
func FragmenterBuild ¶
func HighlighterBuild ¶
func IndexTypesAndInstances ¶
func RegisterAnalyzer ¶
func RegisterAnalyzer(name string, constructor AnalyzerConstructor) error
func RegisterCharFilter ¶
func RegisterCharFilter(name string, constructor CharFilterConstructor) error
func RegisterDateTimeParser ¶
func RegisterDateTimeParser(name string, constructor DateTimeParserConstructor) error
func RegisterFragmentFormatter ¶
func RegisterFragmentFormatter(name string, constructor FragmentFormatterConstructor) error
func RegisterFragmenter ¶
func RegisterFragmenter(name string, constructor FragmenterConstructor) error
func RegisterHighlighter ¶
func RegisterHighlighter(name string, constructor HighlighterConstructor) error
func RegisterIndexType ¶
func RegisterIndexType(name string, constructor IndexTypeConstructor) error
func RegisterKVStore ¶
func RegisterKVStore(name string, constructor KVStoreConstructor) error
func RegisterSynonymSource ¶ added in v2.5.0
func RegisterSynonymSource(typ string, constructor SynonymSourceConstructor) error
func RegisterTokenFilter ¶
func RegisterTokenFilter(name string, constructor TokenFilterConstructor) error
func RegisterTokenMap ¶
func RegisterTokenMap(name string, constructor TokenMapConstructor) error
func RegisterTokenizer ¶
func RegisterTokenizer(name string, constructor TokenizerConstructor) error
func SynonymSourceBuild ¶ added in v2.5.0
func TokenFilterBuild ¶
func TokenMapBuild ¶
func TokenizerBuild ¶
Types ¶
type AnalyzerCache ¶
type AnalyzerCache struct {
*ConcurrentCache
}
func NewAnalyzerCache ¶
func NewAnalyzerCache() *AnalyzerCache
func (*AnalyzerCache) AnalyzerNamed ¶
func (*AnalyzerCache) DefineAnalyzer ¶
type AnalyzerConstructor ¶
type AnalyzerRegistry ¶
type AnalyzerRegistry map[string]AnalyzerConstructor
type Cache ¶
type Cache struct {
CharFilters *CharFilterCache
Tokenizers *TokenizerCache
TokenMaps *TokenMapCache
TokenFilters *TokenFilterCache
Analyzers *AnalyzerCache
DateTimeParsers *DateTimeParserCache
FragmentFormatters *FragmentFormatterCache
Fragmenters *FragmenterCache
Highlighters *HighlighterCache
SynonymSources *SynonymSourceCache
NestedPrefixes *NestedFieldCache
}
func (*Cache) CharFilterNamed ¶
func (c *Cache) CharFilterNamed(name string) (analysis.CharFilter, error)
func (*Cache) DateTimeParserNamed ¶
func (c *Cache) DateTimeParserNamed(name string) (analysis.DateTimeParser, error)
func (*Cache) DefineAnalyzer ¶
func (*Cache) DefineCharFilter ¶
func (*Cache) DefineDateTimeParser ¶
func (*Cache) DefineFragmentFormatter ¶
func (*Cache) DefineFragmenter ¶
func (*Cache) DefineHighlighter ¶
func (*Cache) DefineSynonymSource ¶ added in v2.5.0
func (*Cache) DefineTokenFilter ¶
func (*Cache) DefineTokenMap ¶
func (*Cache) DefineTokenizer ¶
func (*Cache) FragmentFormatterNamed ¶
func (c *Cache) FragmentFormatterNamed(name string) (highlight.FragmentFormatter, error)
func (*Cache) FragmenterNamed ¶
func (c *Cache) FragmenterNamed(name string) (highlight.Fragmenter, error)
func (*Cache) HighlighterNamed ¶
func (c *Cache) HighlighterNamed(name string) (highlight.Highlighter, error)
func (*Cache) SynonymSourceNamed ¶ added in v2.5.0
func (c *Cache) SynonymSourceNamed(name string) (analysis.SynonymSource, error)
func (*Cache) TokenFilterNamed ¶
func (c *Cache) TokenFilterNamed(name string) (analysis.TokenFilter, error)
type CacheBuild ¶
type CharFilterCache ¶
type CharFilterCache struct {
*ConcurrentCache
}
func NewCharFilterCache ¶
func NewCharFilterCache() *CharFilterCache
func (*CharFilterCache) CharFilterNamed ¶
func (c *CharFilterCache) CharFilterNamed(name string, cache *Cache) (analysis.CharFilter, error)
func (*CharFilterCache) DefineCharFilter ¶
func (c *CharFilterCache) DefineCharFilter(name string, typ string, config map[string]interface{}, cache *Cache) (analysis.CharFilter, error)
type CharFilterConstructor ¶
type CharFilterConstructor func(config map[string]interface{}, cache *Cache) (analysis.CharFilter, error)
type CharFilterRegistry ¶
type CharFilterRegistry map[string]CharFilterConstructor
type ConcurrentCache ¶
type ConcurrentCache struct {
// contains filtered or unexported fields
}
func NewConcurrentCache ¶
func NewConcurrentCache() *ConcurrentCache
func (*ConcurrentCache) DefineItem ¶
func (c *ConcurrentCache) DefineItem(name string, typ string, config map[string]interface{}, cache *Cache, build CacheBuild) (interface{}, error)
func (*ConcurrentCache) ItemNamed ¶
func (c *ConcurrentCache) ItemNamed(name string, cache *Cache, build CacheBuild) (interface{}, error)
type DateTimeParserCache ¶
type DateTimeParserCache struct {
*ConcurrentCache
}
func NewDateTimeParserCache ¶
func NewDateTimeParserCache() *DateTimeParserCache
func (*DateTimeParserCache) DateTimeParserNamed ¶
func (c *DateTimeParserCache) DateTimeParserNamed(name string, cache *Cache) (analysis.DateTimeParser, error)
func (*DateTimeParserCache) DefineDateTimeParser ¶
func (c *DateTimeParserCache) DefineDateTimeParser(name string, typ string, config map[string]interface{}, cache *Cache) (analysis.DateTimeParser, error)
type DateTimeParserConstructor ¶
type DateTimeParserConstructor func(config map[string]interface{}, cache *Cache) (analysis.DateTimeParser, error)
type DateTimeParserRegistry ¶
type DateTimeParserRegistry map[string]DateTimeParserConstructor
type FragmentFormatterCache ¶
type FragmentFormatterCache struct {
*ConcurrentCache
}
func NewFragmentFormatterCache ¶
func NewFragmentFormatterCache() *FragmentFormatterCache
func (*FragmentFormatterCache) DefineFragmentFormatter ¶
func (c *FragmentFormatterCache) DefineFragmentFormatter(name string, typ string, config map[string]interface{}, cache *Cache) (highlight.FragmentFormatter, error)
func (*FragmentFormatterCache) FragmentFormatterNamed ¶
func (c *FragmentFormatterCache) FragmentFormatterNamed(name string, cache *Cache) (highlight.FragmentFormatter, error)
type FragmentFormatterConstructor ¶
type FragmentFormatterConstructor func(config map[string]interface{}, cache *Cache) (highlight.FragmentFormatter, error)
type FragmentFormatterRegistry ¶
type FragmentFormatterRegistry map[string]FragmentFormatterConstructor
type FragmenterCache ¶
type FragmenterCache struct {
*ConcurrentCache
}
func NewFragmenterCache ¶
func NewFragmenterCache() *FragmenterCache
func (*FragmenterCache) DefineFragmenter ¶
func (c *FragmenterCache) DefineFragmenter(name string, typ string, config map[string]interface{}, cache *Cache) (highlight.Fragmenter, error)
func (*FragmenterCache) FragmenterNamed ¶
func (c *FragmenterCache) FragmenterNamed(name string, cache *Cache) (highlight.Fragmenter, error)
type FragmenterConstructor ¶
type FragmenterConstructor func(config map[string]interface{}, cache *Cache) (highlight.Fragmenter, error)
type FragmenterRegistry ¶
type FragmenterRegistry map[string]FragmenterConstructor
type HighlighterCache ¶
type HighlighterCache struct {
*ConcurrentCache
}
func NewHighlighterCache ¶
func NewHighlighterCache() *HighlighterCache
func (*HighlighterCache) DefineHighlighter ¶
func (c *HighlighterCache) DefineHighlighter(name string, typ string, config map[string]interface{}, cache *Cache) (highlight.Highlighter, error)
func (*HighlighterCache) HighlighterNamed ¶
func (c *HighlighterCache) HighlighterNamed(name string, cache *Cache) (highlight.Highlighter, error)
type HighlighterConstructor ¶
type HighlighterConstructor func(config map[string]interface{}, cache *Cache) (highlight.Highlighter, error)
type HighlighterRegistry ¶
type HighlighterRegistry map[string]HighlighterConstructor
type IndexTypeConstructor ¶
type IndexTypeConstructor func(storeName string, storeConfig map[string]interface{}, analysisQueue *index.AnalysisQueue) (index.Index, error)
func IndexTypeConstructorByName ¶
func IndexTypeConstructorByName(name string) IndexTypeConstructor
type IndexTypeRegistry ¶
type IndexTypeRegistry map[string]IndexTypeConstructor
type KVStoreConstructor ¶
type KVStoreConstructor func(mo store.MergeOperator, config map[string]interface{}) (store.KVStore, error)
KVStoreConstructor is used to build a KVStore of a specific type when specified by the index configuration. In addition to meeting the store.KVStore interface, KVStores must also support this constructor. Note that currently the values of config must be able to be marshaled and unmarshaled using the encoding/json library (used when reading/writing the index metadata file).
func KVStoreConstructorByName ¶
func KVStoreConstructorByName(name string) KVStoreConstructor
type KVStoreRegistry ¶
type KVStoreRegistry map[string]KVStoreConstructor
type NestedFieldCache ¶ added in v2.6.0
type NestedFieldCache struct {
// contains filtered or unexported fields
}
NestedFieldCache caches nested field prefixes and their corresponding nesting levels. A nested field prefix is a field path prefix that indicates the start of a nested document. The nesting level indicates how deep the nested document is in the overall document structure.
func NewNestedFieldCache ¶ added in v2.6.0
func NewNestedFieldCache() *NestedFieldCache
func (*NestedFieldCache) CountNested ¶ added in v2.6.0
func (nfc *NestedFieldCache) CountNested() int
CountNested returns the number of nested prefixes
func (*NestedFieldCache) InitOnce ¶ added in v2.6.0
func (nfc *NestedFieldCache) InitOnce(buildFunc func() map[string]int)
func (*NestedFieldCache) IntersectsPrefix ¶ added in v2.6.0
func (nfc *NestedFieldCache) IntersectsPrefix(fieldPaths search.FieldSet) bool
IntersectsPrefix returns true if any of the given field paths have a nested prefix
func (*NestedFieldCache) NestedDepth ¶ added in v2.6.0
func (nfc *NestedFieldCache) NestedDepth(fieldPaths search.FieldSet) (common int, max int)
NestedDepth returns two values:
- common: The nesting level of the longest prefix that applies to every field path in the provided FieldSet. A value of 0 means no nested prefix is shared across all field paths.
- max: The nesting level of the longest prefix that applies to at least one field path in the provided FieldSet. A value of 0 means none of the field paths match any nested prefix.
type SynonymSourceCache ¶ added in v2.5.0
type SynonymSourceCache struct {
*ConcurrentCache
}
func NewSynonymSourceCache ¶ added in v2.5.0
func NewSynonymSourceCache() *SynonymSourceCache
func (*SynonymSourceCache) DefineSynonymSource ¶ added in v2.5.0
func (c *SynonymSourceCache) DefineSynonymSource(name string, typ string, config map[string]interface{}, cache *Cache) (analysis.SynonymSource, error)
func (*SynonymSourceCache) SynonymSourceNamed ¶ added in v2.5.0
func (c *SynonymSourceCache) SynonymSourceNamed(name string, cache *Cache) (analysis.SynonymSource, error)
func (*SynonymSourceCache) VisitSynonymSources ¶ added in v2.5.0
func (c *SynonymSourceCache) VisitSynonymSources(visitor analysis.SynonymSourceVisitor) error
type SynonymSourceConstructor ¶ added in v2.5.0
type SynonymSourceConstructor func(config map[string]interface{}, cache *Cache) (analysis.SynonymSource, error)
type SynonymSourceRegistry ¶ added in v2.5.0
type SynonymSourceRegistry map[string]SynonymSourceConstructor
type TokenFilterCache ¶
type TokenFilterCache struct {
*ConcurrentCache
}
func NewTokenFilterCache ¶
func NewTokenFilterCache() *TokenFilterCache
func (*TokenFilterCache) DefineTokenFilter ¶
func (c *TokenFilterCache) DefineTokenFilter(name string, typ string, config map[string]interface{}, cache *Cache) (analysis.TokenFilter, error)
func (*TokenFilterCache) TokenFilterNamed ¶
func (c *TokenFilterCache) TokenFilterNamed(name string, cache *Cache) (analysis.TokenFilter, error)
type TokenFilterConstructor ¶
type TokenFilterConstructor func(config map[string]interface{}, cache *Cache) (analysis.TokenFilter, error)
type TokenFilterRegistry ¶
type TokenFilterRegistry map[string]TokenFilterConstructor
type TokenMapCache ¶
type TokenMapCache struct {
*ConcurrentCache
}
func NewTokenMapCache ¶
func NewTokenMapCache() *TokenMapCache
func (*TokenMapCache) DefineTokenMap ¶
func (*TokenMapCache) TokenMapNamed ¶
type TokenMapConstructor ¶
type TokenMapRegistry ¶
type TokenMapRegistry map[string]TokenMapConstructor
type TokenizerCache ¶
type TokenizerCache struct {
*ConcurrentCache
}
func NewTokenizerCache ¶
func NewTokenizerCache() *TokenizerCache
func (*TokenizerCache) DefineTokenizer ¶
func (*TokenizerCache) TokenizerNamed ¶
type TokenizerConstructor ¶
type TokenizerRegistry ¶
type TokenizerRegistry map[string]TokenizerConstructor