From 557e4f20b6e65e59e6c6d744381f235624c9635b Mon Sep 17 00:00:00 2001 From: Vincent Hagen Date: Fri, 27 Jan 2023 22:19:28 +0100 Subject: [PATCH] Fix infix for place search --- app/Models/Place.php | 1 + app/Services/Places/TypesensePlaceFinder.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Models/Place.php b/app/Models/Place.php index fe5c0da..1286bde 100644 --- a/app/Models/Place.php +++ b/app/Models/Place.php @@ -58,6 +58,7 @@ public function getCollectionSchema(): array [ 'name' => 'name', 'type' => 'string', + 'infix' => true, ], [ 'name' => 'country', diff --git a/app/Services/Places/TypesensePlaceFinder.php b/app/Services/Places/TypesensePlaceFinder.php index 2df2850..83d707b 100644 --- a/app/Services/Places/TypesensePlaceFinder.php +++ b/app/Services/Places/TypesensePlaceFinder.php @@ -24,7 +24,7 @@ public function find(FindPlaceCommand $command): array 'q' => $command->keywords, 'sort_by' => sprintf('_eval(created_by:%d):desc,_text_match:desc', $command->userId), 'query_by' => implode(',', $model->typesenseQueryBy()), - 'infix' => 'fallback' + 'infix' => 'always' ]); return Arrg::map(