Commit 812f3d4d authored by Francesco Poldi's avatar Francesco Poldi

Added user_rt_id to ELK

parent 872ec01a
...@@ -85,7 +85,8 @@ def createIndex(config, instance, **scope): ...@@ -85,7 +85,8 @@ def createIndex(config, instance, **scope):
"near": {"type": "text"}, "near": {"type": "text"},
"geo_near": {"type": "geo_point"}, "geo_near": {"type": "geo_point"},
"geo_tweet": {"type": "geo_point"}, "geo_tweet": {"type": "geo_point"},
"photos": {"type": "text"} "photos": {"type": "text"},
"user_rt_id": {"type": "integer"}
} }
}, },
"settings": { "settings": {
...@@ -205,7 +206,6 @@ def Tweet(Tweet, config): ...@@ -205,7 +206,6 @@ def Tweet(Tweet, config):
"user_id_str": Tweet.user_id_str, "user_id_str": Tweet.user_id_str,
"username": Tweet.username, "username": Tweet.username,
"name": Tweet.name, "name": Tweet.name,
"profile_image_url": Tweet.profile_image_url,
"day": day, "day": day,
"hour": hour(Tweet.datetime/1000), "hour": hour(Tweet.datetime/1000),
"link": Tweet.link, "link": Tweet.link,
...@@ -220,6 +220,8 @@ def Tweet(Tweet, config): ...@@ -220,6 +220,8 @@ def Tweet(Tweet, config):
"near": config.Near "near": config.Near
} }
} }
if Tweet.retweet:
j_data["_source"].udpate({"user_rt_id": Tweet.user_rt_id})
if Tweet.photos: if Tweet.photos:
_photos = [] _photos = []
for photo in Tweet.photos: for photo in Tweet.photos:
......
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