Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Autocompleter ¶
type Autocompleter interface {
AddTerms(terms ...Suggestion) error
Suggest(prefix string, num int, fuzzy bool) ([]Suggestion, error)
Delete() error
}
Autocompleter is an abstract interface for all auto-completers implemented on all engines
type Document ¶
Document represents a single document to be indexed or returned from a query. Besides a score and id, the Properties are completely arbitrary
func NewDocument ¶
NewDocument creates a document with the specific id and score
type DocumentList ¶
type DocumentList []Document
DocumentList is used to sort documents by descending score
func (DocumentList) Len ¶
func (l DocumentList) Len() int
func (DocumentList) Less ¶
func (l DocumentList) Less(i, j int) bool
func (DocumentList) Swap ¶
func (l DocumentList) Swap(i, j int)
type Field ¶
Field represents a single field's metadata
func NewNumericField ¶
NewNumericField creates a new numeric field with the given name
func NewTextField ¶
NewTextField creates a new text field with the given weight
func NewTextFieldSortable ¶
type Index ¶
type Index interface {
GetName() string
Index(documents []Document, options interface{}) error
FullTextQuerySingleField(query.Query, int) (docs []Document, total int, err error)
PrefixQuery(query.Query, int) (docs []Document, total int, err error)
WildCardQuery(query.Query, int) (docs []Document, total int, err error)
Drop() error
Create() error
}
Index is the abstract representation of a search index we're working against. It is implemented for redisearch, elasticserch and solr.
type Metadata ¶
type Metadata struct {
Fields []Field
Options interface{}
}
Metadata represents an index schema metadata, or how the index would treat documents sent to it.
type Suggestion ¶
Suggestion is a single suggestion being added or received from the Autocompleter
type SuggestionList ¶
type SuggestionList []Suggestion
SuggestionList is a sortable list of suggestions returned from an engine
func (SuggestionList) Len ¶
func (l SuggestionList) Len() int
func (SuggestionList) Less ¶
func (l SuggestionList) Less(i, j int) bool
func (SuggestionList) Swap ¶
func (l SuggestionList) Swap(i, j int)
type TextFieldOptions ¶
TextFieldOptions Options for text fields - weight and stemming enabled/disabled.