Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elasticsearch With Haystack - failed in connection #15

Open
ShabRa1365 opened this issue Apr 13, 2022 · 1 comment
Open

Elasticsearch With Haystack - failed in connection #15

ShabRa1365 opened this issue Apr 13, 2022 · 1 comment

Comments

@ShabRa1365
Copy link

ShabRa1365 commented Apr 13, 2022

Hi , I am a student in your udemy course and trying to run 09_elastic_in_haystack.ipynb code from QA chapter.
I am using JupyterLab which is connected to my GCP VM- Teslas 100 Debian 9 Linux. I did install Debian version of Elasticsearch . the sample code is here and snapshot or error. I appreciate your support on this
Shabnam

!wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.1.2-linux-x86_64.tar.gz
!wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.1.2-linux-x86_64.tar.gz.sha512
!shasum -a 512 -c elasticsearch-8.1.2-linux-x86_64.tar.gz.sha512 
!tar -xzf elasticsearch-8.1.2-linux-x86_64.tar.gz
!cd elasticsearch-8.1.2/ 


url = """https://rajpurkar.github.io/SQuAD-explorer/dataset/train-v2.0.json"""
!wget -nc -q {url}
url = """https://rajpurkar.github.io/SQuAD-explorer/dataset/dev-v2.0.json"""
!wget -nc -q {url}
import json

with open('dev-v2.0.json', 'r') as f:
    squad = json.load(f)

!pip install pymilvus
import pymilvus

from haystack.document_store.elasticsearch import ElasticsearchDocumentStore


document_store = ElasticsearchDocumentStore(host='localhost', username='', password='', index='squad_docs')



ConnectionError: Initial connection to Elasticsearch failed. Make sure you run an Elasticsearch instance at [{'host': 'localhost', 'port': 9200}] and that it has finished the initial ramp up (can take > 30s).
Screenshot 2022-04-13 at 19 21 48
Screenshot 2022-04-13 at 19 22 05

@jamescalam
Copy link
Owner

It looks like Elasticsearch isn't running, can you try and start it, there's a guide here https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html
Let me know if this doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants