Documentation ¶
Index ¶
- type Flag
- type HighlightOptions
- type Operator
- type Paging
- type Predicate
- func Equals(property string, value interface{}) Predicate
- func GreaterThan(property string, value interface{}) Predicate
- func GreaterThanEquals(property string, value interface{}) Predicate
- func InRange(property string, min, max interface{}, inclusive bool) Predicate
- func LessThan(property string, value interface{}) Predicate
- func LessThanEquals(property string, value interface{}) Predicate
- func NewPredicate(property string, operator Operator, values ...interface{}) Predicate
- type Query
- func (q *Query) AddPredicate(p Predicate) *Query
- func (q *Query) Highlight(fields []string, openTag, closeTag string) *Query
- func (q *Query) Limit(offset, num int) *Query
- func (q *Query) SetField(field string) *Query
- func (q *Query) SetFlags(flags Flag) *Query
- func (q *Query) Summarize(fields ...string) *Query
- func (q *Query) SummarizeOptions(opts SummaryOptions) *Query
- type SummaryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HighlightOptions ¶
HighlightOptions represents the options to higlight specific document fields. See http://redisearch.io/Highlight/
type Predicate ¶
func GreaterThan ¶
func GreaterThanEquals ¶
func LessThanEquals ¶
func NewPredicate ¶
type Query ¶
type Query struct { Index string Term string Field string Predicates []Predicate Paging Paging Flags Flag HighlightOpts *HighlightOptions SummarizeOpts *SummaryOptions }
Query is a single search query and all its parameters and predicates
func NewQuery ¶
NewQuery creates a new query for a given index with the given search term. For currently the index parameter is ignored
func (*Query) AddPredicate ¶
AddPredicate adds a predicate to the query's filters
func (*Query) Highlight ¶
Highlight sets highighting on given fields. Highlighting marks all the query terms with the given open and close tags (i.e. <b> and </b> for HTML)
func (*Query) Summarize ¶
Summarize sets summarization on the given list of fields. It will instruct the engine to extract the most relevant snippets from the fields and return them as the field content. This function works with the default values of the engine, and only sets the fields. There is a function that accepts all options - SummarizeOptions
func (*Query) SummarizeOptions ¶
func (q *Query) SummarizeOptions(opts SummaryOptions) *Query
SummarizeOptions sets summarization on the given list of fields. It will instruct the engine to extract the most relevant snippets from the fields and return them as the field content.
This function accepts advanced settings for snippet length, separators and number of snippets
type SummaryOptions ¶
type SummaryOptions struct { Fields []string FragmentLen int // default 20 NumFragments int // default 3 Separator string // default "..." }
SummaryOptions represents the configuration used to create field summaries. See http://redisearch.io/Highlight/