我以前使用Whoosh作为搜索后端,但现在我转而使用elasticsearch,并试图使其正常工作。
当试图重建索引时,我会得到以下错误:
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /_bulk?op_type=create (Caused by <class 'socket.error'>: [Errno 61] Connection refused)在我的settings.py中有以下内容:
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://localhost:8000/',
'INDEX_NAME': 'haystack',
},
}我的问题是,URL是用来做什么的,我在这里放什么?我正在本地运行一些东西以进行开发,并且部署在Heroku上。
发布于 2013-03-28 23:28:06
港口应该是9200。
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',
'INDEX_NAME': 'haystack',
},
}此外,您还必须确保您正在使用的是干草堆的开发版本(2.0)。
编辑:
您可能希望首先通过执行以下命令来确保ElasticSearch正在运行:
curl -XGET 'http://127.0.0.1:9200/my_index/_mapping?pretty=1'https://stackoverflow.com/questions/15692512
复制相似问题