Skip to content

Elasticsearch With Haystack - failed in connection #15

Description

@ShabRa1365

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions