Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I used to be using Whoosh as a search backend but now I'm switching to elasticsearch and trying to get things working.

When trying to rebuild the index I get the error:

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)

The following is in my settings.py:

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
        'URL': 'http://localhost:8000/',
        'INDEX_NAME': 'haystack',
    },
}

My question is, what is URL used for and what do I put here? I'm running things locally for development and I'm deployed on Heroku.

share|improve this question
the default port for ES is 9200. so unless you reconfigured it to 8000, just switch your port number. – Al W Mar 28 at 23:35

1 Answer

The port should be 9200.

HAYSTACK_CONNECTIONS = {
'default': {
        'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
        'URL': 'http://127.0.0.1:9200/',
        'INDEX_NAME': 'haystack',
    },
}

Also, you have to be sure that you are using the development version (2.0) of haystack.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.