I have created a python tweepy script and it's all working fine loading data into elastic search.
I recentyl added functionality to get coordinates from tweets and am having a struggle trying to add it to my map
here's what i have :
mapping={
"twitter-map": {
"properties": {
"author":{"type": "string"},
"date":{"type": "date","format": "EEE MMM dd HH:mm:ss Z yyyy"},
"message":{"type": "string", "index": "not_analyzed"},
"urls":{"type": "string", "index": "not_analyzed"},
"hashtags":{"type": "string", "index": "not_analyzed"},
"url_keywords":{"type": "string", "index": "not_analyzed"},
"title":{"type": "string", "index": "not_analyzed"},
"summary":{"type": "string", "index": "not_analyzed"},
"location":{"type": "geo_point"},
}
}
}
es.indices.put_mapping(index="fin-tech",doc_type="twitter-map",body=mapping)
content={"author":dict_data["user"]["screen_name"],
"date":dict_data["created_at"],
"message": dict_data["text"],
"urls":[url["expanded_url"]for url in dict_data["entities"]["urls"]],
"hashtags":[hashtag['text']for hashtag in dict_data["entities"]["hashtags"]],
"location":dict_data["user"]["location"],
"url_keywords":keywords,
"title":title,
"summary":summary,
"location":coord}
when executing the python script i get : lasticsearch.exceptions.RequestError: TransportError(400, 'illegal_argument_exception', 'mapper [location] of different type, current_type [string], merged_type [geo_point]')
Surans-Mac-Pro:twitter surankularatna$ vi stream_data_fintech.py
any ideas?