Commit 98e6158d authored by Cody Zacharias's avatar Cody Zacharias Committed by GitHub

Fix elasticsearch date

parent 5a6b0fd2
...@@ -34,15 +34,16 @@ def Elastic(Tweet, config): ...@@ -34,15 +34,16 @@ def Elastic(Tweet, config):
nLikes = 0 nLikes = 0
nReplies = 0 nReplies = 0
nRetweets = 0 nRetweets = 0
dt = "{} {}".format(Tweet.datestamp, Tweet.timestamp)
j_data = { j_data = {
"_index": "twint", "_index": "twint",
"_type": "items", "_type": "items",
"_id": Tweet.id + "_raw", "_id": Tweet.id + "_raw",
"_source": { "_source": {
"id": Tweet.id, "id": Tweet.id,
"date": Tweet.datestamp, "date": dt,
"time": Tweet.timestamp,
"timezone": Tweet.timezone, "timezone": Tweet.timezone,
"location": Tweet.location, "location": Tweet.location,
"tweet": Tweet.tweet, "tweet": Tweet.tweet,
...@@ -64,8 +65,7 @@ def Elastic(Tweet, config): ...@@ -64,8 +65,7 @@ def Elastic(Tweet, config):
"_id": Tweet.id + "_likes_" + str(nLikes), "_id": Tweet.id + "_likes_" + str(nLikes),
"_source": { "_source": {
"id": Tweet.id, "id": Tweet.id,
"date": Tweet.datestamp, "date": dt,
"time": Tweet.timestamp,
"timezone": Tweet.timezone, "timezone": Tweet.timezone,
"location": Tweet.location, "location": Tweet.location,
"tweet": Tweet.tweet, "tweet": Tweet.tweet,
...@@ -89,8 +89,7 @@ def Elastic(Tweet, config): ...@@ -89,8 +89,7 @@ def Elastic(Tweet, config):
"_id": Tweet.id + "_replies_" + str(nReplies), "_id": Tweet.id + "_replies_" + str(nReplies),
"_source": { "_source": {
"id": Tweet.id, "id": Tweet.id,
"date": Tweet.datestamp, "date": dt,
"time": Tweet.timestamp,
"timezone": Tweet.timezone, "timezone": Tweet.timezone,
"location": Tweet.location, "location": Tweet.location,
"tweet": Tweet.tweet, "tweet": Tweet.tweet,
...@@ -114,8 +113,7 @@ def Elastic(Tweet, config): ...@@ -114,8 +113,7 @@ def Elastic(Tweet, config):
"_id": Tweet.id + "_retweets_" + str(nRetweets), "_id": Tweet.id + "_retweets_" + str(nRetweets),
"_source": { "_source": {
"id": Tweet.id, "id": Tweet.id,
"date": Tweet.datestamp, "date": dt,
"time": Tweet.timestamp,
"timezone": Tweet.timezone, "timezone": Tweet.timezone,
"location": Tweet.location, "location": Tweet.location,
"tweet": Tweet.tweet, "tweet": Tweet.tweet,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment