Documentation
¶
Index ¶
- type Aggregations
- type Bool
- type BoolParam
- type Boosting
- type BoostingParam
- type Bucket
- type Builder
- type Cardinality
- type CardinalityParam
- type ClauseType
- type CombinedFields
- func (c CombinedFields) WithBoost(boost float32) func(*CombinedFieldsParam)
- func (c CombinedFields) WithMinShouldMatch(minimumShouldMatch string) func(*CombinedFieldsParam)
- func (c CombinedFields) WithName(name string) func(*CombinedFieldsParam)
- func (c CombinedFields) WithOperator(operator string) func(*CombinedFieldsParam)
- func (c CombinedFields) WithZeroTermsQuery(zeroTermsQuery string) func(*CombinedFieldsParam)
- type CombinedFieldsParam
- type Common
- type CompareOperator
- type Compound
- type ConstantScore
- type ConstantScoreParam
- type Constructor
- type DateHistogram
- func (d DateHistogram) WithCalendarInterval(intervals string) func(*DateHistogramParam)
- func (d DateHistogram) WithChildAgg(agg map[string]interface{}) func(*DateHistogramParam)
- func (d DateHistogram) WithFixedInterval(intervals string) func(*DateHistogramParam)
- func (d DateHistogram) WithFormat(format string) func(*DateHistogramParam)
- func (d DateHistogram) WithMissingValue(value string) func(*DateHistogramParam)
- func (d DateHistogram) WithOffset(offset string) func(*DateHistogramParam)
- func (d DateHistogram) WithTimeZone(timeZone string) func(*DateHistogramParam)
- type DateHistogramParam
- type DisjunctionMax
- type DisjunctionMaxParam
- type Filters
- func (f Filters) WithChildAgg(agg map[string]interface{}) func(*FiltersParam)
- func (f Filters) WithFilter(name string, query map[string]interface{}) func(*FiltersParam)
- func (f Filters) WithOtherBucket(withOtherBucket bool) func(*FiltersParam)
- func (f Filters) WithOtherBucketKey(otherBucketKey string) func(*FiltersParam)
- type FiltersParam
- type Flag
- type FullText
- type Histogram
- type HistogramParam
- type IDS
- type IDSParam
- type Join
- type Match
- func (m Match) WithAnalyzer(analyzer string) func(*MatchParam)
- func (m Match) WithBoost(boost float32) func(*MatchParam)
- func (m Match) WithMinShouldMatch(minimumShouldMatch string) func(*MatchParam)
- func (m Match) WithName(name string) func(*MatchParam)
- func (m Match) WithOperator(operator string) func(*MatchParam)
- func (m Match) WithZeroTermsQuery(zeroTermsQuery string) func(*MatchParam)
- type MatchAll
- type MatchAllParam
- type MatchBoolPrefix
- func (m MatchBoolPrefix) WithAnalyzer(analyzer string) func(*MatchBoolPrefixParam)
- func (m MatchBoolPrefix) WithBoost(boost float32) func(*MatchBoolPrefixParam)
- func (m MatchBoolPrefix) WithMinShouldMatch(minimumShouldMatch string) func(*MatchBoolPrefixParam)
- func (m MatchBoolPrefix) WithName(name string) func(*MatchBoolPrefixParam)
- func (m MatchBoolPrefix) WithOperator(operator string) func(*MatchBoolPrefixParam)
- type MatchBoolPrefixParam
- type MatchParam
- type MatchPhrase
- func (m MatchPhrase) WithAnalyzer(analyzer string) func(*MatchPhraseParam)
- func (m MatchPhrase) WithBoost(boost float32) func(*MatchPhraseParam)
- func (m MatchPhrase) WithName(name string) func(*MatchPhraseParam)
- func (m MatchPhrase) WithSlop(slop int) func(*MatchPhraseParam)
- func (m MatchPhrase) WithZeroTermsQuery(zeroTermsQuery string) func(*MatchPhraseParam)
- type MatchPhraseParam
- type MatchPhrasePrefix
- func (m MatchPhrasePrefix) WithAnalyzer(analyzer string) func(*MatchPhrasePrefixParam)
- func (m MatchPhrasePrefix) WithBoost(boost float32) func(*MatchPhrasePrefixParam)
- func (m MatchPhrasePrefix) WithName(name string) func(*MatchPhrasePrefixParam)
- func (m MatchPhrasePrefix) WithSlop(slop int) func(*MatchPhrasePrefixParam)
- func (m MatchPhrasePrefix) WithZeroTermsQuery(zeroTermsQuery string) func(*MatchPhrasePrefixParam)
- type MatchPhrasePrefixParam
- type Metrics
- type MultiMatch
- func (m MultiMatch) WithAnalyzer(analyzer string) func(*MultiMatchParam)
- func (m MultiMatch) WithBoost(boost float32) func(*MultiMatchParam)
- func (m MultiMatch) WithFields(fields ...string) func(*MultiMatchParam)
- func (m MultiMatch) WithMinShouldMatch(minimumShouldMatch string) func(*MultiMatchParam)
- func (m MultiMatch) WithName(name string) func(*MultiMatchParam)
- func (m MultiMatch) WithOperator(operator string) func(*MultiMatchParam)
- func (m MultiMatch) WithTieBreaker(tieBreaker float32) func(*MultiMatchParam)
- func (m MultiMatch) WithType(matchType MultiMatchType) func(*MultiMatchParam)
- func (m MultiMatch) WithZeroTermsQuery(zeroTermsQuery string) func(*MultiMatchParam)
- type MultiMatchParam
- type MultiMatchType
- type Nested
- type NestedAgg
- type NestedAggParam
- type NestedParam
- type Pipeline
- type Range
- func (r Range) WithBoost(boost float32) func(*RangeParam)
- func (r Range) WithCompareOperate(operator CompareOperator, value interface{}) func(*RangeParam)
- func (r Range) WithDateFormat(dateFormat string) func(*RangeParam)
- func (r Range) WithName(name string) func(*RangeParam)
- func (r Range) WithRelation(relation RelationType) func(*RangeParam)
- func (r Range) WithTimeZone(timeZone string) func(*RangeParam)
- type RangeAgg
- type RangeAggParam
- type RangeParam
- type RelationType
- type ReverseNestedAgg
- type ReverseNestedAggParam
- type Script
- type SimpleQueryString
- func (s SimpleQueryString) WithAnalyzer(analyzer string) func(*SimpleQueryStringParam)
- func (s SimpleQueryString) WithAnalyzerWildcard(analyzerWildcard bool) func(*SimpleQueryStringParam)
- func (s SimpleQueryString) WithBoost(boost float32) func(*SimpleQueryStringParam)
- func (s SimpleQueryString) WithDefaultOperator(defaultOperator string) func(*SimpleQueryStringParam)
- func (s SimpleQueryString) WithFields(fields ...string) func(*SimpleQueryStringParam)
- func (s SimpleQueryString) WithFlags(flags ...Flag) func(*SimpleQueryStringParam)
- func (s SimpleQueryString) WithMinShouldMatch(minimumShouldMatch string) func(*SimpleQueryStringParam)
- func (s SimpleQueryString) WithName(name string) func(*SimpleQueryStringParam)
- type SimpleQueryStringParam
- type Sort
- type SortParam
- type Source
- type SourceParam
- type Sum
- type SumBucket
- type SumParam
- type Term
- type TermLevel
- type TermParam
- type Terms
- type TermsAgg
- type TermsAggParam
- type TermsParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregations ¶ added in v0.0.4
type Bool ¶
func (Bool) WithClause ¶
func (b Bool) WithClause(clauseType ClauseType, queries ...map[string]interface{}) func(*BoolParam)
func (Bool) WithMinShouldMatch ¶
type Boosting ¶
type Boosting func(positive, negative map[string]interface{}, negativeBoost float32, o ...func(*BoostingParam)) map[string]interface{}
func (Boosting) WithBoost ¶
func (b Boosting) WithBoost(boost float32) func(*BoostingParam)
default 1.0
func (Boosting) WithName ¶
func (b Boosting) WithName(name string) func(*BoostingParam)
type BoostingParam ¶
type BoostingParam struct {
// contains filtered or unexported fields
}
func (*BoostingParam) Build ¶
func (b *BoostingParam) Build() map[string]interface{}
type Bucket ¶ added in v0.0.4
type Bucket struct {
DateHistogram DateHistogram
TermsAgg TermsAgg
Filters Filters
NestedAgg NestedAgg
ReverseNestedAgg ReverseNestedAgg
Histogram Histogram
RangeAgg RangeAgg
}
type Cardinality ¶ added in v0.0.4
type Cardinality func(field string, o ...func(*CardinalityParam)) map[string]interface{}
func (Cardinality) WithMissingValue ¶ added in v0.0.4
func (c Cardinality) WithMissingValue(value interface{}) func(*CardinalityParam)
func (Cardinality) WithPrecisionThreshold ¶ added in v0.0.4
func (c Cardinality) WithPrecisionThreshold(value int) func(*CardinalityParam)
type CardinalityParam ¶ added in v0.0.4
type CardinalityParam struct {
// contains filtered or unexported fields
}
func (CardinalityParam) Build ¶ added in v0.0.4
func (c CardinalityParam) Build() map[string]interface{}
type ClauseType ¶
type ClauseType string
const ( ClauseTypeMust ClauseType = "must" ClauseTypeMustNot ClauseType = "must_not" ClauseTypeShould ClauseType = "should" ClauseTypeFilter ClauseType = "filter" )
type CombinedFields ¶
type CombinedFields func(fields []string, text string, o ...func(*CombinedFieldsParam)) map[string]interface{}
func (CombinedFields) WithBoost ¶
func (c CombinedFields) WithBoost(boost float32) func(*CombinedFieldsParam)
default 1.0
func (CombinedFields) WithMinShouldMatch ¶
func (c CombinedFields) WithMinShouldMatch(minimumShouldMatch string) func(*CombinedFieldsParam)
func (CombinedFields) WithName ¶
func (c CombinedFields) WithName(name string) func(*CombinedFieldsParam)
func (CombinedFields) WithOperator ¶
func (c CombinedFields) WithOperator(operator string) func(*CombinedFieldsParam)
default OR
func (CombinedFields) WithZeroTermsQuery ¶
func (c CombinedFields) WithZeroTermsQuery(zeroTermsQuery string) func(*CombinedFieldsParam)
default none
type CombinedFieldsParam ¶
type CombinedFieldsParam struct {
// contains filtered or unexported fields
}
func (*CombinedFieldsParam) Build ¶
func (c *CombinedFieldsParam) Build() map[string]interface{}
type CompareOperator ¶
type CompareOperator string
const ( CompareOperatorGT CompareOperator = "gt" CompareOperatorGTE CompareOperator = "gte" CompareOperatorLT CompareOperator = "lt" CompareOperatorLTE CompareOperator = "lte" )
type Compound ¶
type Compound struct {
Bool Bool
Boosting Boosting
ConstantScore ConstantScore
DisjunctionMax DisjunctionMax
}
type ConstantScore ¶
type ConstantScore func(filter map[string]interface{}, o ...func(*ConstantScoreParam)) map[string]interface{}
func (ConstantScore) WithBoost ¶
func (c ConstantScore) WithBoost(boost float32) func(*ConstantScoreParam)
default 1.0
func (ConstantScore) WithName ¶
func (c ConstantScore) WithName(name string) func(*ConstantScoreParam)
type ConstantScoreParam ¶
type ConstantScoreParam struct {
// contains filtered or unexported fields
}
func (*ConstantScoreParam) Build ¶
func (c *ConstantScoreParam) Build() map[string]interface{}
type Constructor ¶
type Constructor struct {
Compound *Compound
TermLevel *TermLevel
FullText *FullText
Join *Join
Common *Common
Aggs *Aggregations
}
func New ¶
func New() *Constructor
type DateHistogram ¶ added in v0.0.4
type DateHistogram func(field string, interval func(*DateHistogramParam), o ...func(*DateHistogramParam)) map[string]interface{}
func (DateHistogram) WithCalendarInterval ¶ added in v0.0.4
func (d DateHistogram) WithCalendarInterval(intervals string) func(*DateHistogramParam)
func (DateHistogram) WithChildAgg ¶ added in v0.0.4
func (d DateHistogram) WithChildAgg(agg map[string]interface{}) func(*DateHistogramParam)
func (DateHistogram) WithFixedInterval ¶ added in v0.0.4
func (d DateHistogram) WithFixedInterval(intervals string) func(*DateHistogramParam)
func (DateHistogram) WithFormat ¶ added in v0.0.4
func (d DateHistogram) WithFormat(format string) func(*DateHistogramParam)
8.4.3无效
func (DateHistogram) WithMissingValue ¶ added in v0.0.4
func (d DateHistogram) WithMissingValue(value string) func(*DateHistogramParam)
func (DateHistogram) WithOffset ¶ added in v0.0.4
func (d DateHistogram) WithOffset(offset string) func(*DateHistogramParam)
func (DateHistogram) WithTimeZone ¶ added in v0.0.4
func (d DateHistogram) WithTimeZone(timeZone string) func(*DateHistogramParam)
type DateHistogramParam ¶ added in v0.0.4
type DateHistogramParam struct {
// contains filtered or unexported fields
}
func (*DateHistogramParam) Build ¶ added in v0.0.4
func (d *DateHistogramParam) Build() map[string]interface{}
type DisjunctionMax ¶
type DisjunctionMax func(queries []map[string]interface{}, o ...func(*DisjunctionMaxParam)) map[string]interface{}
func (DisjunctionMax) WithBoost ¶
func (d DisjunctionMax) WithBoost(boost float32) func(*DisjunctionMaxParam)
default 1.0
func (DisjunctionMax) WithName ¶
func (d DisjunctionMax) WithName(name string) func(*DisjunctionMaxParam)
func (DisjunctionMax) WithTieBreaker ¶
func (d DisjunctionMax) WithTieBreaker(tieBreaker float32) func(*DisjunctionMaxParam)
default 0
type DisjunctionMaxParam ¶
type DisjunctionMaxParam struct {
// contains filtered or unexported fields
}
func (*DisjunctionMaxParam) Build ¶
func (d *DisjunctionMaxParam) Build() map[string]interface{}
type Filters ¶ added in v0.0.4
type Filters func(filter func(*FiltersParam), o ...func(*FiltersParam)) map[string]interface{}
func (Filters) WithChildAgg ¶ added in v0.0.4
func (f Filters) WithChildAgg(agg map[string]interface{}) func(*FiltersParam)
func (Filters) WithFilter ¶ added in v0.0.4
func (f Filters) WithFilter(name string, query map[string]interface{}) func(*FiltersParam)
func (Filters) WithOtherBucket ¶ added in v0.0.4
func (f Filters) WithOtherBucket(withOtherBucket bool) func(*FiltersParam)
func (Filters) WithOtherBucketKey ¶ added in v0.0.4
func (f Filters) WithOtherBucketKey(otherBucketKey string) func(*FiltersParam)
type FiltersParam ¶ added in v0.0.4
type FiltersParam struct {
// contains filtered or unexported fields
}
func (FiltersParam) Build ¶ added in v0.0.4
func (f FiltersParam) Build() map[string]interface{}
type Flag ¶
type Flag string
const ( //Enables the + AND operator. And Flag = "AND" //Enables \ as an escape character. Escape Flag = "ESCAPE" //Enables the ~N operator after a word, where N is an integer denoting the allowed edit distance for matching. See Fuzziness. Fuzzy Flag = "FUZZY" //Enables the ~N operator, after a phrase where N is the maximum number of positions allowed between matching tokens. Synonymous to SLOP. Near Flag = "NEAR" //Disables all operators. None Flag = "NONE" //Enables the - NOT operator. Not Flag = "NOT" //Enables the \| OR operator. Or Flag = "OR" //Enables the " quotes operator used to search for phrases. Phrase Flag = "PHRASE" //Enables the ( and ) operators to control operator precedence. Precedence Flag = "PRECEDENCE" //Enables the * prefix operator. Prefix Flag = "PREFIX" //Enables the ~N operator, after a phrase where N is maximum number of positions allowed between matching tokens. Synonymous to NEAR. Slop Flag = "SLOP" //Enables whitespace as split characters. Whitespace Flag = "WHITESPACE" )
type FullText ¶
type FullText struct {
Match Match
MatchAll MatchAll
MatchBoolPrefix MatchBoolPrefix
MatchPhrase MatchPhrase
MatchPhrasePrefix MatchPhrasePrefix
CombinedFields CombinedFields
MultiMatch MultiMatch
SimpleQueryString SimpleQueryString
}
type Histogram ¶ added in v0.0.5
type Histogram func(field string, interval interface{}, o ...func(param *HistogramParam)) map[string]interface{}
func (Histogram) WithMinDocCount ¶ added in v0.0.5
func (h Histogram) WithMinDocCount(count int) func(param *HistogramParam)
func (Histogram) WithMissingValue ¶ added in v0.0.5
func (h Histogram) WithMissingValue(value interface{}) func(*DateHistogramParam)
func (Histogram) WithOffset ¶ added in v0.0.5
func (h Histogram) WithOffset(offset interface{}) func(param *HistogramParam)
type HistogramParam ¶ added in v0.0.5
type HistogramParam struct {
// contains filtered or unexported fields
}
func (*HistogramParam) Build ¶ added in v0.0.5
func (h *HistogramParam) Build() map[string]interface{}
type Match ¶
type Match func(field, text string, o ...func(*MatchParam)) map[string]interface{}
func (Match) WithAnalyzer ¶
func (m Match) WithAnalyzer(analyzer string) func(*MatchParam)
default analysis.analyzer.default or standard analyzer
func (Match) WithMinShouldMatch ¶
func (m Match) WithMinShouldMatch(minimumShouldMatch string) func(*MatchParam)
func (Match) WithName ¶
func (m Match) WithName(name string) func(*MatchParam)
func (Match) WithOperator ¶
func (m Match) WithOperator(operator string) func(*MatchParam)
default OR
func (Match) WithZeroTermsQuery ¶
func (m Match) WithZeroTermsQuery(zeroTermsQuery string) func(*MatchParam)
default none
type MatchAll ¶
type MatchAll func(o ...func(*MatchAllParam)) map[string]interface{}
func (MatchAll) WithBoost ¶
func (m MatchAll) WithBoost(boost float32) func(*MatchAllParam)
default 1.0
func (MatchAll) WithName ¶
func (m MatchAll) WithName(name string) func(*MatchAllParam)
type MatchAllParam ¶
type MatchAllParam struct {
// contains filtered or unexported fields
}
func (*MatchAllParam) Build ¶
func (m *MatchAllParam) Build() map[string]interface{}
type MatchBoolPrefix ¶
type MatchBoolPrefix func(field, text string, o ...func(*MatchBoolPrefixParam)) map[string]interface{}
func (MatchBoolPrefix) WithAnalyzer ¶
func (m MatchBoolPrefix) WithAnalyzer(analyzer string) func(*MatchBoolPrefixParam)
default analysis.analyzer.default or standard analyzer
func (MatchBoolPrefix) WithBoost ¶
func (m MatchBoolPrefix) WithBoost(boost float32) func(*MatchBoolPrefixParam)
default 1.0
func (MatchBoolPrefix) WithMinShouldMatch ¶
func (m MatchBoolPrefix) WithMinShouldMatch(minimumShouldMatch string) func(*MatchBoolPrefixParam)
func (MatchBoolPrefix) WithName ¶
func (m MatchBoolPrefix) WithName(name string) func(*MatchBoolPrefixParam)
func (MatchBoolPrefix) WithOperator ¶
func (m MatchBoolPrefix) WithOperator(operator string) func(*MatchBoolPrefixParam)
default OR
type MatchBoolPrefixParam ¶
type MatchBoolPrefixParam struct {
// contains filtered or unexported fields
}
func (*MatchBoolPrefixParam) Build ¶
func (m *MatchBoolPrefixParam) Build() map[string]interface{}
type MatchParam ¶
type MatchParam struct {
// contains filtered or unexported fields
}
func (m Match) WithOperator(operator string)func(*MatchParam){
return func(p *MatchParam) {
}
}
func (*MatchParam) Build ¶
func (m *MatchParam) Build() map[string]interface{}
{
"match":{
<field>:{
"query":<text>,
...
}
}
}
or
{
"match":{
<field>:<text>,
}
}
type MatchPhrase ¶
type MatchPhrase func(field, text string, o ...func(*MatchPhraseParam)) map[string]interface{}
func (MatchPhrase) WithAnalyzer ¶
func (m MatchPhrase) WithAnalyzer(analyzer string) func(*MatchPhraseParam)
default analysis.analyzer.default or standard analyzer
func (MatchPhrase) WithBoost ¶
func (m MatchPhrase) WithBoost(boost float32) func(*MatchPhraseParam)
default 1.0
func (MatchPhrase) WithName ¶
func (m MatchPhrase) WithName(name string) func(*MatchPhraseParam)
func (MatchPhrase) WithSlop ¶
func (m MatchPhrase) WithSlop(slop int) func(*MatchPhraseParam)
default 0
func (MatchPhrase) WithZeroTermsQuery ¶
func (m MatchPhrase) WithZeroTermsQuery(zeroTermsQuery string) func(*MatchPhraseParam)
default none
type MatchPhraseParam ¶
type MatchPhraseParam struct {
// contains filtered or unexported fields
}
func (*MatchPhraseParam) Build ¶
func (m *MatchPhraseParam) Build() map[string]interface{}
{
"match_phrase":{
<field>:{
"query":<text>,
...
}
}
}
or
{
"match_phrase":{
<field>:<text>,
}
}
type MatchPhrasePrefix ¶
type MatchPhrasePrefix func(field, text string, o ...func(*MatchPhrasePrefixParam)) map[string]interface{}
func (MatchPhrasePrefix) WithAnalyzer ¶
func (m MatchPhrasePrefix) WithAnalyzer(analyzer string) func(*MatchPhrasePrefixParam)
default analysis.analyzer.default or standard analyzer
func (MatchPhrasePrefix) WithBoost ¶
func (m MatchPhrasePrefix) WithBoost(boost float32) func(*MatchPhrasePrefixParam)
default 1.0
func (MatchPhrasePrefix) WithName ¶
func (m MatchPhrasePrefix) WithName(name string) func(*MatchPhrasePrefixParam)
func (MatchPhrasePrefix) WithSlop ¶
func (m MatchPhrasePrefix) WithSlop(slop int) func(*MatchPhrasePrefixParam)
default 0
func (MatchPhrasePrefix) WithZeroTermsQuery ¶
func (m MatchPhrasePrefix) WithZeroTermsQuery(zeroTermsQuery string) func(*MatchPhrasePrefixParam)
default none
type MatchPhrasePrefixParam ¶
type MatchPhrasePrefixParam struct {
// contains filtered or unexported fields
}
func (*MatchPhrasePrefixParam) Build ¶
func (m *MatchPhrasePrefixParam) Build() map[string]interface{}
type Metrics ¶ added in v0.0.4
type Metrics struct {
Sum Sum
Cardinality Cardinality
}
type MultiMatch ¶
type MultiMatch func(text string, o ...func(*MultiMatchParam)) map[string]interface{}
func (MultiMatch) WithAnalyzer ¶
func (m MultiMatch) WithAnalyzer(analyzer string) func(*MultiMatchParam)
default analysis.analyzer.default or standard analyzer
func (MultiMatch) WithBoost ¶
func (m MultiMatch) WithBoost(boost float32) func(*MultiMatchParam)
default 1.0
func (MultiMatch) WithFields ¶
func (m MultiMatch) WithFields(fields ...string) func(*MultiMatchParam)
default index.query.default_field or *.*
func (MultiMatch) WithMinShouldMatch ¶
func (m MultiMatch) WithMinShouldMatch(minimumShouldMatch string) func(*MultiMatchParam)
func (MultiMatch) WithName ¶
func (m MultiMatch) WithName(name string) func(*MultiMatchParam)
func (MultiMatch) WithOperator ¶
func (m MultiMatch) WithOperator(operator string) func(*MultiMatchParam)
default OR
func (MultiMatch) WithTieBreaker ¶
func (m MultiMatch) WithTieBreaker(tieBreaker float32) func(*MultiMatchParam)
default 0
func (MultiMatch) WithType ¶
func (m MultiMatch) WithType(matchType MultiMatchType) func(*MultiMatchParam)
default best_fields
func (MultiMatch) WithZeroTermsQuery ¶
func (m MultiMatch) WithZeroTermsQuery(zeroTermsQuery string) func(*MultiMatchParam)
default none
type MultiMatchParam ¶
type MultiMatchParam struct {
// contains filtered or unexported fields
}
func (*MultiMatchParam) Build ¶
func (m *MultiMatchParam) Build() map[string]interface{}
{
"multi_match" : {
"query": <text>,
"fields":<fields>
...
}
}
type MultiMatchType ¶
type MultiMatchType string
const ( //Finds documents which match any field, but uses the _score from the best field. MultiMatchTypeBestFields MultiMatchType = "best_fields" //Finds documents which match any field and combines the _score from each field MultiMatchTypeMostFields MultiMatchType = "most_fields" //Treats fields with the same analyzer as though they were one big field. Looks for each word in any field MultiMatchTypeCrossFields MultiMatchType = "cross_fields" //Runs a match_phrase query on each field and uses the _score from the best field. MultiMatchTypePhrase MultiMatchType = "phrase" //Runs a match_phrase_prefix query on each field and uses the _score from the best field MultiMatchTypePhrasePrefix MultiMatchType = "phrase_prefix" //Creates a match_bool_prefix query on each field and combines the _score from each field. MultiMatchTypeBoolPrefix MultiMatchType = "bool_prefix" )
type Nested ¶
type Nested func(path string, query map[string]interface{}, o ...func(param *NestedParam)) map[string]interface{}
func (Nested) WithName ¶
func (n Nested) WithName(name string) func(*NestedParam)
func (Nested) WithReturn ¶
func (n Nested) WithReturn(whetherReturn bool) func(*NestedParam)
func (Nested) WithSource ¶
func (n Nested) WithSource(source map[string]interface{}) func(*NestedParam)
type NestedAgg ¶ added in v0.0.4
type NestedAgg func(path string, o ...func(*NestedAggParam)) map[string]interface{}
func (NestedAgg) WithChildAgg ¶ added in v0.0.4
func (n NestedAgg) WithChildAgg(agg map[string]interface{}) func(*NestedAggParam)
type NestedAggParam ¶ added in v0.0.4
type NestedAggParam struct {
// contains filtered or unexported fields
}
func (*NestedAggParam) Build ¶ added in v0.0.4
func (n *NestedAggParam) Build() map[string]interface{}
type NestedParam ¶
type NestedParam struct {
// contains filtered or unexported fields
}
func (*NestedParam) Build ¶
func (n *NestedParam) Build() map[string]interface{}
type Range ¶
type Range func(field string, o ...func(*RangeParam)) map[string]interface{}
func (Range) WithCompareOperate ¶
func (r Range) WithCompareOperate(operator CompareOperator, value interface{}) func(*RangeParam)
func (Range) WithDateFormat ¶
func (r Range) WithDateFormat(dateFormat string) func(*RangeParam)
func (Range) WithName ¶
func (r Range) WithName(name string) func(*RangeParam)
func (Range) WithRelation ¶
func (r Range) WithRelation(relation RelationType) func(*RangeParam)
default Intersects
func (Range) WithTimeZone ¶
func (r Range) WithTimeZone(timeZone string) func(*RangeParam)
type RangeAgg ¶ added in v0.0.5
type RangeAgg func(field string, dataRange func(*RangeAggParam), o ...func(*RangeAggParam)) map[string]interface{}
func (RangeAgg) WithChildAgg ¶ added in v0.0.5
func (r RangeAgg) WithChildAgg(agg map[string]interface{}) func(*RangeAggParam)
func (RangeAgg) WithKeyed ¶ added in v0.0.5
func (r RangeAgg) WithKeyed() func(param *RangeAggParam)
func (RangeAgg) WithRange ¶ added in v0.0.5
func (r RangeAgg) WithRange(key string, from, to interface{}) func(param *RangeAggParam)
type RangeAggParam ¶ added in v0.0.5
type RangeAggParam struct {
// contains filtered or unexported fields
}
func (RangeAggParam) Build ¶ added in v0.0.5
func (r RangeAggParam) Build() map[string]interface{}
type RangeParam ¶
type RangeParam struct {
// contains filtered or unexported fields
}
func (*RangeParam) Build ¶
func (r *RangeParam) Build() map[string]interface{}
type RelationType ¶
type RelationType string
const ( //Matches documents with a range field value that intersects the query’s range. Intersects RelationType = "INTERSECTS" //Matches documents with a range field value that entirely contains the query’s range. Contains RelationType = "CONTAINS" //Matches documents with a range field value entirely within the query’s range. Within RelationType = "WITHIN" )
type ReverseNestedAgg ¶ added in v0.0.4
type ReverseNestedAgg func(o ...func(*ReverseNestedAggParam)) map[string]interface{}
func (ReverseNestedAgg) WithChildAgg ¶ added in v0.0.4
func (r ReverseNestedAgg) WithChildAgg(agg map[string]interface{}) func(*ReverseNestedAggParam)
func (ReverseNestedAgg) WithPath ¶ added in v0.0.4
func (r ReverseNestedAgg) WithPath(path string) func(*ReverseNestedAggParam)
type ReverseNestedAggParam ¶ added in v0.0.4
type ReverseNestedAggParam struct {
// contains filtered or unexported fields
}
func (*ReverseNestedAggParam) Build ¶ added in v0.0.4
func (r *ReverseNestedAggParam) Build() map[string]interface{}
type SimpleQueryString ¶
type SimpleQueryString func(text string, o ...func(*SimpleQueryStringParam)) map[string]interface{}
func (SimpleQueryString) WithAnalyzer ¶
func (s SimpleQueryString) WithAnalyzer(analyzer string) func(*SimpleQueryStringParam)
default analysis.analyzer.default or standard analyzer
func (SimpleQueryString) WithAnalyzerWildcard ¶
func (s SimpleQueryString) WithAnalyzerWildcard(analyzerWildcard bool) func(*SimpleQueryStringParam)
default false
func (SimpleQueryString) WithBoost ¶
func (s SimpleQueryString) WithBoost(boost float32) func(*SimpleQueryStringParam)
default 1.0
func (SimpleQueryString) WithDefaultOperator ¶
func (s SimpleQueryString) WithDefaultOperator(defaultOperator string) func(*SimpleQueryStringParam)
default OR
func (SimpleQueryString) WithFields ¶
func (s SimpleQueryString) WithFields(fields ...string) func(*SimpleQueryStringParam)
default index.query.default_field or *
func (SimpleQueryString) WithFlags ¶
func (s SimpleQueryString) WithFlags(flags ...Flag) func(*SimpleQueryStringParam)
default All
func (SimpleQueryString) WithMinShouldMatch ¶
func (s SimpleQueryString) WithMinShouldMatch(minimumShouldMatch string) func(*SimpleQueryStringParam)
func (SimpleQueryString) WithName ¶
func (s SimpleQueryString) WithName(name string) func(*SimpleQueryStringParam)
type SimpleQueryStringParam ¶
type SimpleQueryStringParam struct {
// contains filtered or unexported fields
}
func (*SimpleQueryStringParam) Build ¶
func (s *SimpleQueryStringParam) Build() map[string]interface{}
type Source ¶
type Source func(o ...func(*SourceParam)) map[string]interface{}
func (Source) WithExcludes ¶
func (s Source) WithExcludes(fields ...string) func(*SourceParam)
func (Source) WithIncludes ¶
func (s Source) WithIncludes(fields ...string) func(*SourceParam)
type SourceParam ¶
type SourceParam struct {
// contains filtered or unexported fields
}
func (*SourceParam) Build ¶
func (s *SourceParam) Build() map[string]interface{}
type Sum ¶ added in v0.0.4
func (Sum) WithMissingValue ¶ added in v0.0.4
不做合法性校验
type Term ¶
{
"term":{
<field>:<value>
}
}
or
{
"term":{
<field>:{
"value":<value>,
"boost":<boost>,
"case_insensitive":<caseInsensitive>
}
}
}
func (Term) WithCaseInsensitive ¶
default false
type Terms ¶
type Terms func(field string, o ...func(*TermsParam)) map[string]interface{}
{
"terms":{
<field>:[<value>...],
"boost":<boost>,
}
}
or
{
"terms":{
<field>:{
"index":<index>,
"id":<id>,
"path":<path>,
"routing":<routing>
},
"boost":<boost>
}
}
func (Terms) WithLookUp ¶
func (t Terms) WithLookUp(index, id, path, routing string) func(*TermsParam)
func (Terms) WithName ¶
func (t Terms) WithName(name string) func(*TermsParam)
func (Terms) WithValue ¶
func (t Terms) WithValue(value ...interface{}) func(*TermsParam)
type TermsAgg ¶ added in v0.0.4
type TermsAgg func(field string, o ...func(*TermsAggParam)) map[string]interface{}
func (TermsAgg) WithChildAgg ¶ added in v0.0.4
func (t TermsAgg) WithChildAgg(agg map[string]interface{}) func(*TermsAggParam)
func (TermsAgg) WithSize ¶ added in v0.0.4
func (t TermsAgg) WithSize(size int) func(param *TermsAggParam)
type TermsAggParam ¶ added in v0.0.4
type TermsAggParam struct {
// contains filtered or unexported fields
}
func (TermsAggParam) Build ¶ added in v0.0.4
func (t TermsAggParam) Build() map[string]interface{}
type TermsParam ¶
type TermsParam struct {
// contains filtered or unexported fields
}
func (*TermsParam) Build ¶
func (t *TermsParam) Build() map[string]interface{}
Source Files
¶
- constructor._.go
- constructor.aggs_bucket_datehistogram.go
- constructor.aggs_bucket_filters.go
- constructor.aggs_bucket_histogram.go
- constructor.aggs_bucket_nested.go
- constructor.aggs_bucket_range.go
- constructor.aggs_bucket_reverse_nested.go
- constructor.aggs_bucket_terms.go
- constructor.aggs_metrics_cardinality.go
- constructor.aggs_metrics_sum.go
- constructor.aggs_pipeline_script.go
- constructor.aggs_pipeline_sum_bucket.go
- constructor.common_sort.go
- constructor.common_source.go
- constructor.compound_bool.go
- constructor.compound_boosting.go
- constructor.compound_constant_score.go
- constructor.compound_disjunction_max.go
- constructor.compound_function_score.go
- constructor.fulltext_combined_fields.go
- constructor.fulltext_match.go
- constructor.fulltext_match_bool_prefix.go
- constructor.fulltext_match_phrase.go
- constructor.fulltext_match_phrase_prefix.go
- constructor.fulltext_matchall.go
- constructor.fulltext_multi_match.go
- constructor.fulltext_query_string.go
- constructor.fulltext_simple_query_string.go
- constructor.join_nested.go
- constructor.term_level_ids.go
- constructor.term_level_range.go
- constructor.term_level_term.go
- constructor.term_level_terms.go
- query.go