123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- package eapi
- type M map[string]interface{}
- // SearchModel 基本搜索模型
- type SearchModel struct {
- Took int `json:"took"`
- TimedOut bool `json:"timed_out"`
- Shards struct {
- Total int `json:"total"`
- Successful int `json:"successful"`
- Skipped int `json:"skipped"`
- Failed int `json:"failed"`
- } `json:"_shards"`
- Hits struct {
- Total struct {
- Value int `json:"value"`
- Relation string `json:"relation"`
- } `json:"total"`
- MaxScore interface{} `json:"max_score"`
- Hits []struct {
- Index string `json:"_index"`
- Id string `json:"_id"`
- Score interface{} `json:"_score"`
- Source interface{} `json:"_source"`
- Sort []int `json:"sort"`
- } `json:"hits"`
- } `json:"hits"`
- }
- // CountModel 统计行数
- type CountModel struct {
- Count int64 `json:"count"`
- Shards struct {
- Total int `json:"total"`
- Successful int `json:"successful"`
- Skipped int `json:"skipped"`
- Failed int `json:"failed"`
- } `json:"_shards"`
- }
- // CardinalityModel 去重统计行数
- type CardinalityModel struct {
- Took int `json:"took"`
- TimedOut bool `json:"timed_out"`
- Shards struct {
- Total int `json:"total"`
- Successful int `json:"successful"`
- Skipped int `json:"skipped"`
- Failed int `json:"failed"`
- } `json:"_shards"`
- Hits struct {
- Total struct {
- Value int `json:"value"`
- Relation string `json:"relation"`
- } `json:"total"`
- MaxScore interface{} `json:"max_score"`
- Hits []interface{} `json:"hits"`
- } `json:"hits"`
- Aggregations struct {
- Count struct {
- Value int64 `json:"value"`
- } `json:"count"`
- } `json:"aggregations"`
- }
- // FirstModel 第一条数据
- type FirstModel struct {
- Took int `json:"took"`
- TimedOut bool `json:"timed_out"`
- Shards struct {
- Total int `json:"total"`
- Successful int `json:"successful"`
- Skipped int `json:"skipped"`
- Failed int `json:"failed"`
- } `json:"_shards"`
- Hits struct {
- Total struct {
- Value int `json:"value"`
- Relation string `json:"relation"`
- } `json:"total"`
- MaxScore interface{} `json:"max_score"`
- Hits []struct {
- Index string `json:"_index"`
- Id string `json:"_id"`
- Score interface{} `json:"_score"`
- Source interface{} `json:"_source"`
- Sort []int `json:"sort"`
- } `json:"hits"`
- } `json:"hits"`
- }
- // LastModel 最后一条数据
- type LastModel struct {
- Took int `json:"took"`
- TimedOut bool `json:"timed_out"`
- Shards struct {
- Total int `json:"total"`
- Successful int `json:"successful"`
- Skipped int `json:"skipped"`
- Failed int `json:"failed"`
- } `json:"_shards"`
- Hits struct {
- Total struct {
- Value int `json:"value"`
- Relation string `json:"relation"`
- } `json:"total"`
- MaxScore interface{} `json:"max_score"`
- Hits []struct {
- Index string `json:"_index"`
- Id string `json:"_id"`
- Score interface{} `json:"_score"`
- Source interface{} `json:"_source"`
- Sort []int `json:"sort"`
- } `json:"hits"`
- } `json:"hits"`
- }
- // TopListModel 排行榜
- type TopListModel struct {
- Took int `json:"took"`
- TimedOut bool `json:"timed_out"`
- Shards struct {
- Total int `json:"total"`
- Successful int `json:"successful"`
- Skipped int `json:"skipped"`
- Failed int `json:"failed"`
- } `json:"_shards"`
- Hits struct {
- Total struct {
- Value int `json:"value"`
- Relation string `json:"relation"`
- } `json:"total"`
- MaxScore float64 `json:"max_score"`
- Hits []struct {
- Index string `json:"_index"`
- Id string `json:"_id"`
- Score float64 `json:"_score"`
- } `json:"hits"`
- } `json:"hits"`
- Aggregations struct {
- Vals struct {
- DocCountErrorUpperBound int `json:"doc_count_error_upper_bound"`
- SumOtherDocCount int `json:"sum_other_doc_count"`
- Buckets []TopBucket `json:"buckets"`
- } `json:"vals"`
- } `json:"aggregations"`
- }
- // TopBucket 排行榜桶
- type TopBucket struct {
- Key int64 `json:"key"`
- DocCount int64 `json:"doc_count"`
- }
- // TopSumScoreListModel 聚合字段的排行榜
- type TopSumScoreListModel struct {
- Took int `json:"took"`
- TimedOut bool `json:"timed_out"`
- Shards struct {
- Total int `json:"total"`
- Successful int `json:"successful"`
- Skipped int `json:"skipped"`
- Failed int `json:"failed"`
- } `json:"_shards"`
- Hits struct {
- Total struct {
- Value int `json:"value"`
- Relation string `json:"relation"`
- } `json:"total"`
- MaxScore interface{} `json:"max_score"`
- Hits []interface{} `json:"hits"`
- } `json:"hits"`
- Aggregations struct {
- Vals struct {
- DocCountErrorUpperBound int `json:"doc_count_error_upper_bound"`
- SumOtherDocCount int `json:"sum_other_doc_count"`
- Buckets []TopSumScoreBucket `json:"buckets"`
- } `json:"vals"`
- } `json:"aggregations"`
- }
- // TopSumScoreBucket 排行榜桶
- type TopSumScoreBucket struct {
- Key int64 `json:"key"`
- DocCount int64 `json:"doc_count"`
- SumScore struct {
- Value float64 `json:"value"`
- } `json:"sum_score"`
- }
|