diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/fatcat_web/search.py | 1 | ||||
-rw-r--r-- | python/fatcat_web/templates/container_view.html | 5 | ||||
-rw-r--r-- | python/tests/web_search.py | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/python/fatcat_web/search.py b/python/fatcat_web/search.py index 5271547d..10549a15 100644 --- a/python/fatcat_web/search.py +++ b/python/fatcat_web/search.py @@ -218,6 +218,7 @@ def get_elastic_container_stats(issnl): }, "aggs": { "container_stats": { "filters": { "filters": { "in_web": { "term": { "in_web": "true" } }, + "in_kbart": { "term": { "in_kbart": "true" } }, "is_preserved": { "term": { "is_preserved": "true" } }, }}}} } diff --git a/python/fatcat_web/templates/container_view.html b/python/fatcat_web/templates/container_view.html index f945a91a..182589c7 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -66,9 +66,12 @@ <b>Release Counts</b><br> {{ "{:,}".format(container._stats.total) }} total {% if container._stats.total >= 1 %} + <br>{{ "{:,}".format(container._stats.in_kbart ) }} + (<b>{{ "{:.1f}".format(container._stats.in_kbart/container._stats.total*100) }}%</b>) + preserved (dark) <br>{{ "{:,}".format(container._stats.is_preserved) }} (<b>{{ "{:.1f}".format(container._stats.is_preserved/container._stats.total*100) }}%</b>) - preserved or archived + preserved or available <br>{{ "{:,}".format(container._stats.in_web) }} (<b>{{ "{:.1f}".format(container._stats.in_web/container._stats.total*100) }}%</b>) fulltext available to read diff --git a/python/tests/web_search.py b/python/tests/web_search.py index 43be9f01..5828007d 100644 --- a/python/tests/web_search.py +++ b/python/tests/web_search.py @@ -99,6 +99,7 @@ def test_container_stats(app): 'aggregations': { 'container_stats': {'buckets': { 'is_preserved': {'doc_count': 461939}, + 'in_kbart': {'doc_count': 461939}, 'in_web': {'doc_count': 2797}}}}, 'hits': {'total': 461939, 'hits': [], 'max_score': 0.0}, '_shards': {'successful': 5, 'total': 5, 'skipped': 0, 'failed': 0}, |