-
Notifications
You must be signed in to change notification settings - Fork 0
/
queries.py
60 lines (60 loc) · 1.82 KB
/
queries.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
QUERIES = {
"expensesPerSigner" : {
"query": {
"filtered": {
"query": {
"match_all": {}
}
}
},
"aggs": {
"sponsors": {
"terms": {
"size":100,
"order" : {
"expenses" : "desc"
},
"field": "extraFieldValues.sponsor.sponsorAFMName.name"
},
"aggs": {
"expenses": {
"sum": {
"field": "extraFieldValues.sponsor.expenseAmount.amount"
}
},
"top_sponsor_hits": {
"top_hits": {
"sort": [
{
"submissionTimestamp": {
"order": "desc"
}
}
],
"_source": {
"include": [
"subject",
"documentUrl",
"url",
"extraFieldValues"
]
},
"size" : 10
}
}
}
},
"expense_stats" : { "stats" : { "field" : "extraFieldValues.sponsor.expenseAmount.amount" } }
}
},
"getOldestEntry": {
"query": {
"match_all": {}
},
"sort": [
{
"submissionTimestamp": "asc"
}
]
}
}