Documentation ¶
Index ¶
- func FieldQuery(q Query) (field []byte, ok bool)
- func Marshal(q Query) ([]byte, error)
- type Index
- type Query
- func MustCreateRegexpQuery(field, regexp []byte) Query
- func NewAllQuery() Query
- func NewConjunctionQuery(queries ...Query) Query
- func NewDisjunctionQuery(queries ...Query) Query
- func NewFieldQuery(field []byte) Query
- func NewNegationQuery(q Query) Query
- func NewQueryFromSearchQuery(q search.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 ¶
func FieldQuery ¶
FieldQuery returns a bool indicating whether the Query is a FieldQuery, and the backing bytes of the Field.
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 NewAllQuery ¶
func NewAllQuery() Query
NewAllQuery returns a new query for matching all documents.
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 NewFieldQuery ¶
NewFieldQuery returns a new query for finding documents which match a field exactly.
func NewNegationQuery ¶
NewNegationQuery returns a new query for finding documents which don't match a given query.
func NewQueryFromSearchQuery ¶
NewQueryFromSearchQuery creates a new Query from a search.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