Documentation ¶
Index ¶
- Variables
- func NewIndexes(path string, lang string, isPersistent bool) (bleve.Index, bleve.Index, error)
- func NewSearchMapping(lang string, isWide bool) *mapping.IndexMappingImpl
- type FullSearchHit
- type Search
- func (s *Search) Close() error
- func (s *Search) FilterSearch(q string) ([]*ddt.Node, int, time.Duration, bool, error)
- func (s *Search) FullSearch(q string) ([]*FullSearchHit, int, time.Duration, bool, error)
- func (s *Search) IndexNode(n *ddt.Node, wideBatch, narrowBatch *bleve.Batch) error
- func (s *Search) IndexTree() error
- func (s *Search) IsStale() bool
- func (s *Search) LegacyFilterSearch(q string) ([]*ddt.Node, int, time.Duration, error)
- func (s *Search) Refresh() error
Constants ¶
This section is empty.
Variables ¶
var ( // AvailableSearchLangs are languages mapped to their analyzer names. AvailableSearchLangs = map[string]string{ "de": de.AnalyzerName, "en": en.AnalyzerName, } )
Functions ¶
func NewIndexes ¶
func NewSearchMapping ¶
func NewSearchMapping(lang string, isWide bool) *mapping.IndexMappingImpl
Types ¶
type FullSearchHit ¶
type Search ¶
Search provides facilities for differnt kinds of search purposes. It allows to perform full text searching through FullSearch(), wrapping a bleve search index and to perform filtering through FilterSearch().
func NewSearch ¶
NewSearch constructs and initializes a Search. The selected language is validated and checked for availability.
func (*Search) FilterSearch ¶
FilterSearch performs a narrow restricted prefix search on the node's visible attributes (the title) plus tags using the narrow index by default. Returns a slice of found unique Nodes.
func (*Search) FullSearch ¶
FullSearch performs a full text search over all possible attributes of each node using the wide index. Returns a slice of FullSearchHits.
func (*Search) LegacyFilterSearch ¶
LegacyFilterSearch performs a narrow restricted haystack/needle search on the node's visible attributes (the title) plus tags & keywords.
A new filter search has been introduced for APIv2, which we can't simply switch into a APIv1 backwards compatible maintaining mode.