adrema/app/Form/Actions/UpdateParticipantSearchInde...

28 lines
851 B
PHP
Raw Normal View History

<?php
namespace App\Form\Actions;
use App\Form\Models\Form;
use Lorisleiva\Actions\Concerns\AsAction;
class UpdateParticipantSearchIndexAction
{
use AsAction;
public function handle(Form $form): void
{
$form->searchableUsing()->updateIndexSettings(
$form->participantsSearchableAs(),
[
2024-12-12 00:30:59 +01:00
'filterableAttributes' => [...$form->getFields()->filterables()->getKeys(), 'parent-id'],
2024-12-11 22:36:25 +01:00
'searchableAttributes' => $form->getFields()->searchables()->getKeys(),
'sortableAttributes' => [],
2024-12-11 22:36:25 +01:00
'displayedAttributes' => [...$form->getFields()->filterables()->getKeys(), ...$form->getFields()->searchables()->getKeys(), 'id'],
'pagination' => [
'maxTotalHits' => 1000000,
]
]
);
}
}