u12206050/elastic-app-scout-driver

Elastic app search driver for Laravel Scout

0.1.0 2020-09-30 13:27 UTC

This package is not auto-updated.

Last update: 2024-04-27 00:25:41 UTC


README

logo.png

68747470733a2f2f706f7365722e707567782e6f72672f7531323230363035302f656c61737469632d6170702d73636f75742d6472697665722f762f737461626c65 68747470733a2f2f706f7365722e707567782e6f72672f7531323230363035302f656c61737469632d6170702d73636f75742d6472697665722f646f776e6c6f616473 68747470733a2f2f706f7365722e707567782e6f72672f7531323230363035302f656c61737469632d6170702d73636f75742d6472697665722f6c6963656e7365 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d70617970616c2d626c7565

Elastic App Search driver for Laravel Scout.

Contents

Compatibility

The current version of Elastic App Scout Driver has been tested with the following configuration:

  • PHP 7.2-7.4
  • Elasticsearch 7.0-7.6
  • Laravel 6.x-7.x
  • Laravel Scout 7.x-8.x

Requirements

  • Laravel Scout
  • Elasticsearch 7.0-7.6
  • App Search 7.0-7.6

Installation

The library can be installed via Composer:

composer require u12206050/elastic-app-scout-driver

Configuration

Change the driver option in the config/scout.php file to elastic_app

php artisan vendor:publish --provider="ElasticAppScoutDriver\ServiceProvider"

Add your Elastic App Search url and key to you .env file

ELASTIC_APP_ENDPOINT=
ELASTIC_APP_KEY=

Basic usage

This driver uses Elastic App Search Meaning you can have alot more flexible where clauses available READ MORE

$orders = App\Order::search('')->where('created_at', [
    'from' => '2020-01-01T12:00:00+00:00',
    'to' => '2020-12-31T12:00:00+00:00'
]);

When the query string is omitted, then all records are returned.

$orders = App\Order::search()->where('user_id', 1)->get();

Please refer to the official Laravel Scout documentation and the app search api for more details and usage examples.

Maintain

All PRs and RFCs are very welcome.