Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit afa271d

Browse files
committed
refactor(config): Migrate meilisearch.yaml to PHP
1 parent d4e07e7 commit afa271d

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

config/packages/meilisearch.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use App\Entity\Question;
6+
use Symfony\Config\MeilisearchConfig;
7+
8+
use function Symfony\Component\DependencyInjection\Loader\Configurator\env;
9+
10+
return static function (MeilisearchConfig $meiliSearchConfig): void {
11+
$meiliSearchConfig
12+
->url(env('MEILISEARCH_URL'))
13+
->apiKey(env('MEILISEARCH_API_KEY'))
14+
->indices()
15+
->name('questions')
16+
->class(Question::class)
17+
->enableSerializerGroups(true)
18+
->settings([
19+
'filterableAttributes' => [
20+
'type',
21+
'difficulty',
22+
],
23+
'sortableAttributes' => [
24+
'id',
25+
],
26+
]);
27+
};

config/packages/meilisearch.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)