Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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) SuffixQuery(query.Query, int) (docs []Document, total int, err error) WildCardQuery(query.Query, int) (docs []Document, total int, err error) ContainsQuery(q query.Query, debug int) (docs []Document, total int, err error) Drop() error DocumentCount() int64 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 TextFieldOptions ¶
TextFieldOptions Options for text fields - weight and stemming enabled/disabled.