summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-02-26 11:28:05 -0800
committerBryan Newbold <bnewbold@robocracy.org>2020-02-26 11:29:30 -0800
commit4e6bc246d01183f4c7ffad7d0d474e683f04c07f (patch)
tree2820228c6544aad199b62722702c3c1678a99c0f
parent0450f22006c9b991cdc4695458fc3b3e3e97bfbb (diff)
downloadfatcat-4e6bc246d01183f4c7ffad7d0d474e683f04c07f.tar.gz
fatcat-4e6bc246d01183f4c7ffad7d0d474e683f04c07f.zip
ES container last tweaks
-rw-r--r--extra/elasticsearch/container_schema.json7
-rw-r--r--python/fatcat_tools/transforms/elasticsearch.py3
2 files changed, 7 insertions, 3 deletions
diff --git a/extra/elasticsearch/container_schema.json b/extra/elasticsearch/container_schema.json
index be3a408e..5cd85b04 100644
--- a/extra/elasticsearch/container_schema.json
+++ b/extra/elasticsearch/container_schema.json
@@ -47,11 +47,12 @@
"publisher": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch", "copy_to": "biblio" },
"abbrev": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch", "copy_to": "biblio" },
"aliases": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch", "copy_to": "biblio" },
+ "publisher_type": { "type": "keyword", "normalizer": "default" },
"container_type": { "type": "keyword", "normalizer": "default" },
"issnl": { "type": "keyword", "normalizer": "default" },
"issns": { "type": "keyword", "normalizer": "default" },
"wikidata_qid": { "type": "keyword", "normalizer": "default" },
- "country": { "type": "keyword", "normalizer": "default" },
+ "country_code": { "type": "keyword", "normalizer": "default" },
"region": { "type": "keyword", "normalizer": "default" },
"discipline": { "type": "keyword", "normalizer": "default" },
"languages": { "type": "keyword", "normalizer": "default" },
@@ -74,8 +75,8 @@
"releases_total": { "type": "integer" },
"releases_kbart": { "type": "integer" },
"releases_ia": { "type": "integer" },
- "releases_sim": { "type": "integer" },
- "releases_shadow": { "type": "integer" },
+ "releases_ia_sim": { "type": "integer" },
+ "releases_shadows": { "type": "integer" },
"releases_any_file": { "type": "integer" },
"releases_any_fileset": { "type": "integer" },
"releases_any_webcapture": { "type": "integer" },
diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py
index cbafca7e..8581febd 100644
--- a/python/fatcat_tools/transforms/elasticsearch.py
+++ b/python/fatcat_tools/transforms/elasticsearch.py
@@ -342,6 +342,9 @@ def container_to_elasticsearch(entity, force_bool=True):
if entity.extra.get(key):
t[key] = entity.extra[key]
+ if 'country' in t:
+ t['country_code'] = t.pop('country')
+
t['issns'] = []
if entity.issnl:
t['issns'].append(entity.issnl)