From 36466420f634b4e53076bec40158f6df078bb7ec Mon Sep 17 00:00:00 2001 From: philipp lang Date: Wed, 11 Dec 2024 22:36:25 +0100 Subject: [PATCH] Lint --- .../Actions/UpdateParticipantSearchIndexAction.php | 6 +++--- app/Form/Data/FieldCollection.php | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/Form/Actions/UpdateParticipantSearchIndexAction.php b/app/Form/Actions/UpdateParticipantSearchIndexAction.php index de4ba4f1..5c75640d 100644 --- a/app/Form/Actions/UpdateParticipantSearchIndexAction.php +++ b/app/Form/Actions/UpdateParticipantSearchIndexAction.php @@ -14,10 +14,10 @@ class UpdateParticipantSearchIndexAction $form->searchableUsing()->updateIndexSettings( $form->participantsSearchableAs(), [ - 'filterableAttributes' => $form->getFields()->getKeys(), - 'searchableAttributes' => $form->getFields()->getKeys(), + 'filterableAttributes' => $form->getFields()->filterables()->getKeys(), + 'searchableAttributes' => $form->getFields()->searchables()->getKeys(), 'sortableAttributes' => [], - 'displayedAttributes' => [...$form->getFields()->getKeys(), 'id'], + 'displayedAttributes' => [...$form->getFields()->filterables()->getKeys(), ...$form->getFields()->searchables()->getKeys(), 'id'], 'pagination' => [ 'maxTotalHits' => 1000000, ] diff --git a/app/Form/Data/FieldCollection.php b/app/Form/Data/FieldCollection.php index dfcc3e94..302aa612 100644 --- a/app/Form/Data/FieldCollection.php +++ b/app/Form/Data/FieldCollection.php @@ -118,6 +118,16 @@ class FieldCollection extends Collection return $this->first(fn ($field) => $field->specialType === $specialType); } + public function searchables(): self + { + return $this; + } + + public function filterables(): self + { + return $this; + } + /** * @return array */