English 中文(简体)
数值: URL必须包括一个计划、东道机构和港口部分
原标题:ValueError: URL must include a scheme , host , and port component

利用弹性搜索项目。

from elasticsearch import Elasticsearch
es = Elasticsearch(
    "https://example.com",
    http_auth=("abc", "bcd"),
)

但出现错误:

ValueError: URL must include a  scheme ,  host , and  port  component (ie  https://localhost:9200 )

I am running this on Pycharm CE and have created a Virtual Environment of Python 3.9 . Should I be using a different version of Python to make this work?? Moreover, I have already tried pip install acryl-datahub[datahub-rest,elasticsearch]==0.8.27.1 but to no avail.

问题回答

我正面临同样的错误。 第7.17版的拖延解决了这一问题。 我还在<代码>pip安装一个cr基-datahub[数据hub-rest,elgalsearch]=0.8.27.1上找不到。 紧随其后的版本(0.8.28.0)之后,将其降级为<条码>。

因此,<代码>pip安装弹性研究=7.17。

ings.py中使用这些代码。 帮助我避免这一错误。

ELK_BASE_URL =  elasticsearch://{username}:{password}@{host_ip}:{host_port} 
ELASTIC_SEARCH_URL = ELK_BASE_URL.format(
    username= ELASTICSEARCH_USER ,
    password= ELASTICSEARCH_PASS ,
    host_ip= elasticsearch , #  elasticsearch  - service name in docker-compose.yml
    host_port= 9200 
)
    
ELASTICSEARCH_DSL = {
     default : {
         hosts : [ELASTIC_SEARCH_URL]
    },
}

或者你可以使用:

ELASTICSEARCH_DSL = {
         default : {
             hosts :  http://elasticsearch:9200  # same as above
        },
}

页: 1





相关问题
Roll over index with elastic search and serilog

We are using es 6.7 and serilog 7.1 in our dotnet core application. In our logger implementation vi are using the following index "app-{0:yyyy.MM}-1" for our ElasticsearchSinkOptions. This ...

Change the date format in kibana

I am working for my internship on the implementation of the ElasticSearch family (ElasticSearch+ Kibana+ logstash). Here is my question: I have a field "@ timestamp" with the following format: 2014-05-...

热门标签