search

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BooleanFieldQuery

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

BooleanFieldQuery represents a search boolean field query.

func NewBooleanFieldQuery

func NewBooleanFieldQuery(val bool) *BooleanFieldQuery

NewBooleanFieldQuery creates a new BooleanFieldQuery.

func (*BooleanFieldQuery) Boost

func (q *BooleanFieldQuery) Boost(boost float32) *BooleanFieldQuery

Boost specifies the boost for this query.

func (*BooleanFieldQuery) Field

func (q *BooleanFieldQuery) Field(field string) *BooleanFieldQuery

Field specifies the field for this query.

func (BooleanFieldQuery) MarshalJSON

func (q BooleanFieldQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type BooleanQuery

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

BooleanQuery represents a search boolean query.

func NewBooleanQuery

func NewBooleanQuery() *BooleanQuery

NewBooleanQuery creates a new BooleanQuery.

func (*BooleanQuery) Boost

func (q *BooleanQuery) Boost(boost float32) *BooleanQuery

Boost specifies the boost for this query.

func (*BooleanQuery) MarshalJSON

func (q *BooleanQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

func (*BooleanQuery) Must

func (q *BooleanQuery) Must(query Query) *BooleanQuery

Must specifies a query which must match.

func (*BooleanQuery) MustNot

func (q *BooleanQuery) MustNot(query Query) *BooleanQuery

MustNot specifies a query which must not match.

func (*BooleanQuery) Should

func (q *BooleanQuery) Should(query Query) *BooleanQuery

Should specifies a query which should match.

func (*BooleanQuery) ShouldMin

func (q *BooleanQuery) ShouldMin(min uint32) *BooleanQuery

ShouldMin specifies the minimum value before the should query will boost.

type ConjunctionQuery

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

ConjunctionQuery represents a search conjunction query.

func NewConjunctionQuery

func NewConjunctionQuery(queries ...Query) *ConjunctionQuery

NewConjunctionQuery creates a new ConjunctionQuery.

func (*ConjunctionQuery) And

func (q *ConjunctionQuery) And(queries ...Query) *ConjunctionQuery

And adds new predicate queries to this conjunction query.

func (*ConjunctionQuery) Boost

func (q *ConjunctionQuery) Boost(boost float32) *ConjunctionQuery

Boost specifies the boost for this query.

func (ConjunctionQuery) MarshalJSON

func (q ConjunctionQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type DateFacet

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

DateFacet is an search date range facet.

func NewDateFacet

func NewDateFacet(field string, size uint64) *DateFacet

NewDateFacet creates a new date range facet.

func (*DateFacet) AddRange

func (f *DateFacet) AddRange(name string, start, end string) *DateFacet

AddRange adds a new range to this date range facet.

func (DateFacet) MarshalJSON

func (f DateFacet) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this facet to JSON for the search REST API.

type DateRangeQuery

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

DateRangeQuery represents a search date range query.

func NewDateRangeQuery

func NewDateRangeQuery() *DateRangeQuery

NewDateRangeQuery creates a new DateRangeQuery.

func (*DateRangeQuery) Boost

func (q *DateRangeQuery) Boost(boost float32) *DateRangeQuery

Boost specifies the boost for this query.

func (*DateRangeQuery) DateTimeParser

func (q *DateRangeQuery) DateTimeParser(parser string) *DateRangeQuery

DateTimeParser specifies which date time string parser to use.

func (*DateRangeQuery) End

func (q *DateRangeQuery) End(end string, inclusive bool) *DateRangeQuery

End specifies the end value and inclusiveness for this range query.

func (*DateRangeQuery) Field

func (q *DateRangeQuery) Field(field string) *DateRangeQuery

Field specifies the field for this query.

func (DateRangeQuery) MarshalJSON

func (q DateRangeQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

func (*DateRangeQuery) Start

func (q *DateRangeQuery) Start(start string, inclusive bool) *DateRangeQuery

Start specifies the start value and inclusiveness for this range query.

type DisjunctionQuery

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

DisjunctionQuery represents a search disjunction query.

func NewDisjunctionQuery

func NewDisjunctionQuery(queries ...Query) *DisjunctionQuery

NewDisjunctionQuery creates a new DisjunctionQuery.

func (*DisjunctionQuery) Boost

func (q *DisjunctionQuery) Boost(boost float32) *DisjunctionQuery

Boost specifies the boost for this query.

func (DisjunctionQuery) MarshalJSON

func (q DisjunctionQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

func (*DisjunctionQuery) Or

func (q *DisjunctionQuery) Or(queries ...Query) *DisjunctionQuery

Or adds new predicate queries to this disjunction query.

type DocIDQuery

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

DocIDQuery represents a search document id query.

func NewDocIDQuery

func NewDocIDQuery(ids ...string) *DocIDQuery

NewDocIDQuery creates a new DocIdQuery.

func (*DocIDQuery) AddDocIds

func (q *DocIDQuery) AddDocIds(ids ...string) *DocIDQuery

AddDocIds adds addition document ids to this query.

func (*DocIDQuery) Boost

func (q *DocIDQuery) Boost(boost float32) *DocIDQuery

Boost specifies the boost for this query.

func (*DocIDQuery) Field

func (q *DocIDQuery) Field(field string) *DocIDQuery

Field specifies the field for this query.

func (DocIDQuery) MarshalJSON

func (q DocIDQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type Facet

type Facet interface {
}

Facet represents a facet for a search query.

type GeoBoundingBoxQuery

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

GeoBoundingBoxQuery represents a search geographical bounding box query.

func NewGeoBoundingBoxQuery

func NewGeoBoundingBoxQuery(tlLon, tlLat, brLon, brLat float64) *GeoBoundingBoxQuery

NewGeoBoundingBoxQuery creates a new GeoBoundingBoxQuery.

func (*GeoBoundingBoxQuery) Boost

Boost specifies the boost for this query.

func (*GeoBoundingBoxQuery) Field

Field specifies the field for this query.

func (GeoBoundingBoxQuery) MarshalJSON

func (q GeoBoundingBoxQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type GeoDistanceQuery

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

GeoDistanceQuery represents a search geographical distance query.

func NewGeoDistanceQuery

func NewGeoDistanceQuery(lon, lat float64, distance string) *GeoDistanceQuery

NewGeoDistanceQuery creates a new GeoDistanceQuery.

func (*GeoDistanceQuery) Boost

func (q *GeoDistanceQuery) Boost(boost float32) *GeoDistanceQuery

Boost specifies the boost for this query.

func (*GeoDistanceQuery) Field

func (q *GeoDistanceQuery) Field(field string) *GeoDistanceQuery

Field specifies the field for this query.

func (GeoDistanceQuery) MarshalJSON

func (q GeoDistanceQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type MatchAllQuery

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

MatchAllQuery represents a search match all query.

func NewMatchAllQuery

func NewMatchAllQuery() *MatchAllQuery

NewMatchAllQuery creates a new MatchAllQuery.

func (MatchAllQuery) MarshalJSON

func (q MatchAllQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type MatchNoneQuery

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

MatchNoneQuery represents a search match none query.

func NewMatchNoneQuery

func NewMatchNoneQuery() *MatchNoneQuery

NewMatchNoneQuery creates a new MatchNoneQuery.

func (MatchNoneQuery) MarshalJSON

func (q MatchNoneQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type MatchPhraseQuery

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

MatchPhraseQuery represents a search match phrase query.

func NewMatchPhraseQuery

func NewMatchPhraseQuery(phrase string) *MatchPhraseQuery

NewMatchPhraseQuery creates a new MatchPhraseQuery

func (*MatchPhraseQuery) Analyzer

func (q *MatchPhraseQuery) Analyzer(analyzer string) *MatchPhraseQuery

Analyzer specifies the analyzer to use for this query.

func (*MatchPhraseQuery) Boost

func (q *MatchPhraseQuery) Boost(boost float32) *MatchPhraseQuery

Boost specifies the boost for this query.

func (*MatchPhraseQuery) Field

func (q *MatchPhraseQuery) Field(field string) *MatchPhraseQuery

Field specifies the field for this query.

func (MatchPhraseQuery) MarshalJSON

func (q MatchPhraseQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type MatchQuery

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

MatchQuery represents a search match query.

func NewMatchQuery

func NewMatchQuery(match string) *MatchQuery

NewMatchQuery creates a new MatchQuery.

func (*MatchQuery) Analyzer

func (q *MatchQuery) Analyzer(analyzer string) *MatchQuery

Analyzer specifies the analyzer to use for this query.

func (*MatchQuery) Boost

func (q *MatchQuery) Boost(boost float32) *MatchQuery

Boost specifies the boost for this query.

func (*MatchQuery) Field

func (q *MatchQuery) Field(field string) *MatchQuery

Field specifies the field for this query.

func (*MatchQuery) Fuzziness

func (q *MatchQuery) Fuzziness(fuzziness uint64) *MatchQuery

Fuzziness specifies the fuziness for this query.

func (MatchQuery) MarshalJSON

func (q MatchQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

func (*MatchQuery) PrefixLength

func (q *MatchQuery) PrefixLength(length uint64) *MatchQuery

PrefixLength specifies the prefix length from this query.

type NumericFacet

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

NumericFacet is an search numeric range facet.

func NewNumericFacet

func NewNumericFacet(field string, size uint64) *NumericFacet

NewNumericFacet creates a new numeric range facet.

func (*NumericFacet) AddRange

func (f *NumericFacet) AddRange(name string, start, end float64) *NumericFacet

AddRange adds a new range to this numeric range facet.

func (NumericFacet) MarshalJSON

func (f NumericFacet) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this facet to JSON for the search REST API.

type NumericRangeQuery

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

NumericRangeQuery represents a search numeric range query.

func NewNumericRangeQuery

func NewNumericRangeQuery() *NumericRangeQuery

NewNumericRangeQuery creates a new NumericRangeQuery.

func (*NumericRangeQuery) Boost

func (q *NumericRangeQuery) Boost(boost float32) *NumericRangeQuery

Boost specifies the boost for this query.

func (*NumericRangeQuery) Field

func (q *NumericRangeQuery) Field(field string) *NumericRangeQuery

Field specifies the field for this query.

func (NumericRangeQuery) MarshalJSON

func (q NumericRangeQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

func (*NumericRangeQuery) Max

func (q *NumericRangeQuery) Max(max float32, inclusive bool) *NumericRangeQuery

Max specifies the maximum value and inclusiveness for this range query.

func (*NumericRangeQuery) Min

func (q *NumericRangeQuery) Min(min float32, inclusive bool) *NumericRangeQuery

Min specifies the minimum value and inclusiveness for this range query.

type PhraseQuery

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

PhraseQuery represents a search phrase query.

func NewPhraseQuery

func NewPhraseQuery(terms ...string) *PhraseQuery

NewPhraseQuery creates a new PhraseQuery.

func (*PhraseQuery) Boost

func (q *PhraseQuery) Boost(boost float32) *PhraseQuery

Boost specifies the boost for this query.

func (*PhraseQuery) Field

func (q *PhraseQuery) Field(field string) *PhraseQuery

Field specifies the field for this query.

func (PhraseQuery) MarshalJSON

func (q PhraseQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type PrefixQuery

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

PrefixQuery represents a search prefix query.

func NewPrefixQuery

func NewPrefixQuery(prefix string) *PrefixQuery

NewPrefixQuery creates a new PrefixQuery.

func (*PrefixQuery) Boost

func (q *PrefixQuery) Boost(boost float32) *PrefixQuery

Boost specifies the boost for this query.

func (*PrefixQuery) Field

func (q *PrefixQuery) Field(field string) *PrefixQuery

Field specifies the field for this query.

func (PrefixQuery) MarshalJSON

func (q PrefixQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type Query

type Query interface {
}

Query represents a search query.

type QueryStringQuery

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

QueryStringQuery represents a search string query.

func NewQueryStringQuery

func NewQueryStringQuery(query string) *QueryStringQuery

NewQueryStringQuery creates a new StringQuery.

func (*QueryStringQuery) Boost

func (q *QueryStringQuery) Boost(boost float32) *QueryStringQuery

Boost specifies the boost for this query.

func (QueryStringQuery) MarshalJSON

func (q QueryStringQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type RegexpQuery

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

RegexpQuery represents a search regular expression query.

func NewRegexpQuery

func NewRegexpQuery(regexp string) *RegexpQuery

NewRegexpQuery creates a new RegexpQuery.

func (*RegexpQuery) Boost

func (q *RegexpQuery) Boost(boost float32) *RegexpQuery

Boost specifies the boost for this query.

func (*RegexpQuery) Field

func (q *RegexpQuery) Field(field string) *RegexpQuery

Field specifies the field for this query.

func (RegexpQuery) MarshalJSON

func (q RegexpQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type SearchSortField

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

SearchSortField represents a search field sort.

func NewSearchSortField

func NewSearchSortField(field string) *SearchSortField

NewSearchSortField creates a new SearchSortField.

func (*SearchSortField) Descending

func (q *SearchSortField) Descending(descending bool) *SearchSortField

Descending specifies the ordering of the results.

func (SearchSortField) MarshalJSON

func (q SearchSortField) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

func (*SearchSortField) Missing

func (q *SearchSortField) Missing(missing string) *SearchSortField

Missing allows you to specify the search field sort missing behaviour.

func (*SearchSortField) Mode

func (q *SearchSortField) Mode(mode string) *SearchSortField

Mode allows you to specify the search field sort mode.

func (*SearchSortField) Type

func (q *SearchSortField) Type(value string) *SearchSortField

Type allows you to specify the search field sort type.

type SearchSortGeoDistance

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

SearchSortGeoDistance represents a search geo sort.

func NewSearchSortGeoDistance

func NewSearchSortGeoDistance(field string, lon, lat float64) *SearchSortGeoDistance

NewSearchSortGeoDistance creates a new SearchSortGeoDistance.

func (*SearchSortGeoDistance) Descending

func (q *SearchSortGeoDistance) Descending(descending bool) *SearchSortGeoDistance

Descending specifies the ordering of the results.

func (SearchSortGeoDistance) MarshalJSON

func (q SearchSortGeoDistance) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

func (*SearchSortGeoDistance) Unit

Unit specifies the unit used for sorting

type SearchSortID

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

SearchSortID represents a search Document ID sort.

func NewSearchSortID

func NewSearchSortID() *SearchSortID

NewSearchSortID creates a new SearchSortScore.

func (*SearchSortID) Descending

func (q *SearchSortID) Descending(descending bool) *SearchSortID

Descending specifies the ordering of the results.

func (SearchSortID) MarshalJSON

func (q SearchSortID) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type SearchSortScore

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

SearchSortScore represents a search score sort.

func NewSearchSortScore

func NewSearchSortScore() *SearchSortScore

NewSearchSortScore creates a new SearchSortScore.

func (*SearchSortScore) Descending

func (q *SearchSortScore) Descending(descending bool) *SearchSortScore

Descending specifies the ordering of the results.

func (SearchSortScore) MarshalJSON

func (q SearchSortScore) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

type Sort

type Sort interface {
}

SearchSort represents an search sorting for a search query.

type TermFacet

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

TermFacet is an search term facet.

func NewTermFacet

func NewTermFacet(field string, size uint64) *TermFacet

NewTermFacet creates a new TermFacet

func (TermFacet) MarshalJSON

func (f TermFacet) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this facet to JSON for the search REST API.

type TermQuery

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

TermQuery represents a search term query.

func NewTermQuery

func NewTermQuery(term string) *TermQuery

NewTermQuery creates a new TermQuery.

func (*TermQuery) Boost

func (q *TermQuery) Boost(boost float32) *TermQuery

Boost specifies the boost for this query.

func (*TermQuery) Field

func (q *TermQuery) Field(field string) *TermQuery

Field specifies the field for this query.

func (*TermQuery) Fuzziness

func (q *TermQuery) Fuzziness(fuzziness uint64) *TermQuery

Fuzziness specifies the fuziness for this query.

func (TermQuery) MarshalJSON

func (q TermQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

func (*TermQuery) PrefixLength

func (q *TermQuery) PrefixLength(length uint64) *TermQuery

PrefixLength specifies the prefix length from this query.

type TermRangeQuery

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

TermRangeQuery represents a search term range query.

func NewTermRangeQuery

func NewTermRangeQuery(term string) *TermRangeQuery

NewTermRangeQuery creates a new TermRangeQuery.

func (*TermRangeQuery) Boost

func (q *TermRangeQuery) Boost(boost float32) *TermRangeQuery

Boost specifies the boost for this query.

func (*TermRangeQuery) Field

func (q *TermRangeQuery) Field(field string) *TermRangeQuery

Field specifies the field for this query.

func (TermRangeQuery) MarshalJSON

func (q TermRangeQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

func (*TermRangeQuery) Max

func (q *TermRangeQuery) Max(max string, inclusive bool) *TermRangeQuery

Max specifies the maximum value and inclusiveness for this range query.

func (*TermRangeQuery) Min

func (q *TermRangeQuery) Min(min string, inclusive bool) *TermRangeQuery

Min specifies the minimum value and inclusiveness for this range query.

type WildcardQuery

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

WildcardQuery represents a search wildcard query.

func NewWildcardQuery

func NewWildcardQuery(wildcard string) *WildcardQuery

NewWildcardQuery creates a new WildcardQuery.

func (*WildcardQuery) Boost

func (q *WildcardQuery) Boost(boost float32) *WildcardQuery

Boost specifies the boost for this query.

func (*WildcardQuery) Field

func (q *WildcardQuery) Field(field string) *WildcardQuery

Field specifies the field for this query.

func (WildcardQuery) MarshalJSON

func (q WildcardQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

Jump to

Keyboard shortcuts

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