承接 konsulting/scout-elastic-app-search 相关项目开发

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

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

konsulting/scout-elastic-app-search

Composer 安装命令:

composer require konsulting/scout-elastic-app-search

包简介

Laravel Scount Adapter for Elastic Enterprise App Search

README 文档

README

Integrate Elastic App Search with Laravel Scout.

This is an early but functional version. Tests to be added.

Installation

You can install the package via composer:

composer require konsulting/scout-elastic-app-search

Usage

In order to use the package, you must set Laravel Scout to use the driver

SCOUT_DRIVER=elastic-app-search

Then set up the connection details for Elastic App Search

SCOUT_ELASTIC_APP_SEARCH_ENDPOINT=
SCOUT_ELASTIC_APP_SEARCH_API_KEY=

You will also need to adjust config/scout.php so that the chunk sizes are 100 records:

'chunk' => [
    'searchable' => 100,
    'unsearchable' => 100,
],

Once you have adde the Searchable Trait to your model. You will be able to search with:

 $result = Model::search($searchTerm)->get();

If you wish to have more control over the search, you can extend it in the familiar way with Scout.

 $result = Model::search($searchTerm, function (ElasticAppProxy $elastic, $query, $options) {
    // Adjust the options here
    // E.g. set the search fields in options, and add weightings
    $options['search_fields']['field_name']['weight'] = 1;
   
   // Use filters, and so on
    $options['filters'] = [
        'all' => [
            'name' => 'Konsulting',
            'keyword' => 'Scout',
        ],
    ];

    // Manipulate the position in results
    $options['page']['size'] = $this->limit;
    $options['page']['current'] = $this->currentPage();

    return $elastic->search($query, $options);
})->get();

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email keoghan@klever.co.uk instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固