simple

package
v2.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

View Source
const DefaultSeparator = "…"
View Source
const Name = "simple"

Variables

This section is empty.

Functions

func Constructor

func Constructor(config map[string]interface{}, cache *registry.Cache) (highlight.Highlighter, error)

Types

type FragmentQueue

type FragmentQueue []*highlight.Fragment

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 index.Document, field string) string

func (*Highlighter) BestFragmentsInField

func (s *Highlighter) BestFragmentsInField(dm *search.DocumentMatch, doc index.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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL