> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Troubleshooting your Algolia Symfony implementation.

## No `serializer` service found

The bundle requires `symfony/serializer`, which is installed as a Composer dependency.
However, the `serializer` service alias is only registered when `framework-bundle` enables it.
If your app doesn't enable the framework-bundle serializer, add the following to `config/packages/framework.yaml`:

```yaml YAML icon=code theme={"system"}
framework:
  serializer:
    enabled: true
```

In most cases, it's better to let the framework-bundle register the serializer for you rather than defining the service by hand.

## The `Groups` attribute wasn't taken into account

If your `#[Groups(['searchable'])]` attributes aren't being applied at index time, check these in order:

1. **The bundle's per-index serializer-groups flag is on.** This is the most common cause:it defaults to `false`. Set it in your `algolia_search` configuration:

```yaml YAML icon=code theme={"system"}
algolia_search:
  indices:
    - name: posts
      class: App\Entity\Post
      enable_serializer_groups: true
```

Without this flag, the bundle normalizes entities without passing the `searchable` group to the Symfony serializer, so `#[Groups]` filtering never activates.

2. **Symfony attribute serialization is enabled.** This is the default on Symfony 7 and later. If your app explicitly turns it off, turn it on in `config/packages/framework.yaml`:

```yaml YAML icon=code theme={"system"}
framework:
  serializer:
    enable_attributes: true
```

3. **The `#[Groups]` attribute uses the current namespace.** Import `Symfony\Component\Serializer\Attribute\Groups`, not the legacy `Annotation\Groups`.
