Reputation: 1833
I'm trying to sync a local SQLite database-entry with an elastic search index.
Here is the view:
def sync_model(request, model_id):
data = create_json(model_id)
es = Elasticsearch(hosts=[{'host': 'my_host', 'port': '9200'}])
res = es.index(index='my_index', doc_type='my_doctype', id=model_id, body=data)
return redirect('/')
And error at line 4:
ConnectionError(: Failed to establish a new connection: getaddrinfo() argument 2 must be integer or string) caused by: NewConnectionError(: Failed to establish a new connection: getaddrinfo() argument 2 must be integer or string)
The put to elastic search works normally. Am I missing knowledge that doesn't allow this behavior inside Django? Any help would be much appreciated
Upvotes: 0
Views: 121