Commit e06d1f57 authored by Francesco Poldi's avatar Francesco Poldi

Added Tweet.photos to Elastic #359

parent 1dad52f9
...@@ -30,7 +30,8 @@ PUT twinttweets ...@@ -30,7 +30,8 @@ PUT twinttweets
"search": {"type": "text"}, "search": {"type": "text"},
"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"}
} }
} }
} }
......
...@@ -84,7 +84,8 @@ def createIndex(config, instance, **scope): ...@@ -84,7 +84,8 @@ def createIndex(config, instance, **scope):
"search": {"type": "text"}, "search": {"type": "text"},
"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"}
} }
} }
}, },
...@@ -226,6 +227,11 @@ def Tweet(Tweet, config): ...@@ -226,6 +227,11 @@ def Tweet(Tweet, config):
"near": config.Near "near": config.Near
} }
} }
if Tweet.photos:
_photos = []
for photo in Tweet.photos:
_photos.append(photo)
j_data["_source"].update({"photos": _photos})
if config.Near or config.Geo: if config.Near or config.Geo:
if not _is_near_def: if not _is_near_def:
__geo = "" __geo = ""
......
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