aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-01-29 23:23:39 -0800
committerBryan Newbold <bnewbold@robocracy.org>2020-01-29 23:23:39 -0800
commitbf718fd076476c1a54e80ca88cd02ede606ab6f3 (patch)
tree5d4e5e14fc77ba344e7c4cd02c149939211b942e
parentd5d83762063b8ec7f512c20567f46c03f2e6b542 (diff)
downloadfatcat-bf718fd076476c1a54e80ca88cd02ede606ab6f3.tar.gz
fatcat-bf718fd076476c1a54e80ca88cd02ede606ab6f3.zip
add country to v03b release schema
-rw-r--r--extra/elasticsearch/release_schema.json1
-rw-r--r--python/fatcat_tools/transforms/elasticsearch.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/extra/elasticsearch/release_schema.json b/extra/elasticsearch/release_schema.json
index 98a1c28e..2b67c5f5 100644
--- a/extra/elasticsearch/release_schema.json
+++ b/extra/elasticsearch/release_schema.json
@@ -40,6 +40,7 @@
"release_stage": { "type": "keyword" },
"withdrawn_status": { "type": "keyword", "copy_to": "biblio" },
"language": { "type": "keyword" },
+ "country": { "type": "keyword" },
"volume": { "type": "keyword", "copy_to": "biblio" },
"issue": { "type": "keyword", "copy_to": "biblio" },
"pages": { "type": "keyword", "copy_to": "biblio" },
diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py
index c8547b27..f0146d01 100644
--- a/python/fatcat_tools/transforms/elasticsearch.py
+++ b/python/fatcat_tools/transforms/elasticsearch.py
@@ -155,6 +155,8 @@ def release_to_elasticsearch(entity, force_bool=True):
if c_extra.get('szczepanski'):
if c_extra['szczepanski'].get('as_of'):
is_oa = True
+ if c_extra.get('country'):
+ t['country'] = c_extra['country']
# fall back to release-level container metadata if container not linked or
# missing context