【问题标题】:How to upload documents to AWS CloudSearch with Boto3如何使用 Boto3 将文档上传到 AWS CloudSearch
【发布时间】:2020-02-27 19:54:47
【问题描述】:

所以我不确定如何指向正确的域:

boto3.client('cloudsearchdomain').upload_documents(file, type)

documentation 表示使用 CloudSearch DescribeDomains 操作配置域。

但是,documentation for CloudSearch 只列出了一个方法,describe_domains,它只列出了域、信息等。

如何指向正确的域以将文档上传到 CloudSearch?

【问题讨论】:

    标签: amazon-web-services boto3 amazon-cloudsearch


    【解决方案1】:

    初始化客户端时,使用kwarg endpoint_url ->

    boto3.client('cloudsearchdomain', endpoint_url="http://search.example.cloudsearch.aws")
    

    【讨论】:

    • 请注意,虽然 boto3.client('cloudsearch').describe_domains() 会为您提供端点,但您需要向其添加“http://”,否则它只会抱怨它没有'不存在。
    猜你喜欢
    • 2023-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-05
    • 1970-01-01
    相关资源
    最近更新 更多