Treat text fields as string and try beta Kibana image

This commit is contained in:
2022-09-12 08:27:13 +01:00
parent 40492b1595
commit 04b5dec843
5 changed files with 35 additions and 12 deletions

6
db.py
View File

@@ -60,7 +60,7 @@ def store_message(msg):
del msg[key]
if key in schema:
if isinstance(value, int):
if schema[key].startswith("string"):
if schema[key].startswith("string") or schema[key].startswith("text"):
msg[key] = str(value)
body = [{"insert": {"index": index, "doc": msg}}]
@@ -108,7 +108,9 @@ def store_message_bulk(data):
del msg[key]
if key in schema:
if isinstance(value, int):
if schema[key].startswith("string"):
if schema[key].startswith("string") or schema[key].startswith(
"text"
):
msg[key] = str(value)
body = {"insert": {"index": index, "doc": msg}}