Documentation
¶
Index ¶
- type Autocompleter
- type ConnectionPool
- type Index
- func (i *Index) Create() error
- func (i *Index) Drop() error
- func (i *Index) FullTextQuerySingleField(q query.Query, verbose int) (docs []index.Document, total int, err error)
- func (i *Index) GetName() string
- func (i *Index) Index(docs []index.Document, options interface{}) error
- func (i *Index) PrefixQuery(q query.Query, verbose int) (docs []index.Document, total int, err error)
- func (i *Index) WildCardQuery(q query.Query, verbose int) (docs []index.Document, total int, err error)
- type IndexingOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Autocompleter ¶
type Autocompleter struct {
// contains filtered or unexported fields
}
Autocompleter implements a redisearch auto-completer API
func NewAutocompleter ¶
func NewAutocompleter(addr, name string) *Autocompleter
NewAutocompleter creates a new Autocompleter with the given host and key name
func (*Autocompleter) AddTerms ¶
func (a *Autocompleter) AddTerms(terms ...index.Suggestion) error
AddTerms pushes new term suggestions to the index
func (*Autocompleter) Delete ¶
func (a *Autocompleter) Delete() error
Delete deletes the Autocompleter key for this AC
func (*Autocompleter) Suggest ¶
func (a *Autocompleter) Suggest(prefix string, num int, fuzzy bool) ([]index.Suggestion, error)
Suggest gets completion suggestions from the Autocompleter dictionary to the given prefix. If fuzzy is set, we also complete for prefixes that are in 1 Levenshten distance from the given prefix
type ConnectionPool ¶
type Index ¶
Index is an interface to redisearch's redis connads
func NewIndex ¶
NewIndex creates a new index connecting to the redis host, and using the given name as key prefix
func (*Index) FullTextQuerySingleField ¶
func (i *Index) FullTextQuerySingleField(q query.Query, verbose int) (docs []index.Document, total int, err error)
Search searches the index for the given query, and returns documents, the total number of results, or an error if something went wrong
func (*Index) Index ¶
Index indexes multiple documents on the index, with optional IndexingOptions passed to options
func (*Index) PrefixQuery ¶
type IndexingOptions ¶
type IndexingOptions struct {
// the language of the document, for stemmer analysis
Language string
// whether we should use stemming on the document. NOT SUPPORTED BY THE ENGINE YET!
Stemming bool
// If set, we will not save the documents contents, just index them, for fetching ids only
NoSave bool
NoFieldFlags bool
NoScoreIndexes bool
NoOffsetVectors bool
Prefix string
}
IndexingOptions are flags passed to the the abstract Index call, which receives them as interface{}, allowing for implementation specific options