From 10f0116468cbb4f0d09070f42ffdf034b34b574a Mon Sep 17 00:00:00 2001 From: Rastislav Chynoransky Date: Fri, 15 Nov 2024 11:44:31 +0700 Subject: [PATCH 1/2] Add location.tree field to items index --- config/elasticsearch/mapping/items.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/elasticsearch/mapping/items.php b/config/elasticsearch/mapping/items.php index 57c0cb447..62a02f122 100644 --- a/config/elasticsearch/mapping/items.php +++ b/config/elasticsearch/mapping/items.php @@ -192,6 +192,12 @@ ], 'location' => [ 'type' => 'keyword', + 'fields' => [ + 'tree' => [ + 'type' => 'text', + 'analyzer' => 'tree_analyzer', + ], + ], ], 'frontend' => [ 'type' => 'keyword', From fda59c6203951bb47a12edc71aeb85a9be4e8f60 Mon Sep 17 00:00:00 2001 From: Rastislav Chynoransky Date: Fri, 15 Nov 2024 11:45:09 +0700 Subject: [PATCH 2/2] Add location.tree to filterable item fields --- app/Http/Controllers/Api/V1/ItemController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Http/Controllers/Api/V1/ItemController.php b/app/Http/Controllers/Api/V1/ItemController.php index c99fbba42..c264fc52d 100644 --- a/app/Http/Controllers/Api/V1/ItemController.php +++ b/app/Http/Controllers/Api/V1/ItemController.php @@ -40,6 +40,7 @@ class ItemController extends Controller 'exhibition', 'box', 'location', + 'location.tree', ]; private $rangeables = ['date_earliest', 'date_latest', 'additionals.order'];