aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/search.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-08-12 22:09:10 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-08-12 22:09:10 -0700
commitedbbecc7607d1e5a1321e6c6b7be6f733db84e99 (patch)
tree7fabfec92f6abed8f5369d937a7389a0f691610e /python/fatcat_web/search.py
parentb6d79ead3c0a8d6617628c9e9a4db9d7c081e04c (diff)
downloadfatcat-edbbecc7607d1e5a1321e6c6b7be6f733db84e99.tar.gz
fatcat-edbbecc7607d1e5a1321e6c6b7be6f733db84e99.zip
default container stats by ident, not issnl
Diffstat (limited to 'python/fatcat_web/search.py')
-rw-r--r--python/fatcat_web/search.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/fatcat_web/search.py b/python/fatcat_web/search.py
index 10549a15..709163ec 100644
--- a/python/fatcat_web/search.py
+++ b/python/fatcat_web/search.py
@@ -201,11 +201,11 @@ def get_elastic_entity_stats():
return stats
-def get_elastic_container_stats(issnl):
+def get_elastic_container_stats(ident, issnl=None):
"""
- TODO: container_id, not issnl
-
Returns dict:
+ ident
+ issnl (optional)
total
in_web
preserved
@@ -214,7 +214,7 @@ def get_elastic_container_stats(issnl):
query = {
"size": 0,
"query": {
- "term": { "container_issnl": issnl }
+ "term": { "container_ident": ident }
},
"aggs": { "container_stats": { "filters": { "filters": {
"in_web": { "term": { "in_web": "true" } },
@@ -232,6 +232,7 @@ def get_elastic_container_stats(issnl):
resp = resp.json()
buckets = resp['aggregations']['container_stats']['buckets']
stats = {
+ 'ident': ident,
'issnl': issnl,
'total': resp['hits']['total'],
'in_web': buckets['in_web']['doc_count'],