ElasticSearch not working - Transport Error

1,412 views
Skip to first unread message

Diego Martinez

unread,
Sep 20, 2016, 8:03:16 AM9/20/16
to Wagtail support
Hi everybody:

I have installed ElasticSearch 1.9.0 and Wagtail 1.6 in my virtualenv. in my base.py i added:

WAGTAILSEARCH_BACKENDS = {
    'default': {
        'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
        'URLS': ['http://locahost:9200'],  #i try with localhost:8000, not working too
        'AUTO_UPDATE': False,
        'INDEX': '<nameOfMyProject>',
        'TIMEOUT':5,
    },
}

In the model, i added:

search_fields = (
        index.SearchField('c1_title_fr', partial_match=True, boost=10),
        index.SearchField('c1_subtitle_fr', partial_match=True, boost=10),
        index.SearchField('c2_title_fr', partial_match=True),
        index.SearchField('c2_subtitle_fr', partial_match=True),
        index.SearchField('simulator_title_fr', partial_match=True),
        index.SearchField('simulator_text_fr', partial_match=True),
        index.SearchField('benefits_title_fr', partial_match=True),
        index.SearchField('app_text_fr', partial_match=True),
)

But when i make 'python manage.py update_index', i have this error: 

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

if i change 'URLS' to ['http:localhost:8000] and i make 'runserver' in 8000 port,the error is:
elasticsearch.exceptions.TransportError: TransportError(302, '')

Any idea to solve it?

Thx


Moritz Pfeiffer

unread,
Sep 20, 2016, 8:08:37 AM9/20/16
to Wagtail support
It looks like you installed the elasticsearch bindings.  But did you install and start elasticsearch itself?
To install elasticsearch you basically just have to unzip the package.
To start it in daemon mode run something like this from the command line:
elasticsearch-1.7.5/bin/elasticsearch  -d

Karl Hobley

unread,
Sep 20, 2016, 8:10:36 AM9/20/16
to wag...@googlegroups.com
If you haven't modifed the default configuration, the port should be 9200.

Try running "curl http://localhost:9200" to check if Elasticsearch is running.

--
You received this message because you are subscribed to the Google Groups "Wagtail support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wagtail+unsubscribe@googlegroups.com.
To post to this group, send email to wag...@googlegroups.com.
Visit this group at https://groups.google.com/group/wagtail.
To view this discussion on the web, visit https://groups.google.com/d/msgid/wagtail/aa5dcc27-ba6f-4eea-99b5-398073e9f9a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Diego Martinez

unread,
Sep 20, 2016, 8:27:24 AM9/20/16
to Wagtail support
The service was inactive. now is ok the elasticsearch server,thanks,but i have this error when i make a search:

TransportError(404, 'IndexMissingException[[wagtail] missing]')

i think,the parameter INDEX in WAGTAILSEARCH_BACKENDS is bad. Can you explain me that index name i should put?

Diego Martinez

unread,
Sep 20, 2016, 8:30:47 AM9/20/16
to Wagtail support
i made ./manage.py update_index and is OK, thanks for the responses. 

Reply all
Reply to author
Forward
0 new messages