From ab15b6a31bcd4598e22ab31ce33de9eaec1e9ebf Mon Sep 17 00:00:00 2001 From: rodzy Date: Wed, 18 Nov 2020 20:33:11 +0000 Subject: [PATCH 1/3] Added scouting libraries --- composer.json | 4 +- composer.lock | 137 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 139 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 9a739c4..3b3ae7c 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,9 @@ "type": "project", "require": { "php": "^7.3|^8.0", - "laravel/lumen-framework": "^8.0" + "laravel/lumen-framework": "^8.0", + "laravel/scout": "^8.4", + "pmatseykanets/laravel-scout-postgres": "^7.2" }, "require-dev": { "fzaninotto/faker": "^1.9.1", diff --git a/composer.lock b/composer.lock index 28eff64..399a06f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "65147f604b64322725f0c88e75fb4cac", + "content-hash": "32e8a9ab530fa23d268acf5e217d221d", "packages": [ { "name": "brick/math", @@ -1955,6 +1955,76 @@ }, "time": "2020-11-17T16:42:41+00:00" }, + { + "name": "laravel/scout", + "version": "v8.4.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/scout.git", + "reference": "1241ecf4e876b8fcb8311160b471e6915bc1ab66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/scout/zipball/1241ecf4e876b8fcb8311160b471e6915bc1ab66", + "reference": "1241ecf4e876b8fcb8311160b471e6915bc1ab66", + "shasum": "" + }, + "require": { + "illuminate/bus": "^6.0|^7.0|^8.0", + "illuminate/contracts": "^6.0|^7.0|^8.0", + "illuminate/database": "^6.0|^7.0|^8.0", + "illuminate/http": "^6.0|^7.0|^8.0", + "illuminate/pagination": "^6.0|^7.0|^8.0", + "illuminate/queue": "^6.0|^7.0|^8.0", + "illuminate/support": "^6.0|^7.0|^8.0", + "php": "^7.2" + }, + "require-dev": { + "algolia/algoliasearch-client-php": "^2.2", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^8.0|^9.3" + }, + "suggest": { + "algolia/algoliasearch-client-php": "Required to use the Algolia engine (^2.2)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Scout\\ScoutServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Scout\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel Scout provides a driver based solution to searching your Eloquent models.", + "keywords": [ + "algolia", + "laravel", + "search" + ], + "support": { + "issues": "https://github.com/laravel/scout/issues", + "source": "https://github.com/laravel/scout" + }, + "time": "2020-10-20T18:44:35+00:00" + }, { "name": "monolog/monolog", "version": "2.1.1", @@ -2327,6 +2397,71 @@ ], "time": "2020-07-20T17:29:33+00:00" }, + { + "name": "pmatseykanets/laravel-scout-postgres", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/pmatseykanets/laravel-scout-postgres.git", + "reference": "12b1ff57d9b7262cb60ef7d13860733cebd51ba8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pmatseykanets/laravel-scout-postgres/zipball/12b1ff57d9b7262cb60ef7d13860733cebd51ba8", + "reference": "12b1ff57d9b7262cb60ef7d13860733cebd51ba8", + "shasum": "" + }, + "require": { + "illuminate/contracts": "~6.0|~7.0|~8.0", + "illuminate/database": "~6.0|~7.0|~8.0", + "illuminate/support": "~6.0|~7.0|~8.0", + "laravel/scout": "~7.0|~8.0", + "php": "^7.2" + }, + "require-dev": { + "mockery/mockery": "^1.2.3", + "phpunit/phpunit": "^8.3" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "ScoutEngines\\Postgres\\PostgresEngineServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "ScoutEngines\\Postgres\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Peter Matseykanets", + "email": "pmatseykanets@gmail.com", + "homepage": "https://github.com/pmatseykanets" + } + ], + "description": "PostgreSQL Full Text Search Driver for Laravel Scout", + "homepage": "https://github.com/pmatseykanets/laravel-scout-postgres", + "keywords": [ + "fts", + "full text search", + "laravel", + "laravel scout", + "postgresql", + "search" + ], + "support": { + "issues": "https://github.com/pmatseykanets/laravel-scout-postgres/issues", + "source": "https://github.com/pmatseykanets/laravel-scout-postgres" + }, + "time": "2020-09-24T04:14:32+00:00" + }, { "name": "psr/container", "version": "1.0.0", From 818642d7dba319a9aa029c4a98c062445660c98c Mon Sep 17 00:00:00 2001 From: rodzy Date: Wed, 18 Nov 2020 20:50:02 +0000 Subject: [PATCH 2/3] Configured laravel scout --- bootstrap/app.php | 8 ++++++-- config/scout.php | 12 ++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 config/scout.php diff --git a/bootstrap/app.php b/bootstrap/app.php index 4808f2c..f5833fa 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -1,6 +1,6 @@ configure('app'); +$app->configure('scout'); /* |-------------------------------------------------------------------------- @@ -95,6 +96,9 @@ // $app->register(App\Providers\AuthServiceProvider::class); // $app->register(App\Providers\EventServiceProvider::class); +$app->register(Laravel\Scout\ScoutServiceProvider::class); +$app->register(ScoutEngines\Postgres\PostgresEngineServiceProvider::class); + /* |-------------------------------------------------------------------------- | Load The Application Routes @@ -109,7 +113,7 @@ $app->router->group([ 'namespace' => 'App\Http\Controllers', ], function ($router) { - require __DIR__.'/../routes/web.php'; + require __DIR__ . '/../routes/web.php'; }); return $app; diff --git a/config/scout.php b/config/scout.php new file mode 100644 index 0000000..4fefa0c --- /dev/null +++ b/config/scout.php @@ -0,0 +1,12 @@ + env('SCOUT_DRIVER', 'pgsql'), + 'prefix' => env('SCOUT_PREFIX', ''), + 'queue' => false, + 'pgsql' => [ + 'connection' => 'pgsql', + 'maintain_index' => true, + 'config' => 'english', + ], +]; From 9a6cee3db94779057a6850518676dd51b49c1e86 Mon Sep 17 00:00:00 2001 From: rodzy Date: Wed, 18 Nov 2020 23:01:47 +0000 Subject: [PATCH 3/3] Updated scouting configuration --- config/scout.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/scout.php b/config/scout.php index 4fefa0c..e3b3d3a 100644 --- a/config/scout.php +++ b/config/scout.php @@ -1,6 +1,10 @@ env('DB_CONNECTION', 'pgsql'), + 'maintain_index' => true, + 'config' => 'english', + 'search_using' => 'tsquery', 'driver' => env('SCOUT_DRIVER', 'pgsql'), 'prefix' => env('SCOUT_PREFIX', ''), 'queue' => false,