Commit aec43fa4 authored by Francesco Poldi's avatar Francesco Poldi

Added geopoint for user based on location

parent 343bd2bf
...@@ -37,7 +37,7 @@ PUT twinttweets ...@@ -37,7 +37,7 @@ PUT twinttweets
"quote_url": {"type": "text"}, "quote_url": {"type": "text"},
"search": {"type": "text"}, "search": {"type": "text"},
"near": {"type": "text"}, "near": {"type": "text"},
"geo_point": {"type": "geopoint"} "geo_tweet": {"type": "geopoint"}
} }
} }
} }
......
...@@ -21,7 +21,8 @@ PUT twintuser ...@@ -21,7 +21,8 @@ PUT twintuser
"verified": {"type": "integer"}, "verified": {"type": "integer"},
"avatar": {"type": "text"}, "avatar": {"type": "text"},
"background_image": {"type": "text"}, "background_image": {"type": "text"},
"session": {"type": "keyword"} "session": {"type": "keyword"},
"geo_user": {"type": "geopoint"}
} }
} }
} }
......
...@@ -77,7 +77,8 @@ def createIndex(config, instance, **scope): ...@@ -77,7 +77,8 @@ def createIndex(config, instance, **scope):
"quote_id_str": {"type": "text"}, "quote_id_str": {"type": "text"},
"quote_url": {"type": "text"}, "quote_url": {"type": "text"},
"search": {"type": "text"}, "search": {"type": "text"},
"near": {"type": "text"} "near": {"type": "text"},
"geo_tweet": {"type": "geopoint"}
} }
} }
}, },
...@@ -129,7 +130,8 @@ def createIndex(config, instance, **scope): ...@@ -129,7 +130,8 @@ def createIndex(config, instance, **scope):
"verified": {"type": "integer"}, "verified": {"type": "integer"},
"avatar": {"type": "text"}, "avatar": {"type": "text"},
"background_image": {"type": "text"}, "background_image": {"type": "text"},
"session": {"type": "keyword"} "session": {"type": "keyword"},
"geo_user": {"type": "geopoint"}
} }
} }
}, },
...@@ -225,7 +227,7 @@ def Tweet(Tweet, config): ...@@ -225,7 +227,7 @@ def Tweet(Tweet, config):
"quote_url": Tweet.quote_url, "quote_url": Tweet.quote_url,
"search": str(config.Search), "search": str(config.Search),
"near": config.Near, "near": config.Near,
"geo_point": location "geo_tweet": location
} }
} }
actions.append(j_data) actions.append(j_data)
...@@ -264,6 +266,8 @@ def UserProfile(user, config): ...@@ -264,6 +266,8 @@ def UserProfile(user, config):
global _index_user_status global _index_user_status
actions = [] actions = []
location = getLocation(config.Location)
j_data = { j_data = {
"_index": config.Index_users, "_index": config.Index_users,
"_type": config.Index_type, "_type": config.Index_type,
...@@ -287,7 +291,8 @@ def UserProfile(user, config): ...@@ -287,7 +291,8 @@ def UserProfile(user, config):
"verified": user.is_verified, "verified": user.is_verified,
"avatar": user.avatar, "avatar": user.avatar,
"background_image": user.background_image, "background_image": user.background_image,
"session": config.Essid "session": config.Essid,
"geo_user": location
} }
} }
actions.append(j_data) actions.append(j_data)
......
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