query

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2019 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(q search.Query) ([]byte, error)

Marshal encodes a query into a byte slice.

func MustCreateRegexpQuery

func MustCreateRegexpQuery(field, regexp []byte) search.Query

MustCreateRegexpQuery is like NewRegexpQuery but panics if the query cannot be created.

func NewConjunctionQuery

func NewConjunctionQuery(queries []search.Query) search.Query

NewConjunctionQuery constructs a new query which matches documents which match all of the given queries.

func NewDisjunctionQuery

func NewDisjunctionQuery(queries []search.Query) search.Query

NewDisjunctionQuery constructs a new query which matches documents that match any of the given queries.

func NewNegationQuery

func NewNegationQuery(q search.Query) search.Query

NewNegationQuery constructs a new NegationQuery for the given query.

func NewRegexpQuery

func NewRegexpQuery(field, regexp []byte) (search.Query, error)

NewRegexpQuery constructs a new query for the given regular expression.

func NewTermQuery

func NewTermQuery(field, term []byte) search.Query

NewTermQuery constructs a new TermQuery for the given field and term.

func Unmarshal

func Unmarshal(data []byte) (search.Query, error)

Unmarshal decodes a query from a byte slice.

Types

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 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.

type TermQuery

type TermQuery struct {
	// contains filtered or unexported fields
}

TermQuery finds document which match the given term exactly.

func (*TermQuery) Equal

func (q *TermQuery) Equal(o search.Query) bool

Equal reports whether q is equivalent to o.

func (*TermQuery) Searcher

func (q *TermQuery) Searcher() (search.Searcher, error)

Searcher returns a searcher over the provided readers.

func (*TermQuery) String

func (q *TermQuery) String() string

func (*TermQuery) ToProto

func (q *TermQuery) ToProto() *querypb.Query

ToProto returns the Protobuf query struct corresponding to the term query.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL