From c44b827922e5843ff1351dfee0b1f9f2dd3abe3e Mon Sep 17 00:00:00 2001 From: Sobuno Date: Thu, 2 Jan 2025 20:03:39 +0100 Subject: [PATCH] Fix environment-based selection of Query Parser --- app/Providers/SearchServiceProvider.php | 4 ++-- config/search.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Providers/SearchServiceProvider.php b/app/Providers/SearchServiceProvider.php index dccd90ddec..944348218d 100644 --- a/app/Providers/SearchServiceProvider.php +++ b/app/Providers/SearchServiceProvider.php @@ -48,8 +48,8 @@ class SearchServiceProvider extends ServiceProvider { $this->app->bind( QueryParserInterface::class, - static function () { - $implementation = env('QUERY_PARSER_IMPLEMENTATION', 'default'); + static function (): GdbotsQueryParser|QueryParser { + $implementation = config('search.query_parser'); return match($implementation) { 'new' => app(QueryParser::class), diff --git a/config/search.php b/config/search.php index 304cd080a0..249fabd363 100644 --- a/config/search.php +++ b/config/search.php @@ -253,4 +253,8 @@ return [ 'destination_balance_lt' => ['alias' => false, 'needs_context' => true], 'destination_balance_is' => ['alias' => false, 'needs_context' => true], ], + /** + * Which query parser to use - 'new' or 'legacy' + */ + 'query_parser' => env('QUERY_PARSER_IMPLEMENTATION', 'legacy'), ];