Skip to content

Cannot define "indices.settings" of MeilisearchConfig with PHP #369

@pan93412

Description

@pan93412

Description

I am migrating my Symfony configuration to use a type-safe PHP-based ConfigBuilder.

However, there seems to be a problem with the definition of the Meilisearch configuration, which causes the following code to not work:

$meiliSearchConfig
    ->indices()
        ->settings([
            'filterableAttributes' => [
                'type',
                'difficulty',
            ],
            'sortableAttributes' => [
                'id',
            ],
        ]);

The error message states:

The following keys are not supported by "Symfony\Config\MeiliSearch\IndicesConfig\SettingsConfig": filterableAttributes, sortableAttributes  

Expected behavior

I should be able to define settings as I did in my YAML configuration.

meilisearch:
  indices:
    - settings:
        filterableAttributes:
          - type
          - difficulty
        sortableAttributes:
          - id

Current behavior

In FileLoader.php line 177:
                                                                                                                                                                                  
  The following keys are not supported by "Symfony\Config\MeiliSearch\IndicesConfig\SettingsConfig": filterableAttributes, sortableAttributes in /Volumes/Dev/ResearchProject/lets-php/app-sf/config/packages/meilisearch.php (which is being imported from "/Volumes/Dev/ResearchProject/lets-php/app-sf/src/Kernel.php").                                     
                                                                                                                                                                                  

In SettingsConfig.php line 16:
                                                                                                                                               
  The following keys are not supported by "Symfony\Config\MeiliSearch\IndicesConfig\SettingsConfig": filterableAttributes, sortableAttributes  

Screenshots or Logs

CleanShot 2024-12-03 at 11 09 19@2x

Environment (please complete the following information):

  • OS: macOS
  • Meilisearch version: N/A
  • meilisearch-symfony version: dev-main (d46b2da)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions