You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from elasticsearch import Elasticsearch
es = Elasticsearch()
result = es.indices.create(index='news',ignore=400)
print(result)
上面的会报错:
ValueError: Either 'hosts' or 'cloud_id' must be specified
然后,当我这么写就不报错了
from elasticsearch import Elasticsearch
es = Elasticsearch(hosts='https://localhost:9200/')
result = es.indices.create(index='news',ignore=400)
print(result)
from elasticsearch import Elasticsearch
es = Elasticsearch(hosts='https://localhost:9200',verify_certs=False/)
result = es.indices.create(index='news',ignore=400)
print(result)
就会有新的错误:
elasticsearch.AuthenticationException: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/news]')
我是第一次接触elasticsearch,这些问题我没能找到解决办法,所以向您求助。
谢谢!
The text was updated successfully, but these errors were encountered:
@Germey hello,我在您python3网络爬虫开发实战第二版中,在4.7 elasticsearch这一章学习过程中,发现一些问题,可能是因为版本更新的原因,例如:
上面的会报错:
然后,当我这么写就不报错了
但是,又出现这样的错误:
然后,这么修改一下:
就会有新的错误:
我是第一次接触elasticsearch,这些问题我没能找到解决办法,所以向您求助。
谢谢!
The text was updated successfully, but these errors were encountered: