Commit 48884d76 authored by Francesco Poldi's avatar Francesco Poldi

Added near attribute to ES

parent b5c093b4
...@@ -36,6 +36,7 @@ PUT twinttweets ...@@ -36,6 +36,7 @@ PUT twinttweets
"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"}
} }
} }
} }
......
...@@ -62,3 +62,4 @@ class Config: ...@@ -62,3 +62,4 @@ class Config:
Query = None Query = None
Hide_output = False Hide_output = False
Get_replies = False Get_replies = False
Near = ""
...@@ -28,7 +28,7 @@ def handleIndexResponse(response): ...@@ -28,7 +28,7 @@ def handleIndexResponse(response):
else: else:
print("[x] error with shards :: storage.elasticsearch.HandleIndexCreation") print("[x] error with shards :: storage.elasticsearch.HandleIndexCreation")
return False return False
def createIndex(config, instance, **scope): def createIndex(config, instance, **scope):
if scope.get("scope") == "tweet": if scope.get("scope") == "tweet":
tweets_body = { tweets_body = {
...@@ -68,6 +68,7 @@ def createIndex(config, instance, **scope): ...@@ -68,6 +68,7 @@ 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"}
} }
} }
}, },
...@@ -211,7 +212,8 @@ def Tweet(Tweet, config): ...@@ -211,7 +212,8 @@ def Tweet(Tweet, config):
"quote_id": Tweet.quote_id, "quote_id": Tweet.quote_id,
"quote_id_str": Tweet.quote_id_str, "quote_id_str": Tweet.quote_id_str,
"quote_url": Tweet.quote_url, "quote_url": Tweet.quote_url,
"search": str(config.Search) "search": str(config.Search),
"near": config.Near
} }
} }
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