Documentation
¶
Index ¶
- func Marshal(q Query) ([]byte, error)
- type Index
- type Query
- func MustCreateRegexpQuery(field, regexp []byte) Query
- func NewConjunctionQuery(queries ...Query) Query
- func NewDisjunctionQuery(queries ...Query) Query
- func NewNegationQuery(q Query) Query
- func NewRegexpQuery(field, regexp []byte) (Query, error)
- func NewTermQuery(field, term []byte) Query
- func Unmarshal(data []byte) (Query, error)
- type QueryMatcher
- type Searcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Index ¶
type Index interface {
// Insert inserts a document into the index.
Insert(d doc.Document) error
// Searcher returns a Searcher over a point-in-time view of the index.
Searcher() (Searcher, error)
// Close closes the index.
Close() error
}
Index is an inverted index.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query encapsulates a search query for an index.
func MustCreateRegexpQuery ¶
MustCreateRegexpQuery is like NewRegexpQuery but panics if the query cannot be created.
func NewConjunctionQuery ¶
NewConjunctionQuery returns a new query for finding documents which match each of the given queries.
func NewDisjunctionQuery ¶
NewDisjunctionQuery returns a new query for finding documents which match at least one of the given queries.
func NewNegationQuery ¶
NewNegationQuery returns a new query for finding documents which don't match a given query.
func NewRegexpQuery ¶
NewRegexpQuery returns a new query for finding documents which match a regular expression.
func NewTermQuery ¶
NewTermQuery returns a new query for finding documents which match a term exactly.
func (Query) SearchQuery ¶
SearchQuery returns the underlying search query for use during execution.
type QueryMatcher ¶
QueryMatcher is a gomock.Matcher that matches idx.Query
func NewQueryMatcher ¶
func NewQueryMatcher(q Query) QueryMatcher
NewQueryMatcher returns a new QueryMatcher