使用Symfony 5和AWS Elasticsearch进行FOSElastica捆绑配置

ovfsdjhp  于 2023-06-29  发布在  ElasticSearch
关注(0)|答案(2)|浏览(103)

我正在尝试使用FOSElasticaBundle(版本v6.0.0-beta4)连接到AWS Elasticsearch域。根据文档,这个包使用ruflin/Elastica包。在研究了这里的文档和相关问题后,我可以找到一些我实现的示例和配置,但是,我得到了一个与elastica配置相关的错误。我的配置:

//config/packages/fos_elastica.yaml

fos_elastica:
    clients:
        default:
            url: 'aws-elasticsearch-domain-url'
            aws_access_key_id: 'access-key'
            aws_secret_access_key: 'secret-key'
            aws_region: "aws-region"
            transport: "AwsAuthV4"
    indexes:
        (indexes configuration...)

在填充索引时,我得到了与AwsAuthV 4传输参数相关的错误:

In AwsAuthV4.php line 43:
                                                                         
  Attempted to load class "SignatureV4" from namespace "Aws\Signature".  
  Did you forget a "use" statement for another namespace?

我不确定这是否不受支持、配置不正确或其他原因。

zc0qhyus

zc0qhyus1#

请确保在使用FOSElasticaBundle时,您还安装了名为aws/aws-sdk-php的软件包。这个包将保证类Aws\Signature\SignatureV4也将被加载。
如果你仍然有这个问题,记得在控制台中执行composer dump-autoload

xeufq47z

xeufq47z2#

@Eddy是现有的elastica捆绑工程AWS opensearch?

相关问题