Documentation ¶
Overview ¶
Package suggest handles AutoComplete and Phrase Suggester (Did you mean?) queries
Index ¶
- func Naughty(s string) bool
- func NewNaughty(fh string) error
- type ElasticSearch
- func (e *ElasticSearch) Completion(term string, size int) (Results, error)
- func (e *ElasticSearch) Exists(term string) (bool, error)
- func (e *ElasticSearch) Increment(term string) error
- func (e *ElasticSearch) IndexExists() (bool, error)
- func (e *ElasticSearch) Insert(term string) error
- func (e *ElasticSearch) Setup() error
- type Results
- type Simple
- type Suggester
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ElasticSearch ¶
ElasticSearch holds the index name and the connection
func (*ElasticSearch) Completion ¶
func (e *ElasticSearch) Completion(term string, size int) (Results, error)
Completion handles autocomplete queries
func (*ElasticSearch) Exists ¶
func (e *ElasticSearch) Exists(term string) (bool, error)
Exists checks if a term is already in our index
func (*ElasticSearch) Increment ¶
func (e *ElasticSearch) Increment(term string) error
Increment increments a term in our index
func (*ElasticSearch) IndexExists ¶
func (e *ElasticSearch) IndexExists() (bool, error)
IndexExists returns true if the index exists
func (*ElasticSearch) Insert ¶
func (e *ElasticSearch) Insert(term string) error
Insert adds a new term to our index
func (*ElasticSearch) Setup ¶
func (e *ElasticSearch) Setup() error
Setup creates a completion index
type Results ¶
type Results struct {
Suggestions []string `json:"suggestions"`
}
Results are the results of an autocomplete query
type Simple ¶
type Simple struct {
// contains filtered or unexported fields
}
Simple is a simple autocomplete suggester
func (*Simple) Completion ¶
Completion handles autocomplete queries
func (*Simple) IndexExists ¶
IndexExists returns true if the index exists
Click to show internal directories.
Click to hide internal directories.