BREAKING CHANGE - rename fragment_formatters -> format
This commit is contained in:
parent
c487f29a46
commit
a2dd037cdb
|
@ -14,8 +14,8 @@ import (
|
|||
_ "github.com/blevesearch/bleve/analysis/tokenmap"
|
||||
|
||||
// fragment formatters
|
||||
_ "github.com/blevesearch/bleve/search/highlight/fragment_formatters/ansi"
|
||||
_ "github.com/blevesearch/bleve/search/highlight/fragment_formatters/html"
|
||||
_ "github.com/blevesearch/bleve/search/highlight/format/ansi"
|
||||
_ "github.com/blevesearch/bleve/search/highlight/format/html"
|
||||
|
||||
// fragmenters
|
||||
_ "github.com/blevesearch/bleve/search/highlight/fragmenters/simple"
|
||||
|
|
|
@ -14,29 +14,29 @@ import (
|
|||
|
||||
"github.com/blevesearch/bleve/registry"
|
||||
"github.com/blevesearch/bleve/search/highlight"
|
||||
ansi_formatter "github.com/blevesearch/bleve/search/highlight/fragment_formatters/ansi"
|
||||
simple_fragmenter "github.com/blevesearch/bleve/search/highlight/fragmenters/simple"
|
||||
simple_highlighter "github.com/blevesearch/bleve/search/highlight/highlighters/simple"
|
||||
ansiFormatter "github.com/blevesearch/bleve/search/highlight/format/ansi"
|
||||
simpleFragmenter "github.com/blevesearch/bleve/search/highlight/fragmenters/simple"
|
||||
simpleHighlighter "github.com/blevesearch/bleve/search/highlight/highlighters/simple"
|
||||
)
|
||||
|
||||
const Name = "ansi"
|
||||
|
||||
func Constructor(config map[string]interface{}, cache *registry.Cache) (highlight.Highlighter, error) {
|
||||
|
||||
fragmenter, err := cache.FragmenterNamed(simple_fragmenter.Name)
|
||||
fragmenter, err := cache.FragmenterNamed(simpleFragmenter.Name)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error building fragmenter: %v", err)
|
||||
}
|
||||
|
||||
formatter, err := cache.FragmentFormatterNamed(ansi_formatter.Name)
|
||||
formatter, err := cache.FragmentFormatterNamed(ansiFormatter.Name)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error building fragment formatter: %v", err)
|
||||
}
|
||||
|
||||
return simple_highlighter.NewHighlighter(
|
||||
return simpleHighlighter.NewHighlighter(
|
||||
fragmenter,
|
||||
formatter,
|
||||
simple_highlighter.DefaultSeparator),
|
||||
simpleHighlighter.DefaultSeparator),
|
||||
nil
|
||||
}
|
||||
|
||||
|
|
|
@ -14,29 +14,29 @@ import (
|
|||
|
||||
"github.com/blevesearch/bleve/registry"
|
||||
"github.com/blevesearch/bleve/search/highlight"
|
||||
html_formatter "github.com/blevesearch/bleve/search/highlight/fragment_formatters/html"
|
||||
simple_fragmenter "github.com/blevesearch/bleve/search/highlight/fragmenters/simple"
|
||||
simple_highlighter "github.com/blevesearch/bleve/search/highlight/highlighters/simple"
|
||||
htmlFormatter "github.com/blevesearch/bleve/search/highlight/format/html"
|
||||
simpleFragmenter "github.com/blevesearch/bleve/search/highlight/fragmenters/simple"
|
||||
simpleHighlighter "github.com/blevesearch/bleve/search/highlight/highlighters/simple"
|
||||
)
|
||||
|
||||
const Name = "html"
|
||||
|
||||
func Constructor(config map[string]interface{}, cache *registry.Cache) (highlight.Highlighter, error) {
|
||||
|
||||
fragmenter, err := cache.FragmenterNamed(simple_fragmenter.Name)
|
||||
fragmenter, err := cache.FragmenterNamed(simpleFragmenter.Name)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error building fragmenter: %v", err)
|
||||
}
|
||||
|
||||
formatter, err := cache.FragmentFormatterNamed(html_formatter.Name)
|
||||
formatter, err := cache.FragmentFormatterNamed(htmlFormatter.Name)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error building fragment formatter: %v", err)
|
||||
}
|
||||
|
||||
return simple_highlighter.NewHighlighter(
|
||||
return simpleHighlighter.NewHighlighter(
|
||||
fragmenter,
|
||||
formatter,
|
||||
simple_highlighter.DefaultSeparator),
|
||||
simpleHighlighter.DefaultSeparator),
|
||||
nil
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
|
||||
"github.com/blevesearch/bleve/document"
|
||||
"github.com/blevesearch/bleve/search"
|
||||
"github.com/blevesearch/bleve/search/highlight/fragment_formatters/ansi"
|
||||
"github.com/blevesearch/bleve/search/highlight/format/ansi"
|
||||
sfrag "github.com/blevesearch/bleve/search/highlight/fragmenters/simple"
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue