func init() { const FormatterName = "html_ex" registry.RegisterFragmentFormatter(FormatterName, func(config map[string]interface{}, cache *registry.Cache) (highlight.FragmentFormatter, error) { return NewFragmentFormatterEx("<span class=\"highlight\">", "</span>"), nil }) _, err := bleve.Config.Cache.DefineFragmentFormatter(FormatterName, map[string]interface{}{ "type": FormatterName, }) if err != nil { panic(err) } _, err = bleve.Config.Cache.DefineHighlighter(FormatterName, map[string]interface{}{ "type": "simple", "fragmenter": "simple", "formatter": FormatterName, }) if err != nil { panic(err) } }
func init() { registry.RegisterFragmentFormatter(Name, Constructor) }