redisearch

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2022 License: BSD-3-Clause Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Index is an interface to redisearch's redis connads

func NewIndex

func NewIndex(addrs []string, pass string, temporary int, name string, md *index.Metadata, mode string, withSuffixTrie bool) *Index

NewIndex creates a new index connecting to the redis host, and using the given name as key prefix

func (*Index) ContainsQuery added in v0.1.5

func (i *Index) ContainsQuery(q query.Query, verbose int) (docs []index.Document, total int, err error)

func (*Index) Create

func (i *Index) Create() error

Create configues the index and creates it on redis

func (*Index) DocumentCount added in v0.1.3

func (i *Index) DocumentCount() (count int64)

func (*Index) Drop

func (i *Index) Drop() (err error)

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) GetName

func (i *Index) GetName() string

func (*Index) Index

func (i *Index) Index(docs []index.Document, options interface{}) error

Index indexes multiple documents on the index, with optional IndexingOptions passed to options

func (*Index) PrefixQuery

func (i *Index) PrefixQuery(q query.Query, verbose int) (docs []index.Document, total int, err error)

func (*Index) SuffixQuery added in v0.1.5

func (i *Index) SuffixQuery(q query.Query, verbose int) (docs []index.Document, total int, err error)

func (*Index) WildCardQuery

func (i *Index) WildCardQuery(q query.Query, verbose int) (docs []index.Document, total int, err error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL