Connection Timeout with Elasticsearch

前端 未结 9 2064
刺人心
刺人心 2020-12-04 21:01
from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()

doc = {
    \'author\': \'kimchy\',
    \'text\': \'Elasticsearch: cool.          


        
9条回答
  •  臣服心动
    2020-12-04 21:16

    This is nothing to do with increasing your timeout to 30 seconds. Do people actually think that elastic search should need up to 30 seconds to return one tiny hit?

    The way I fixed this problem was go to config/elasticsearch.yml uncomment the following

    http.port: 9200
    network.host: 'localhost' 
    

    Network.host might be set to 192.168.0.1 which might work But I just changed it to 'localhost'

提交回复
热议问题