liberation / django-elasticsearch

Simple wrapper around elasticsearch-py to index/search a django Model.
MIT License
212 stars 73 forks source link

ConnectionError: exception while running queryset on elasticsearch #74

Closed sunnychaudhari closed 7 years ago

sunnychaudhari commented 7 years ago

Hi, I followed the same steps mentioned in given readme.md file

Here is my model:

from django.db import models
from django_elasticsearch.models import EsIndexable

class Product(EsIndexable, models.Model):
    product_name = models.CharField(max_length=100)
    slug = models.SlugField(max_length=100)

After this as per mentioned in steps I did this in python shell

>>> q = Product.es.search('sample')
>>> q

and I got this error in shell

ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection 
object at 0x10828e250>: Failed to establish a new connection: [Errno 
61] Connection refused) caused by: 
NewConnectionError(<urllib3.connection.HTTPConnection object at 
0x10828e250>: Failed to establish a new connection: [Errno 61] 
Connection refused)

What is that I'm missing and how do I proceed now, so that I should get resultant array

lauxley commented 7 years ago

It looks like either Elasticsearch is not running or not reachable, see https://www.elastic.co/guide/en/elasticsearch/reference/2.0/setup.html.