beir-cellar / beir

A Heterogeneous Benchmark for Information Retrieval. Easy to use, evaluate your models across 15+ diverse IR datasets.
http://beir.ai
Apache License 2.0
1.54k stars 182 forks source link

Elasticsearch connection error for BM25 #79

Closed jaxball closed 2 years ago

jaxball commented 2 years ago

For all BM25Search instatiations that use Elastic search, I'm getting the following error on both Ubuntu 18.04 and 20.04:

  File "/home/jaxball/anaconda3/envs/pytorch/lib/python3.7/site-packages/elastic_transport/_transport.py", line 334, in perform_request
    request_timeout=request_timeout,
  File "/home/jaxball/anaconda3/envs/pytorch/lib/python3.7/site-packages/elastic_transport/_node/_http_urllib3.py", line 199, in perform_request
    raise err from None
elastic_transport.ConnectionError: Connection error caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7fb774790ed0>: Failed to establish a new connection: [Errno 111] Connection refused)

I simply replaced the hostname with http://localhost:9200 and index name with scifact. This fails for multiple files i.e. evaluate_bm25.py or train_bm25_hardnegs.py so I suspect my ES is not setup correctly. Any ideas how to fix this?

jaxball commented 2 years ago

Looks like this is a duplicate of #4. For those with the same problem, check out the example of starting elasticsearch in BEIR.ipynb. Closing issue.