From 81c7293312f039f8ce3cac9a5023ab97b57e39ce Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 May 2019 16:07:02 -0700 Subject: elastic release schema update --- extra/elasticsearch/release_schema.json | 7 ++++++- python/fatcat_tools/transforms/elasticsearch.py | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/extra/elasticsearch/release_schema.json b/extra/elasticsearch/release_schema.json index c30a7b5b..ef195e1b 100644 --- a/extra/elasticsearch/release_schema.json +++ b/extra/elasticsearch/release_schema.json @@ -31,11 +31,13 @@ "state": { "type": "keyword" }, "revision": { "type": "keyword" }, "title": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch" }, + "subtitle": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch" }, "original_title": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch" }, "release_date": { "type": "date" }, "release_year": { "type": "integer" }, "release_type": { "type": "keyword" }, - "release_status": { "type": "keyword" }, + "release_stage": { "type": "keyword" }, + "withdrawn_status": { "type": "keyword" }, "language": { "type": "keyword" }, "doi": { "type": "keyword" }, "pmid": { "type": "keyword" }, @@ -45,6 +47,8 @@ "core_id": { "type": "keyword" }, "axiv_id": { "type": "keyword" }, "jstor_id": { "type": "keyword" }, + "ark_id": { "type": "keyword" }, + "mag_id": { "type": "keyword" }, "license": { "type": "keyword" }, "publisher": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch" }, "container_name": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch" }, @@ -81,6 +85,7 @@ "longtail": { "type": "alias", "path": "is_longtail_oa" }, "lang": { "type": "alias", "path": "language" }, "file_pdf_url": { "type": "alias", "path": "best_pdf_url" }, + "release_status": { "type": "alias", "path": "release_stage" }, "is_kept": { "type": "alias", "path": "in_kbart" } } } diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py index 645142de..a8e0227b 100644 --- a/python/fatcat_tools/transforms/elasticsearch.py +++ b/python/fatcat_tools/transforms/elasticsearch.py @@ -43,9 +43,11 @@ def release_to_elasticsearch(entity, force_bool=True): state = release.state, revision = release.revision, title = release.title, + subtitle = release.subtitle, original_title = release.original_title, release_type = release.release_type, - release_status = release.release_stage, + release_stage = release.release_stage, + withdrawn_status = release.withdrawn_status, language = release.language, license = release.license_slug, doi = release.ext_ids.doi, @@ -56,7 +58,8 @@ def release_to_elasticsearch(entity, force_bool=True): core_id = release.ext_ids.core, arxiv_id = release.ext_ids.arxiv, jstor_id = release.ext_ids.jstor, - # TODO: mag, ark + ark_id = release.ext_ids.ark, + mag_id = release.ext_ids.mag, ) is_oa = None -- cgit v1.2.3