query

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 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 NewAllQuery added in v0.7.3

func NewAllQuery() search.Query

NewAllQuery constructs a new AllQuery.

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 NewFieldQuery added in v0.8.1

func NewFieldQuery(field []byte) search.Query

NewFieldQuery constructs a new FieldQuery for the given field.

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 AllQuery added in v0.7.3

type AllQuery struct{}

AllQuery returns a query which matches all known documents.

func (*AllQuery) Equal added in v0.7.3

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

Equal reports whether q is equivalent to o.

func (*AllQuery) Searcher added in v0.7.3

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

Searcher returns a searcher over the provided readers.

func (*AllQuery) String added in v0.7.3

func (q *AllQuery) String() string

func (*AllQuery) ToProto added in v0.7.3

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

ToProto returns the Protobuf query struct corresponding to the match all query.

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.

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