summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-02-26 11:22:30 -0800
committerBryan Newbold <bnewbold@robocracy.org>2020-02-26 11:22:30 -0800
commit0450f22006c9b991cdc4695458fc3b3e3e97bfbb (patch)
treee99dead7a6bd67d1434181ee3513931a26c0de86
parented38bfde4e1eaddd6d710802b6f372c7b0aab26b (diff)
downloadfatcat-0450f22006c9b991cdc4695458fc3b3e3e97bfbb.tar.gz
fatcat-0450f22006c9b991cdc4695458fc3b3e3e97bfbb.zip
ES release: last minor tweaks
-rw-r--r--extra/elasticsearch/release_schema.json8
-rw-r--r--python/fatcat_tools/transforms/elasticsearch.py4
2 files changed, 7 insertions, 5 deletions
diff --git a/extra/elasticsearch/release_schema.json b/extra/elasticsearch/release_schema.json
index 1b91696c..666a672f 100644
--- a/extra/elasticsearch/release_schema.json
+++ b/extra/elasticsearch/release_schema.json
@@ -52,8 +52,8 @@
"release_stage": { "type": "keyword", "normalizer": "default" },
"withdrawn_status": { "type": "keyword", "normalizer": "default", "copy_to": "biblio" },
"language": { "type": "keyword", "normalizer": "default" },
- "country": { "type": "keyword", "normalizer": "default" },
- "country_upper": { "type": "keyword", "normalizer": "caseSensitive" },
+ "country_code": { "type": "keyword", "normalizer": "default" },
+ "country_code_upper": { "type": "keyword", "normalizer": "caseSensitive" },
"volume": { "type": "keyword", "normalizer": "default", "copy_to": "biblio" },
"issue": { "type": "keyword", "normalizer": "default", "copy_to": "biblio" },
"pages": { "type": "keyword", "normalizer": "default", "copy_to": "biblio" },
@@ -71,8 +71,10 @@
"jstor_id": { "type": "keyword", "normalizer": "default", "doc_values": false },
"ark_id": { "type": "keyword", "normalizer": "default", "doc_values": false },
"mag_id": { "type": "keyword", "normalizer": "default", "doc_values": false },
+ "s2_id": { "type": "keyword", "normalizer": "default", "doc_values": false },
"license": { "type": "keyword", "normalizer": "default" },
"publisher": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch" },
+ "publisher_type": { "type": "keyword", "normalizer": "default" },
"container_name": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch", "copy_to": "biblio" },
"container_id": { "type": "keyword", "normalizer": "default" },
"container_issnl": { "type": "keyword", "normalizer": "default" },
@@ -110,7 +112,7 @@
"is_retracted": { "type": "boolean" },
"preservation": { "type": "keyword", "normalizer": "default" },
- "affiliation": { "type": "alias", "path": "affiliations" },
+ "affiliation": { "type": "alias", "path": "affiliations" },
"ror": { "type": "alias", "path": "affiliation_rors" },
"creator_id": { "type": "alias", "path": "creator_ids" },
"ref_release_id": { "type": "alias", "path": "ref_release_ids" },
diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py
index e00d7830..cbafca7e 100644
--- a/python/fatcat_tools/transforms/elasticsearch.py
+++ b/python/fatcat_tools/transforms/elasticsearch.py
@@ -156,8 +156,8 @@ def release_to_elasticsearch(entity, force_bool=True):
if c_extra['szczepanski'].get('as_of'):
is_oa = True
if c_extra.get('country'):
- t['country'] = c_extra['country']
- t['country_upper'] = c_extra['country'].upper()
+ t['country_code'] = c_extra['country']
+ t['country_code_upper'] = c_extra['country'].upper()
# fall back to release-level container metadata if container not linked or
# missing context