summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-02-26 20:25:27 -0800
committerBryan Newbold <bnewbold@robocracy.org>2021-04-06 21:58:49 -0700
commitd36b38fc567bbba4ac84713042e9558afd4981b3 (patch)
tree913dd67c748192fefc21e4b318c193bac4387f2c
parentc23f050426c1422e84019fe60d4d67865b962f31 (diff)
downloadfatcat-d36b38fc567bbba4ac84713042e9558afd4981b3.tar.gz
fatcat-d36b38fc567bbba4ac84713042e9558afd4981b3.zip
ES schemas: add doc_index_ts to all mappings
-rw-r--r--extra/elasticsearch/changelog_schema.json1
-rw-r--r--extra/elasticsearch/container_schema.json1
-rw-r--r--extra/elasticsearch/fatcat_ref.json5
-rw-r--r--extra/elasticsearch/file_schema.json1
-rw-r--r--extra/elasticsearch/release_schema.json1
-rw-r--r--python/fatcat_tools/transforms/elasticsearch.py4
6 files changed, 13 insertions, 0 deletions
diff --git a/extra/elasticsearch/changelog_schema.json b/extra/elasticsearch/changelog_schema.json
index 6e784a57..65536bd6 100644
--- a/extra/elasticsearch/changelog_schema.json
+++ b/extra/elasticsearch/changelog_schema.json
@@ -29,6 +29,7 @@
"mappings": {
"_doc": {
"properties": {
+ "doc_index_ts": { "type": "date" },
"index": { "type": "integer" },
"editgroup_id": { "type": "keyword", "normalizer": "default", "doc_values": false },
"timestamp": { "type": "date" },
diff --git a/extra/elasticsearch/container_schema.json b/extra/elasticsearch/container_schema.json
index 1960984d..21b8d4ec 100644
--- a/extra/elasticsearch/container_schema.json
+++ b/extra/elasticsearch/container_schema.json
@@ -41,6 +41,7 @@
"mappings": {
"_doc": {
"properties": {
+ "doc_index_ts": { "type": "date" },
"ident": { "type": "keyword", "normalizer": "default", "doc_values": false },
"state": { "type": "keyword", "normalizer": "default" },
"revision": { "type": "keyword", "normalizer": "default", "doc_values": false },
diff --git a/extra/elasticsearch/fatcat_ref.json b/extra/elasticsearch/fatcat_ref.json
index b82ce93b..32c7a3cd 100644
--- a/extra/elasticsearch/fatcat_ref.json
+++ b/extra/elasticsearch/fatcat_ref.json
@@ -100,6 +100,11 @@
"target_csl": {
"type": "object",
"enabled": false
+ },
+
+ "doc_index_ts": {
+ "type": "alias",
+ "path": "indexed_ts"
}
}
}
diff --git a/extra/elasticsearch/file_schema.json b/extra/elasticsearch/file_schema.json
index 4635e469..a8dbc6d0 100644
--- a/extra/elasticsearch/file_schema.json
+++ b/extra/elasticsearch/file_schema.json
@@ -29,6 +29,7 @@
"mappings": {
"_doc": {
"properties": {
+ "doc_index_ts": { "type": "date" },
"ident": { "type": "keyword", "normalizer": "default", "doc_values": false },
"state": { "type": "keyword", "normalizer": "default" },
"revision": { "type": "keyword", "normalizer": "default", "doc_values": false },
diff --git a/extra/elasticsearch/release_schema.json b/extra/elasticsearch/release_schema.json
index 91f2f183..fe1485ef 100644
--- a/extra/elasticsearch/release_schema.json
+++ b/extra/elasticsearch/release_schema.json
@@ -41,6 +41,7 @@
"mappings": {
"_doc": {
"properties": {
+ "doc_index_ts": { "type": "date" },
"ident": { "type": "keyword", "normalizer": "default", "doc_values": false },
"state": { "type": "keyword", "normalizer": "default" },
"revision": { "type": "keyword", "normalizer": "default", "doc_values": false },
diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py
index f37aadba..12b8ea2b 100644
--- a/python/fatcat_tools/transforms/elasticsearch.py
+++ b/python/fatcat_tools/transforms/elasticsearch.py
@@ -46,6 +46,7 @@ def release_to_elasticsearch(entity: ReleaseEntity, force_bool: bool = True) ->
# First, the easy ones (direct copy)
release = entity
t = dict(
+ doc_index_ts=datetime.datetime.utcnow(),
ident = release.ident,
state = release.state,
revision = release.revision,
@@ -392,6 +393,7 @@ def container_to_elasticsearch(entity, force_bool=True):
# First, the easy ones (direct copy)
t = dict(
+ doc_index_ts=datetime.datetime.utcnow(),
ident = entity.ident,
state = entity.state,
revision = entity.revision,
@@ -495,6 +497,7 @@ def changelog_to_elasticsearch(entity):
editgroup = entity.editgroup
t = dict(
+ doc_index_ts=datetime.datetime.utcnow(),
index=entity.index,
editgroup_id=entity.editgroup_id,
timestamp=entity.timestamp.isoformat(),
@@ -558,6 +561,7 @@ def file_to_elasticsearch(entity):
# First, the easy ones (direct copy)
t = dict(
+ doc_index_ts=datetime.datetime.utcnow(),
ident = entity.ident,
state = entity.state,
revision = entity.revision,