承接 bytexr/laravel-scout-opensearch 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bytexr/laravel-scout-opensearch

最新稳定版本:v2.2.0

Composer 安装命令:

composer require bytexr/laravel-scout-opensearch

包简介

Laravel Scout OpenSearch Engine

README 文档

README

Total Downloads Latest Stable Version License

Introduction

Laravel Scout OpenSearch simplifies the integration of Laravel Scout with OpenSearch, offering a seamless experience. Additionally, it boasts full compatibility with AWS OpenSearch, enabling hassle-free implementation.

Installation

composer require bytexr/laravel-scout-opensearch

To make the necessary updates, navigate to config/scout.php and add the following code:

return [
    ...

    'opensearch' => [
        'host' => env('OPENSEARCH_HOST', 'https://localhost:9200'),
        'access_key' => env('OPENSEARCH_ACCESS_KEY', 'admin'),
        'secret_key' => env('OPENSEARCH_SECRET_KEY', 'admin'),
        'options' => [
            'ssl_verification' => env('OPENSEARCH_SSL_VERIFICATION', true),
            // Used for AWS
            'sigv4_enabled' => env('OPENSEARCH_SIGV4_ENABLED', false),
            'sigv4_region' =>  env('OPENSEARCH_SIGV4_REGION', 'eu-west-1'),
        ],
    ],

];

Finally, ensure that all required environment variables are set in your .env file, and don't forget to set the SCOUT_DRIVER value to opensearch.

Explicit Mapping

Should you need to specifically define the mapping for your indexes, you can do so by setting the index-settings key in config/scout.php as follows:

return [
    ...
    
    'opensearch' => [
        ...
        'index-settings' => [
            Post::class => [
                'mappings' => [
                    'properties' => [
                        'id' => [
                            'type' => 'text',
                        ],
                        'title' => [
                            'type' => 'text',
                        ],
                    ],
                ],
            ],
        ],
    ]
]

License

Laravel Scout OpenSearch is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 66.22k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-27