Documentation ¶
Index ¶
- Constants
- func Constructor(config map[string]interface{}, cache *registry.Cache) (highlight.Highlighter, error)
- type FragmentQueue
- type FragmentScorer
- type Highlighter
- func (s *Highlighter) BestFragmentInField(dm *search.DocumentMatch, doc *document.Document, field string) string
- func (s *Highlighter) BestFragmentsInField(dm *search.DocumentMatch, doc *document.Document, field string, num int) []string
- func (s *Highlighter) FragmentFormatter() highlight.FragmentFormatter
- func (s *Highlighter) Fragmenter() highlight.Fragmenter
- func (s *Highlighter) Separator() string
- func (s *Highlighter) SetFragmentFormatter(f highlight.FragmentFormatter)
- func (s *Highlighter) SetFragmenter(f highlight.Fragmenter)
- func (s *Highlighter) SetSeparator(sep string)
Constants ¶
View Source
const Name = "simple"
Variables ¶
This section is empty.
Functions ¶
func Constructor ¶
Types ¶
type FragmentQueue ¶
FragmentQueue implements heap.Interface and holds Items.
func (FragmentQueue) Len ¶
func (fq FragmentQueue) Len() int
func (FragmentQueue) Less ¶
func (fq FragmentQueue) Less(i, j int) bool
func (*FragmentQueue) Pop ¶
func (fq *FragmentQueue) Pop() interface{}
func (*FragmentQueue) Push ¶
func (fq *FragmentQueue) Push(x interface{})
func (FragmentQueue) Swap ¶
func (fq FragmentQueue) Swap(i, j int)
type FragmentScorer ¶
type FragmentScorer struct {
// contains filtered or unexported fields
}
FragmentScorer will score fragments by how many unique terms occur in the fragment with no regard for any boost values used in the original query
func NewFragmentScorer ¶
func NewFragmentScorer(tlm search.TermLocationMap) *FragmentScorer
func (*FragmentScorer) Score ¶
func (s *FragmentScorer) Score(f *highlight.Fragment)
type Highlighter ¶
type Highlighter struct {
// contains filtered or unexported fields
}
func NewHighlighter ¶
func NewHighlighter(fragmenter highlight.Fragmenter, formatter highlight.FragmentFormatter, separator string) *Highlighter
func (*Highlighter) BestFragmentInField ¶
func (s *Highlighter) BestFragmentInField(dm *search.DocumentMatch, doc *document.Document, field string) string
func (*Highlighter) BestFragmentsInField ¶
func (s *Highlighter) BestFragmentsInField(dm *search.DocumentMatch, doc *document.Document, field string, num int) []string
func (*Highlighter) FragmentFormatter ¶
func (s *Highlighter) FragmentFormatter() highlight.FragmentFormatter
func (*Highlighter) Fragmenter ¶
func (s *Highlighter) Fragmenter() highlight.Fragmenter
func (*Highlighter) Separator ¶
func (s *Highlighter) Separator() string
func (*Highlighter) SetFragmentFormatter ¶
func (s *Highlighter) SetFragmentFormatter(f highlight.FragmentFormatter)
func (*Highlighter) SetFragmenter ¶
func (s *Highlighter) SetFragmenter(f highlight.Fragmenter)
func (*Highlighter) SetSeparator ¶
func (s *Highlighter) SetSeparator(sep string)
Click to show internal directories.
Click to hide internal directories.