Documentation ¶
Index ¶
- type Aggregations
- type Bool
- func (b *Bool) AppendFilter(item Item) *Bool
- func (b *Bool) AppendMultiFilter(items []Item) *Bool
- func (b *Bool) AppendMultiMustNot(items []Item) *Bool
- func (b *Bool) AppendMultiShould(items []Item) *Bool
- func (b *Bool) AppendMustNot(item Item) *Bool
- func (b *Bool) AppendShould(item Item) *Bool
- func (b *Bool) IsValid() bool
- func (b *Bool) WithMinimumShouldMatch(min int32) *Bool
- type Builder
- type Cardinality
- type CardinalityAggregation
- type DateHistogram
- type DateHistogramAggregation
- type Exists
- type Item
- type MatchPhrase
- type MatchPhrasePrefix
- type Parameter
- type Query
- type Range
- type Regexp
- type Terms
- type Wildcard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregations ¶
type Aggregations struct { *CardinalityAggregation `json:"cardinality_aggregation,omitempty"` *DateHistogramAggregation `json:"date_histogram_aggregation,omitempty"` }
func NewAggregations ¶
func NewAggregations() *Aggregations
func (*Aggregations) WithCardinalityAggregation ¶
func (a *Aggregations) WithCardinalityAggregation(field string) *Aggregations
func (*Aggregations) WithDateHistogramAggregation ¶
func (a *Aggregations) WithDateHistogramAggregation(field string, interval string) *Aggregations
type Bool ¶
type Bool struct {
*Parameter `json:"bool,omitempty"`
}
Example: {bool: {filter: <[]Match>}} {bool: {should: <[]Match>, minimum_should_match: 1}}
func (*Bool) AppendFilter ¶
func (*Bool) AppendMultiFilter ¶
func (*Bool) AppendMultiMustNot ¶
func (*Bool) AppendMultiShould ¶
func (*Bool) AppendMustNot ¶
func (*Bool) AppendShould ¶
func (*Bool) WithMinimumShouldMatch ¶
type Builder ¶
type Builder struct { From int64 `json:"from,omitempty"` Size int64 `json:"size,omitempty"` Sorts []map[string]string `json:"sort,omitempty"` *Query `json:",inline"` *Aggregations `json:"aggs,omitempty"` }
TODO: elastic/go-elasticsearch is working on Query DSL support.
See https://github.com/elastic/go-elasticsearch/issues/42. We need refactor our query body builder when that is ready.
func NewBuilder ¶
func NewBuilder() *Builder
func (*Builder) WithAggregations ¶
func (b *Builder) WithAggregations(aggs *Aggregations) *Builder
type Cardinality ¶
type Cardinality struct {
Field string `json:"field,omitempty"`
}
type CardinalityAggregation ¶
type CardinalityAggregation struct {
*Cardinality `json:"cardinality,omitempty"`
}
type DateHistogram ¶
type DateHistogramAggregation ¶
type DateHistogramAggregation struct {
*DateHistogram `json:"date_histogram,omitempty"`
}
type Item ¶
type Item interface {
IsValid() bool
}
func NewMultiMatchPhrase ¶
func NewMultiWildcard ¶
type MatchPhrase ¶
func NewMatchPhrase ¶
func NewMatchPhrase(key, val string) *MatchPhrase
func (*MatchPhrase) IsValid ¶
func (m *MatchPhrase) IsValid() bool
type MatchPhrasePrefix ¶
type MatchPhrasePrefix struct {
MatchPhrasePrefix map[string]string `json:"match_phrase_prefix,omitempty"`
}
func NewMatchPhrasePrefix ¶
func NewMatchPhrasePrefix(key, val string) *MatchPhrasePrefix
func (*MatchPhrasePrefix) IsValid ¶
func (m *MatchPhrasePrefix) IsValid() bool
type Parameter ¶
type Parameter struct { Filter []interface{} `json:"filter,omitempty"` Should []interface{} `json:"should,omitempty"` MustNot []interface{} `json:"must_not,omitempty"` MinimumShouldMatch int32 `json:"minimum_should_match,omitempty"` }
Click to show internal directories.
Click to hide internal directories.