Documentation
¶
Index ¶
- Constants
- Variables
- func GUI(c *gin.Context)
- func GetHealthz(c *gin.Context)
- func GetVersion(c *gin.Context)
- type AggregationAutoDateHistogram
- type AggregationDateHistogram
- type AggregationDateRange
- type AggregationHistogram
- type AggregationIPRange
- type AggregationMetric
- type AggregationRange
- type AggregationResponse
- type Aggregations
- type AggregationsTerms
- type Analyzer
- type BoolQuery
- type BoolQueryForSDK
- type BoostingQuery
- type CombinedFieldsQuery
- type DateRange
- type ExistsQuery
- type Field
- type FuzzyQuery
- type HTTPResponse
- type HTTPResponseDeleteByQuery
- type HTTPResponseDocument
- type HTTPResponseESID
- type HTTPResponseError
- type HTTPResponseID
- type HTTPResponseIndex
- type HTTPResponseRecordCount
- type HTTPResponseTemplate
- type HealthzResponse
- type Highlight
- type Hit
- type Hits
- type HttpRetriesResponse
- type IPRange
- type IdsQuery
- type Index
- type IndexAnalysis
- type IndexSecondShard
- type IndexSettings
- type IndexShard
- type IndexShardV026
- type IndexSimple
- type IndexStat
- type IndexTemplate
- type IndexV026
- type JSONIngest
- type Mappings
- type MatchAllQuery
- type MatchBoolPrefixQuery
- type MatchNoneQuery
- type MatchPhrasePrefixQuery
- type MatchPhraseQuery
- type MatchQuery
- type MultiMatchQuery
- type Page
- type PrefixQuery
- type Property
- type Query
- type QueryForSDK
- type QueryStringQuery
- type Range
- type RangeQuery
- type RangeQueryForSDK
- type RegexpQuery
- type Role
- type SearchResponse
- type Shards
- type SimpleQueryStringQuery
- type Source
- type Template
- type TemplateTemplate
- type TermQuery
- type TermQueryForSDK
- type TermsQuery
- type TermsSetQuery
- type TokenFilter
- type Tokenizer
- type Total
- type User
- type VersionResponse
- type WildcardQuery
- type ZincQuery
- type ZincQueryForSDK
Constants ¶
const ( TimeFieldName = "@timestamp" IDFieldName = "@_id" ActionFieldName = "@_action" ShardFieldName = "@_shard" SourceFieldName = "@_source" )
Default field name
const ( ActionTypeInsert = "insert" ActionTypeUpdate = "update" ActionTypeDelete = "delete" )
Variables ¶
var ( // Version is the version of the program - Git tag - git describe --tags --always Version = "v0.0.0" // Build is the build number of the program as generated by the CI system Build = "0" // CommitHash is the commit hash of the program - git rev-parse HEAD CommitHash = "0" // Branch is the branch of the program Branch = "0" // Date is the date of the build - date -u '+%Y-%m-%d_%I:%M:%S%p-GMT' BuildDate = "0" )
go build -a -ldflags "-X github.com/riverisagame/zincsearchplusplus/pkg/meta.Version=$VERSION" -o zincsearch
var SEGMENT_CLIENT analytics.Client
Functions ¶
func GetHealthz ¶
GetHealthz function gets all events
@Id Healthz @Summary Get healthz @Produce json @Success 200 {object} HealthzResponse @Router /healthz [get]
func GetVersion ¶
GetVersion returns the version of the program
@Id Version @Summary Get version @Produce json @Success 200 {object} VersionResponse @Router /version [get]
Types ¶
type AggregationAutoDateHistogram ¶
type AggregationAutoDateHistogram struct {
Field string `json:"field"`
Buckets int `json:"buckets"`
MinimumInterval string `json:"minimum_interval"` // minute,hour,day,week,month,quarter,year
Format string `json:"format"` // format key_as_string
TimeZone string `json:"time_zone"` // time_zone
Keyed bool `json:"keyed"`
}
type AggregationDateHistogram ¶
type AggregationDateHistogram struct {
Field string `json:"field"`
Size int `json:"size"`
Interval string `json:"interval"` // ms,s,m,h,d
FixedInterval string `json:"fixed_interval"` // ms,s,m,h,d
CalendarInterval string `json:"calendar_interval"` // minute,hour,day,week,month,quarter,year
Format string `json:"format"` // format key_as_string
TimeZone string `json:"time_zone"` // time_zone
MinDocCount int `json:"min_doc_count"`
Keyed bool `json:"keyed"`
ExtendedBounds *aggregation.HistogramBound `json:"extended_bounds"`
HardBounds *aggregation.HistogramBound `json:"hard_bounds"`
}
type AggregationDateRange ¶
type AggregationDateRange struct {
Field string `json:"field"`
Format string `json:"format"` // format the `to` and `from` values to `_as_string`, and used to format `keyed response`
TimeZone string `json:"time_zone"` // refer
Ranges []DateRange `json:"ranges"` // refer
Keyed bool `json:"keyed"`
}
AggregationDateRange struct DateFormat/Pattern refer to: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-daterange-aggregation.html#date-format-pattern
type AggregationHistogram ¶
type AggregationHistogram struct {
Field string `json:"field"`
Size int `json:"size"`
Interval float64 `json:"interval"`
Offset float64 `json:"offset"`
MinDocCount int `json:"min_doc_count"`
Keyed bool `json:"keyed"`
ExtendedBounds *aggregation.HistogramBound `json:"extended_bounds"`
HardBounds *aggregation.HistogramBound `json:"hard_bounds"`
}
type AggregationIPRange ¶
type AggregationMetric ¶
type AggregationRange ¶
type AggregationResponse ¶
type AggregationResponse struct {
Value interface{} `json:"value,omitempty"`
Buckets interface{} `json:"buckets,omitempty"` // slice or map
Interval string `json:"interval,omitempty"` // support for auto_date_histogram_aggregation
}
type Aggregations ¶
type Aggregations struct {
Avg *AggregationMetric `json:"avg"`
WeightedAvg *AggregationMetric `json:"weighted_avg"`
Max *AggregationMetric `json:"max"`
Min *AggregationMetric `json:"min"`
Sum *AggregationMetric `json:"sum"`
Count *AggregationMetric `json:"count"`
Cardinality *AggregationMetric `json:"cardinality"`
Terms *AggregationsTerms `json:"terms"`
Range *AggregationRange `json:"range"`
DateRange *AggregationDateRange `json:"date_range"`
Histogram *AggregationHistogram `json:"histogram"`
DateHistogram *AggregationDateHistogram `json:"date_histogram"`
AutoDateHistogram *AggregationAutoDateHistogram `json:"auto_date_histogram"`
IPRange *AggregationIPRange `json:"ip_range"` // TODO: not implemented
Aggregations map[string]Aggregations `json:"aggs"` // nested aggregations
}
type AggregationsTerms ¶
type Analyzer ¶
type Analyzer struct {
CharFilter []string `json:"char_filter,omitempty"`
Tokenizer string `json:"tokenizer,omitempty"`
TokenFilter []string `json:"token_filter,omitempty"`
Filter []string `json:"filter,omitempty"` // compatibility with es, alias for TokenFilter
// options for compatible
Type string `json:"type,omitempty"`
Pattern string `json:"pattern,omitempty"` // for type=pattern
Lowercase bool `json:"lowercase,omitempty"` // for type=pattern
Stopwords []string `json:"stopwords,omitempty"` // for type=pattern,standard,stop
}
type BoolQuery ¶
type BoolQuery struct {
Should interface{} `json:"should,omitempty"` // query, [query1, query2]
Must interface{} `json:"must,omitempty"` // query, [query1, query2]
MustNot interface{} `json:"must_not,omitempty"` // query, [query1, query2]
Filter interface{} `json:"filter,omitempty"` // query, [query1, query2]
MinimumShouldMatch interface{} `json:"minimum_should_match,omitempty"` // only for should
}
type BoolQueryForSDK ¶
type BoolQueryForSDK struct {
Should []*QueryForSDK `json:"should,omitempty"` // query, [query1, query2]
Must []*QueryForSDK `json:"must,omitempty"` // query, [query1, query2]
MustNot []*QueryForSDK `json:"must_not,omitempty"` // query, [query1, query2]
Filter []*QueryForSDK `json:"filter,omitempty"` // query, [query1, query2]
MinimumShouldMatch float64 `json:"minimum_should_match,omitempty"` // only for should
}
type BoostingQuery ¶
type BoostingQuery struct {
Positive interface{} `json:"positive,omitempty"` // singe or multiple queries
Negative interface{} `json:"negative,omitempty"` // singe or multiple queries
NegativeBoost float64 `json:"negative_boost,omitempty"`
}
type CombinedFieldsQuery ¶
type ExistsQuery ¶
type ExistsQuery struct {
Field string `json:"field,omitempty"`
}
ExistsQuery {"exists":{"field":"field_name"}}
type FuzzyQuery ¶
type FuzzyQuery struct {
Value string `json:"value,omitempty"`
Fuzziness interface{} `json:"fuzziness,omitempty"` // auto, 1,2,3,n
PrefixLength float64 `json:"prefix_length,omitempty"`
Boost float64 `json:"boost,omitempty"`
}
FuzzyQuery {"fuzzy":{"field":"value"}} {"fuzzy":{"field":{"value":"value","fuzziness":"auto"}}}
type HTTPResponse ¶
type HTTPResponse struct {
Message string `json:"message"`
}
type HTTPResponseDeleteByQuery ¶
type HTTPResponseDeleteByQuery struct {
Took int64 `json:"took"`
TimedOut bool `json:"time_out"`
Total int `json:"total"`
Deleted int `json:"deleted"`
Batches int `json:"batches"`
VersionConflicts int `json:"version_conflicts"`
Noops int `json:"noops"`
Failures []string `json:"failures"`
Retries HttpRetriesResponse `json:"retries"`
ThrottledMillis int `json:"throttled_millis"`
RequestsPerSecond int `json:"requests_per_second"`
ThrottledUntilMillis int `json:"throttled_until_millis"`
}
type HTTPResponseDocument ¶
type HTTPResponseESID ¶
type HTTPResponseError ¶
type HTTPResponseError struct {
Error string `json:"error"`
}
type HTTPResponseID ¶
type HTTPResponseIndex ¶
type HTTPResponseRecordCount ¶
type HTTPResponseTemplate ¶
type HealthzResponse ¶
type HealthzResponse struct {
Status string `json:"status"`
}
type Hit ¶
type Hit struct {
Index string `json:"_index"`
Type string `json:"_type"`
ID string `json:"_id"`
Score float64 `json:"_score"`
Timestamp time.Time `json:"@timestamp"`
Source interface{} `json:"_source,omitempty"`
Fields map[string]interface{} `json:"fields,omitempty"`
Highlight map[string]interface{} `json:"highlight,omitempty"`
}
type HttpRetriesResponse ¶
type IdsQuery ¶
type IdsQuery struct {
Values []string `json:"values,omitempty"`
}
IdsQuery {"ids":{"values":["1","2","3"]}}
type Index ¶
type Index struct {
ShardNum int64 `json:"shard_num"`
Name string `json:"name"`
StorageType string `json:"storage_type"`
Settings *IndexSettings `json:"settings,omitempty"`
Mappings *Mappings `json:"mappings,omitempty"`
Shards map[string]*IndexShard `json:"shards"`
Stats IndexStat `json:"stats"`
Version string `json:"version"`
}
type IndexAnalysis ¶
type IndexAnalysis struct {
Analyzer map[string]*Analyzer `json:"analyzer,omitempty"`
CharFilter map[string]interface{} `json:"char_filter,omitempty"`
Tokenizer map[string]interface{} `json:"tokenizer,omitempty"`
TokenFilter map[string]interface{} `json:"token_filter,omitempty"`
Filter map[string]interface{} `json:"filter,omitempty"` // compatibility with es, alias for TokenFilter
}
type IndexSecondShard ¶
type IndexSettings ¶
type IndexSettings struct {
NumberOfShards int64 `json:"number_of_shards,omitempty"`
NumberOfReplicas int64 `json:"number_of_replicas,omitempty"`
Analysis *IndexAnalysis `json:"analysis,omitempty"`
}
type IndexShard ¶
type IndexShard struct {
ShardNum int64 `json:"shard_num"`
ID string `json:"id"`
NodeID string `json:"node_id"` // remote instance ID
Shards []*IndexSecondShard `json:"shards"`
Stats IndexStat `json:"stats"`
}
type IndexShardV026 ¶
type IndexSimple ¶
type IndexSimple struct {
Name string `json:"name"`
StorageType string `json:"storage_type"`
ShardNum int64 `json:"shard_num"`
Settings *IndexSettings `json:"settings,omitempty"`
Mappings map[string]interface{} `json:"mappings,omitempty"`
}
type IndexTemplate ¶
type IndexV026 ¶
type IndexV026 struct {
Name string `json:"name"`
StorageType string `json:"storage_type"`
StorageSize uint64 `json:"storage_size"`
DocNum uint64 `json:"doc_num"`
DocTimeMin int64 `json:"doc_time_min"`
DocTimeMax int64 `json:"doc_time_max"`
ShardNum int64 `json:"shard_num"`
Shards []*IndexShardV026 `json:"shards"`
WAL *wal.Log `json:"-"`
WALSize uint64 `json:"wal_size"`
Settings *IndexSettings `json:"settings,omitempty"`
Mappings *Mappings `json:"mappings,omitempty"`
CreateAt time.Time `json:"create_at"`
UpdateAt time.Time `json:"update_at"`
}
IndexV026 compatible for v0.2.6 index
type JSONIngest ¶
type Mappings ¶
type Mappings struct {
Properties map[string]Property `json:"properties,omitempty"`
// contains filtered or unexported fields
}
func NewMappings ¶
func NewMappings() *Mappings
func (*Mappings) ListProperty ¶
func (*Mappings) MarshalJSON ¶
func (*Mappings) SetProperty ¶
type MatchAllQuery ¶
type MatchAllQuery struct{}
type MatchBoolPrefixQuery ¶
type MatchNoneQuery ¶
type MatchNoneQuery struct{}
type MatchPhrasePrefixQuery ¶
type MatchPhraseQuery ¶
type MatchQuery ¶
type MatchQuery struct {
Query string `json:"query,omitempty"`
Analyzer string `json:"analyzer,omitempty"`
Operator string `json:"operator,omitempty"` // or(default), and
Fuzziness interface{} `json:"fuzziness,omitempty"` // auto, 1,2,3,n
PrefixLength float64 `json:"prefix_length,omitempty"`
Boost float64 `json:"boost,omitempty"`
}
type MultiMatchQuery ¶
type MultiMatchQuery struct {
Query string `json:"query,omitempty"`
Analyzer string `json:"analyzer,omitempty"`
Fields []string `json:"fields,omitempty"`
Boost float64 `json:"boost,omitempty"`
Type string `json:"type,omitempty"` // best_fields(default), most_fields, cross_fields, phrase, phrase_prefix, bool_prefix
Operator string `json:"operator,omitempty"` // or(default), and
MinimumShouldMatch interface{} `json:"minimum_should_match,omitempty"`
}
type Page ¶
type Page struct {
PageNum int64 `json:"page_num"`
PageSize int64 `json:"page_size"`
Total int64 `json:"total"`
}
func (*Page) GetStartEndIndex ¶
type PrefixQuery ¶
type PrefixQuery struct {
Value string `json:"value,omitempty"` // You can speed up prefix queries using the index_prefixes mapping parameter.
Boost float64 `json:"boost,omitempty"`
}
PrefixQuery {"prefix":{"field":"value"}} {"prefix":{"field":{"value":"value","boost":1.0}}}
type Property ¶
type Property struct {
Type string `json:"type"` // text, keyword, date, numeric, boolean, geo_point
Analyzer string `json:"analyzer,omitempty"`
SearchAnalyzer string `json:"search_analyzer,omitempty"`
Format string `json:"format,omitempty"` // date format yyyy-MM-dd HH:mm:ss || yyyy-MM-dd || epoch_millis
TimeZone string `json:"time_zone,omitempty"` // date format time_zone
Index bool `json:"index"`
Store bool `json:"store"`
Sortable bool `json:"sortable"`
Aggregatable bool `json:"aggregatable"`
Highlightable bool `json:"highlightable"`
// Fields allow the same string value to be indexed in multiple ways for different purposes,
// such as one field for search and a multi-field for sorting and aggregations,
// or the same string value analyzed by different analyzers.
// If the Fields property is defined within a sub-field, it will be ignored.
//
// Currently, only "text" fields support the Fields parameter.
Fields map[string]Property `json:"fields,omitempty"`
}
func NewProperty ¶
type Query ¶
type Query struct {
Bool *BoolQuery `json:"bool,omitempty"` // .
Boosting *BoostingQuery `json:"boosting,omitempty"` // TODO: not implemented
Match map[string]*MatchQuery `json:"match,omitempty"` // simple, MatchQuery
MatchBoolPrefix map[string]*MatchBoolPrefixQuery `json:"match_bool_prefix,omitempty"` // simple, MatchBoolPrefixQuery
MatchPhrase map[string]*MatchPhraseQuery `json:"match_phrase,omitempty"` // simple, MatchPhraseQuery
MatchPhrasePrefix map[string]*MatchPhrasePrefixQuery `json:"match_phrase_prefix,omitempty"` // simple, MatchPhrasePrefixQuery
MultiMatch *MultiMatchQuery `json:"multi_match,omitempty"` // .
MatchAll *MatchAllQuery `json:"match_all,omitempty"` // just set or null
MatchNone *MatchNoneQuery `json:"match_none,omitempty"` // just set or null
CombinedFields *CombinedFieldsQuery `json:"combined_fields,omitempty"` // TODO: not implemented
QueryString *QueryStringQuery `json:"query_string,omitempty"` // .
SimpleQueryString *SimpleQueryStringQuery `json:"simple_query_string,omitempty"` // .
Exists *ExistsQuery `json:"exists,omitempty"` // .
Ids *IdsQuery `json:"ids,omitempty"` // .
Range map[string]*RangeQuery `json:"range,omitempty"` // simple, FuzzyQuery
Regexp map[string]*RegexpQuery `json:"regexp,omitempty"` // simple, FuzzyQuery
Prefix map[string]*PrefixQuery `json:"prefix,omitempty"` // .
Fuzzy map[string]*FuzzyQuery `json:"fuzzy,omitempty"` // simple, PrefixQuery
Wildcard map[string]*WildcardQuery `json:"wildcard,omitempty"` // simple, WildcardQuery
Term map[string]*TermQuery `json:"term,omitempty"` // simple, TermQuery
Terms map[string]*TermsQuery `json:"terms,omitempty"` // .
TermsSet map[string]*TermsSetQuery `json:"terms_set,omitempty"` // TODO: not implemented
GeoBoundingBox interface{} `json:"geo_bounding_box,omitempty"` // TODO: not implemented
GeoDistance interface{} `json:"geo_distance,omitempty"` // TODO: not implemented
GeoPolygon interface{} `json:"geo_polygon,omitempty"` // TODO: not implemented
GeoShape interface{} `json:"geo_shape,omitempty"` // TODO: not implemented
}
type QueryForSDK ¶
type QueryForSDK struct {
Bool *BoolQueryForSDK `json:"bool,omitempty"` // .
Match map[string]*MatchQuery `json:"match,omitempty"` // simple, MatchQuery
MatchBoolPrefix map[string]*MatchBoolPrefixQuery `json:"match_bool_prefix,omitempty"` // simple, MatchBoolPrefixQuery
MatchPhrase map[string]*MatchPhraseQuery `json:"match_phrase,omitempty"` // simple, MatchPhraseQuery
MatchPhrasePrefix map[string]*MatchPhrasePrefixQuery `json:"match_phrase_prefix,omitempty"` // simple, MatchPhrasePrefixQuery
MultiMatch *MultiMatchQuery `json:"multi_match,omitempty"` // .
MatchAll *MatchAllQuery `json:"match_all,omitempty"` // just set or null
MatchNone *MatchNoneQuery `json:"match_none,omitempty"` // just set or null
QueryString *QueryStringQuery `json:"query_string,omitempty"` // .
SimpleQueryString *SimpleQueryStringQuery `json:"simple_query_string,omitempty"` // .
Exists *ExistsQuery `json:"exists,omitempty"` // .
Ids *IdsQuery `json:"ids,omitempty"` // .
Range map[string]*RangeQueryForSDK `json:"range,omitempty"` // simple, FuzzyQuery
Regexp map[string]*RegexpQuery `json:"regexp,omitempty"` // simple, FuzzyQuery
Prefix map[string]*PrefixQuery `json:"prefix,omitempty"` // .
Fuzzy map[string]*FuzzyQuery `json:"fuzzy,omitempty"` // simple, PrefixQuery
Wildcard map[string]*WildcardQuery `json:"wildcard,omitempty"` // simple, WildcardQuery
Term map[string]*TermQueryForSDK `json:"term,omitempty"` // simple, TermQuery
Terms map[string]*TermsQuery `json:"terms,omitempty"` // .
}
type QueryStringQuery ¶
type QueryStringQuery struct {
Query string `json:"query,omitempty"`
Analyzer string `json:"analyzer,omitempty"`
Fields []string `json:"fields,omitempty"`
DefaultField string `json:"default_field,omitempty"`
DefaultOperator string `json:"default_operator,omitempty"` // or(default), and
Boost float64 `json:"boost,omitempty"`
}
type RangeQuery ¶
type RangeQuery struct {
GT interface{} `json:"gt,omitempty"` // null, float64
GTE interface{} `json:"gte,omitempty"` // null, float64
LT interface{} `json:"lt,omitempty"` // null, float64
LTE interface{} `json:"lte,omitempty"` // null, float64
Format string `json:"format,omitempty"` // Date format used to convert date values in the query.
TimeZone string `json:"time_zone,omitempty"` // used to convert date values in the query to UTC.
Boost float64 `json:"boost,omitempty"`
}
RangeQuery {"range":{"field":{"gte":10,"lte":20}}}
type RangeQueryForSDK ¶
type RangeQueryForSDK struct {
GT string `json:"gt,omitempty"` // string, float64
GTE string `json:"gte,omitempty"` // string, float64
LT string `json:"lt,omitempty"` // string, float64
LTE string `json:"lte,omitempty"` // string, float64
Format string `json:"format,omitempty"` // Date format used to convert date values in the query.
TimeZone string `json:"time_zone,omitempty"` // used to convert date values in the query to UTC.
Boost float64 `json:"boost,omitempty"`
}
type RegexpQuery ¶
type RegexpQuery struct {
Value string `json:"value,omitempty"`
Flags string `json:"flags,omitempty"`
Boost float64 `json:"boost,omitempty"`
}
RegexpQuery {"regexp":{"field":{"value":"[0-9]*"}}}
type SearchResponse ¶
type SearchResponse struct {
Took int `json:"took"` // Time it took to generate the response
TimedOut bool `json:"timed_out"`
Shards Shards `json:"_shards"`
Hits Hits `json:"hits"`
Aggregations map[string]AggregationResponse `json:"aggregations,omitempty"`
Error string `json:"error,omitempty"`
}
SearchResponse for a query
type SimpleQueryStringQuery ¶
type SimpleQueryStringQuery struct {
Query string `json:"query,omitempty"`
Analyzer string `json:"analyzer,omitempty"`
Fields []string `json:"fields,omitempty"`
DefaultOperator string `json:"default_operator,omitempty"` // or(default), and
AllFields bool `json:"all_fields,omitempty"`
Boost float64 `json:"boost,omitempty"`
}
type Template ¶
type Template struct {
Name string `json:"name"`
IndexTemplate *IndexTemplate `json:"index_template"`
}
type TemplateTemplate ¶
type TemplateTemplate struct {
Settings *IndexSettings `json:"settings,omitempty"`
Mappings *Mappings `json:"mappings,omitempty"`
}
type TermQuery ¶
type TermQuery struct {
Value interface{} `json:"value,omitempty"`
Boost float64 `json:"boost,omitempty"`
CaseInsensitive bool `json:"case_insensitive,omitempty"`
}
TermQuery {"term":{"field": "value"}} {"term":{"field": {"value": "value", "boost": 1.0}}}
type TermQueryForSDK ¶
type TermsQuery ¶
type TermsQuery map[string]interface{}
TermsQuery {"terms": {"field": ["value1", "value2"], "boost": 1.0}}
type TokenFilter ¶
type TokenFilter struct {
Type string `json:"type"`
}
type VersionResponse ¶
type WildcardQuery ¶
type WildcardQuery struct {
Value string `json:"value,omitempty"`
Boost float64 `json:"boost,omitempty"`
}
WildcardQuery {"wildcard": {"field": "*query*"}} {"wildcard": {"field": {"value": "*query*", "boost": 1.0}}}
type ZincQuery ¶
type ZincQuery struct {
Query interface{} `json:"query"`
Aggregations map[string]Aggregations `json:"aggs"`
Highlight *Highlight `json:"highlight"`
Fields interface{} `json:"fields"` // ["field1", "field2.*", {"field": "fieldName", "format": "epoch_millis"}]
Source interface{} `json:"_source"` // true, false, ["field1", "field2.*"]
Sort interface{} `json:"sort"` // "_score", ["+Year","-Year", {"Year": "desc"}, "Date": {"order": "asc"", "format": "yyyy-MM-dd"}}"}]
Explain bool `json:"explain"`
From int `json:"from"`
Size int `json:"size"`
Timeout int `json:"timeout"`
TrackTotalHits bool `json:"track_total_hits"`
}
ZincQuery is the query object for the zinc index. compatible ES Query DSL
type ZincQueryForSDK ¶
type ZincQueryForSDK struct {
Query QueryForSDK `json:"query"`
Aggregations map[string]Aggregations `json:"aggs"`
Highlight *Highlight `json:"highlight"`
Fields []string `json:"fields"` // ["field1", "field2.*", {"field": "fieldName", "format": "epoch_millis"}]
Source []string `json:"_source"` // true, false, ["field1", "field2.*"]
Sort []string `json:"sort"` // "_score", ["+Year","-Year", {"Year": "desc"}, "Date": {"order": "asc"", "format": "yyyy-MM-dd"}}"}]
Explain bool `json:"explain"`
From int `json:"from"`
Size int `json:"size"`
Timeout int `json:"timeout"`
TrackTotalHits bool `json:"track_total_hits"`
}