forked from forgejo/forgejo
Update Vendor (#16325)
* Add Dependencie Update Script * update gitea.com/lunny/levelqueue * update github.com/PuerkitoBio/goquery * update github.com/alecthomas/chroma * update github.com/blevesearch/bleve/v2 * update github.com/caddyserver/certmagic * update github.com/go-enry/go-enry/v2 * update github.com/go-redis/redis/v8 * update github.com/hashicorp/golang-lru * update github.com/klauspost/compress * update github.com/markbates/goth * update github.com/mholt/archiver/v3 * update github.com/microcosm-cc/bluemonday * update github.com/minio/minio-go/v7 * update github.com/olivere/elastic/v7 * update github.com/xanzy/go-gitlab * update github.com/yuin/goldmark
This commit is contained in:
parent
65ae46bc20
commit
fae07cbc8f
319 changed files with 33568 additions and 21050 deletions
109
vendor/github.com/olivere/elastic/v7/search_aggs.go
generated
vendored
109
vendor/github.com/olivere/elastic/v7/search_aggs.go
generated
vendored
|
@ -369,6 +369,21 @@ func (a Aggregations) Terms(name string) (*AggregationBucketKeyItems, bool) {
|
|||
return nil, false
|
||||
}
|
||||
|
||||
// MultiTerms returns multi terms aggregation results.
|
||||
// See: https://www.elastic.co/guide/en/elasticsearch/reference/7.13/search-aggregations-bucket-multi-terms-aggregation.html
|
||||
func (a Aggregations) MultiTerms(name string) (*AggregationBucketMultiKeyItems, bool) {
|
||||
if raw, found := a[name]; found {
|
||||
agg := new(AggregationBucketMultiKeyItems)
|
||||
if raw == nil {
|
||||
return agg, true
|
||||
}
|
||||
if err := json.Unmarshal(raw, agg); err == nil {
|
||||
return agg, true
|
||||
}
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// SignificantTerms returns significant terms aggregation results.
|
||||
// See: https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-aggregations-bucket-significantterms-aggregation.html
|
||||
func (a Aggregations) SignificantTerms(name string) (*AggregationBucketSignificantTerms, bool) {
|
||||
|
@ -840,6 +855,22 @@ func (a Aggregations) ScriptedMetric(name string) (*AggregationScriptedMetric, b
|
|||
return nil, false
|
||||
}
|
||||
|
||||
// TopMetrics returns top metrics aggregation results.
|
||||
// See https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-aggregations-metrics-top-metrics.html
|
||||
//for details
|
||||
func (a Aggregations) TopMetrics(name string) (*AggregationTopMetricsItems, bool) {
|
||||
if raw, found := a[name]; found {
|
||||
agg := new(AggregationTopMetricsItems)
|
||||
if raw == nil {
|
||||
return agg, true
|
||||
}
|
||||
if err := json.Unmarshal(raw, agg); err == nil {
|
||||
return agg, true
|
||||
}
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// -- Single value metric --
|
||||
|
||||
// AggregationValueMetric is a single-value metric, returned e.g. by a
|
||||
|
@ -1326,6 +1357,71 @@ func (a *AggregationBucketKeyItem) UnmarshalJSON(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// AggregationBucketMultiKeyItems is a bucket aggregation that is returned
|
||||
// with a multi terms aggregation.
|
||||
type AggregationBucketMultiKeyItems struct {
|
||||
Aggregations
|
||||
|
||||
DocCountErrorUpperBound int64 //`json:"doc_count_error_upper_bound"`
|
||||
SumOfOtherDocCount int64 //`json:"sum_other_doc_count"`
|
||||
Buckets []*AggregationBucketMultiKeyItem //`json:"buckets"`
|
||||
Meta map[string]interface{} // `json:"meta,omitempty"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON decodes JSON data and initializes an AggregationBucketMultiKeyItems structure.
|
||||
func (a *AggregationBucketMultiKeyItems) UnmarshalJSON(data []byte) error {
|
||||
var aggs map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &aggs); err != nil {
|
||||
return err
|
||||
}
|
||||
if v, ok := aggs["doc_count_error_upper_bound"]; ok && v != nil {
|
||||
json.Unmarshal(v, &a.DocCountErrorUpperBound)
|
||||
}
|
||||
if v, ok := aggs["sum_other_doc_count"]; ok && v != nil {
|
||||
json.Unmarshal(v, &a.SumOfOtherDocCount)
|
||||
}
|
||||
if v, ok := aggs["buckets"]; ok && v != nil {
|
||||
json.Unmarshal(v, &a.Buckets)
|
||||
}
|
||||
if v, ok := aggs["meta"]; ok && v != nil {
|
||||
json.Unmarshal(v, &a.Meta)
|
||||
}
|
||||
a.Aggregations = aggs
|
||||
return nil
|
||||
}
|
||||
|
||||
// AggregationBucketMultiKeyItem is a single bucket of an AggregationBucketMultiKeyItems structure.
|
||||
type AggregationBucketMultiKeyItem struct {
|
||||
Aggregations
|
||||
|
||||
Key []interface{} //`json:"key"`
|
||||
KeyAsString *string //`json:"key_as_string"`
|
||||
KeyNumber []json.Number
|
||||
DocCount int64 //`json:"doc_count"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON decodes JSON data and initializes an AggregationBucketMultiKeyItem structure.
|
||||
func (a *AggregationBucketMultiKeyItem) UnmarshalJSON(data []byte) error {
|
||||
var aggs map[string]json.RawMessage
|
||||
dec := json.NewDecoder(bytes.NewReader(data))
|
||||
dec.UseNumber()
|
||||
if err := dec.Decode(&aggs); err != nil {
|
||||
return err
|
||||
}
|
||||
if v, ok := aggs["key"]; ok && v != nil {
|
||||
json.Unmarshal(v, &a.Key)
|
||||
json.Unmarshal(v, &a.KeyNumber)
|
||||
}
|
||||
if v, ok := aggs["key_as_string"]; ok && v != nil {
|
||||
json.Unmarshal(v, &a.KeyAsString)
|
||||
}
|
||||
if v, ok := aggs["doc_count"]; ok && v != nil {
|
||||
json.Unmarshal(v, &a.DocCount)
|
||||
}
|
||||
a.Aggregations = aggs
|
||||
return nil
|
||||
}
|
||||
|
||||
// -- Bucket types for significant terms --
|
||||
|
||||
// AggregationBucketSignificantTerms is a bucket aggregation returned
|
||||
|
@ -1804,3 +1900,16 @@ func (a *AggregationScriptedMetric) UnmarshalJSON(data []byte) error {
|
|||
a.Aggregations = aggs
|
||||
return nil
|
||||
}
|
||||
|
||||
// AggregationTopMetricsItems is the value returned by the top metrics aggregation
|
||||
type AggregationTopMetricsItems struct {
|
||||
Aggregations
|
||||
|
||||
Top []AggregationTopMetricsItem `json:"top"`
|
||||
}
|
||||
|
||||
// AggregationTopMetricsItem is a set of metrics returned for the top document or documents
|
||||
type AggregationTopMetricsItem struct {
|
||||
Sort []interface{} `json:"sort"` // sort information
|
||||
Metrics map[string]interface{} `json:"metrics"` // returned metrics
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue