尝试在项目中使用弹性搜索。
from elasticsearch import Elasticsearch
es = Elasticsearch(
"https://example.com",
http_auth=("abc", "bcd"),
)
Run Code Online (Sandbox Code Playgroud)
但出现错误:
ValueError: URL must include a 'scheme', 'host', and 'port' component (ie 'https://localhost:9200')
Run Code Online (Sandbox Code Playgroud)
我在 Pycharm CE 上运行它并创建了 Python 3.9 的虚拟环境。我应该使用不同版本的 Python 来完成这项工作吗?而且,我已经尝试过了pip install acryl-datahub[datahub-rest,elasticsearch]==0.8.27.1,但没有成功。