Skip to content

Commit

Permalink
Fix: unique big map diffs by operation
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky authored and m-kus committed Oct 12, 2020
1 parent e5d8cc2 commit 8eb6dec
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions internal/elastic/big_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,22 @@ func (e *Elastic) GetBigMapDiffsUniqueByOperationID(operationID string) ([]model
Add(
aggs(
aggItem{
"keys", qItem{
"terms": qItem{
"field": "key_hash.keyword",
"size": maxQuerySize,
"keys",
composite(
maxQuerySize,
aggItem{
"ptr", termsAgg("ptr", 0),
},
"aggs": qItem{
"top_key": topHits(1, "indexed_time", "desc"),
aggItem{
"key_hash", termsAgg("key_hash.keyword", 0),
},
},
).Extend(
aggs(
aggItem{
"top_key", topHits(1, "indexed_time", "desc"),
},
),
),
},
),
).Zero()
Expand Down

0 comments on commit 8eb6dec

Please sign in to comment.