Documentation ¶
Index ¶
- func Marshal(q search.Query) ([]byte, error)
- func MustCreateRegexpQuery(field, regexp []byte) search.Query
- func NewAllQuery() search.Query
- func NewConjunctionQuery(queries []search.Query) search.Query
- func NewDisjunctionQuery(queries []search.Query) search.Query
- func NewFieldQuery(field []byte) search.Query
- func NewNegationQuery(q search.Query) search.Query
- func NewRegexpQuery(field, regexp []byte) (search.Query, error)
- func NewTermQuery(field, term []byte) search.Query
- func Unmarshal(data []byte) (search.Query, error)
- type AllQuery
- type ConjuctionQuery
- type DisjuctionQuery
- type FieldQuery
- type NegationQuery
- type RegexpQuery
- type TermQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustCreateRegexpQuery ¶
MustCreateRegexpQuery is like NewRegexpQuery but panics if the query cannot be created.
func NewAllQuery ¶ added in v0.7.3
NewAllQuery constructs a new AllQuery.
func NewConjunctionQuery ¶
NewConjunctionQuery constructs a new query which matches documents which match all of the given queries.
func NewDisjunctionQuery ¶
NewDisjunctionQuery constructs a new query which matches documents that match any of the given queries.
func NewFieldQuery ¶ added in v0.8.1
NewFieldQuery constructs a new FieldQuery for the given field.
func NewNegationQuery ¶
NewNegationQuery constructs a new NegationQuery for the given query.
func NewRegexpQuery ¶
NewRegexpQuery constructs a new query for the given regular expression.
func NewTermQuery ¶
NewTermQuery constructs a new TermQuery for the given field and term.
Types ¶
type AllQuery ¶ added in v0.7.3
type AllQuery struct{}
AllQuery returns a query which matches all known documents.
type ConjuctionQuery ¶
type ConjuctionQuery struct {
// contains filtered or unexported fields
}
ConjuctionQuery finds documents which match at least one of the given queries.
func (*ConjuctionQuery) Equal ¶
func (q *ConjuctionQuery) Equal(o search.Query) bool
Equal reports whether q is equivalent to o.
func (*ConjuctionQuery) Searcher ¶
func (q *ConjuctionQuery) Searcher() (search.Searcher, error)
Searcher returns a searcher over the provided readers.
func (*ConjuctionQuery) String ¶
func (q *ConjuctionQuery) String() string
func (*ConjuctionQuery) ToProto ¶
func (q *ConjuctionQuery) ToProto() *querypb.Query
ToProto returns the Protobuf query struct corresponding to the conjunction query.
type DisjuctionQuery ¶
type DisjuctionQuery struct {
// contains filtered or unexported fields
}
DisjuctionQuery finds documents which match at least one of the given queries.
func (*DisjuctionQuery) Equal ¶
func (q *DisjuctionQuery) Equal(o search.Query) bool
Equal reports whether q is equivalent to o.
func (*DisjuctionQuery) Searcher ¶
func (q *DisjuctionQuery) Searcher() (search.Searcher, error)
Searcher returns a searcher over the provided readers.
func (*DisjuctionQuery) String ¶
func (q *DisjuctionQuery) String() string
func (*DisjuctionQuery) ToProto ¶
func (q *DisjuctionQuery) ToProto() *querypb.Query
ToProto returns the Protobuf query struct corresponding to the disjunction query.
type FieldQuery ¶ added in v0.8.1
type FieldQuery struct {
// contains filtered or unexported fields
}
FieldQuery finds document which have the given field exactly.
func (*FieldQuery) Equal ¶ added in v0.8.1
func (q *FieldQuery) Equal(o search.Query) bool
Equal reports whether q is equivalent to o.
func (*FieldQuery) Field ¶ added in v0.9.1
func (q *FieldQuery) Field() []byte
Field returns the field []byte.
func (*FieldQuery) Searcher ¶ added in v0.8.1
func (q *FieldQuery) Searcher() (search.Searcher, error)
Searcher returns a searcher over the provided readers.
func (*FieldQuery) String ¶ added in v0.8.1
func (q *FieldQuery) String() string
func (*FieldQuery) ToProto ¶ added in v0.8.1
func (q *FieldQuery) ToProto() *querypb.Query
ToProto returns the Protobuf query struct corresponding to the term query.
type NegationQuery ¶
type NegationQuery struct {
// contains filtered or unexported fields
}
NegationQuery finds document which do not match a given query.
func (*NegationQuery) Equal ¶
func (q *NegationQuery) Equal(o search.Query) bool
Equal reports whether q is equivalent to o.
func (*NegationQuery) Searcher ¶
func (q *NegationQuery) Searcher() (search.Searcher, error)
Searcher returns a searcher over the provided readers.
func (*NegationQuery) String ¶
func (q *NegationQuery) String() string
func (*NegationQuery) ToProto ¶
func (q *NegationQuery) ToProto() *querypb.Query
ToProto returns the Protobuf query struct corresponding to the term query.
type RegexpQuery ¶
type RegexpQuery struct {
// contains filtered or unexported fields
}
RegexpQuery finds documents which match the given regular expression.
func (*RegexpQuery) Equal ¶
func (q *RegexpQuery) Equal(o search.Query) bool
Equal reports whether q is equivalent to o.
func (*RegexpQuery) Searcher ¶
func (q *RegexpQuery) Searcher() (search.Searcher, error)
Searcher returns a searcher over the provided readers.
func (*RegexpQuery) String ¶
func (q *RegexpQuery) String() string
func (*RegexpQuery) ToProto ¶
func (q *RegexpQuery) ToProto() *querypb.Query
ToProto returns the Protobuf query struct corresponding to the regexp query.