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

# Configure displayed attributes

> Choose which document fields appear in search results by setting the displayedAttributes index setting.

By default, all fields in a document are **displayed** in search results. Use `displayedAttributes` to control which fields are returned when a document matches a query.

Fields not listed in `displayedAttributes` are still stored in the database and remain [searchable](/capabilities/full_text_search/how_to/configure_searchable_attributes) if configured. You can add them back to the displayed list at any time.

## Set displayed attributes

Suppose you manage a movies database and only want search results to show the title, overview, release date, and genres:

<CodeGroup>
  ```bash cURL theme={null}
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movies/settings/displayed-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
        "title",
        "overview",
        "genres",
        "release_date"
      ]'
  ```

  ```javascript JS theme={null}
  client.index('movies').updateDisplayedAttributes([
      'title',
      'overview',
      'genres',
      'release_date',
    ]
  )
  ```

  ```python Python theme={null}
  client.index('movies').update_displayed_attributes([
      'title',
      'overview',
      'genres',
      'release_date'
  ])
  ```

  ```php PHP theme={null}
  $client->index('movies')->updateDisplayedAttributes([
    'title',
    'overview',
    'genres',
    'release_date'
  ]);
  ```

  ```java Java theme={null}
  String[] attributes = {"title", "overview", "genres", "release_date"}
  client.index("movies").updateDisplayedAttributesSettings(attributes);
  ```

  ```ruby Ruby theme={null}
  client.index('movies').update_settings({
    displayed_attributes: [
      'title',
      'overview',
      'genres',
      'release_date'
    ]
  })
  ```

  ```go Go theme={null}
  displayedAttributes := []string{
    "title",
    "overview",
    "genres",
    "release_date",
  }
  client.Index("movies").UpdateDisplayedAttributes(&displayedAttributes)
  ```

  ```csharp C# theme={null}
  await client.Index("movies").UpdateDisplayedAttributesAsync(new[]
  {
      "title",
      "overview",
      "genres",
      "release_date"
  });
  ```

  ```rust Rust theme={null}
  let displayed_attributes = [
    "title",
    "overview",
    "genres",
    "release_date"
  ];

  let task: TaskInfo = client
    .index("movies")
    .set_displayed_attributes(&displayed_attributes)
    .await
    .unwrap();
  ```

  ```swift Swift theme={null}
  let displayedAttributes: [String] = [
      "title",
      "overview",
      "genres",
      "release_date"
  ]
  client.index("movies").updateDisplayedAttributes(displayedAttributes) { (result) in
      switch result {
      case .success(let task):
          print(task)
      case .failure(let error):
          print(error)
      }
  }
  ```

  ```dart Dart theme={null}
  await client.index('movies').updateDisplayedAttributes([
    'title',
    'overview',
    'genres',
    'release_date',
  ]);
  ```
</CodeGroup>

With this configuration, fields like `id`, `poster_url`, or `internal_rating` are excluded from search results even if they exist in the document.

## When to limit displayed attributes

* **Performance**: reducing the number of displayed fields makes response payloads smaller, especially when documents contain large text fields or many attributes
* **Security**: hide internal fields (admin notes, cost prices, internal IDs) from the search response without removing them from the index
* **Clarity**: return only the fields your UI needs, reducing frontend parsing work

## Reset displayed attributes

To restore the default behavior (all fields displayed), reset the setting:

<CodeGroup>
  ```bash theme={null}
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies/settings/displayed-attributes' \
    -H 'Authorization: Bearer MEILISEARCH_KEY'
  ```
</CodeGroup>

<Note>
  All fields are always stored in the database regardless of display settings. Making a field non-displayed does not delete it. You can also use `attributesToRetrieve` at search time to limit which displayed fields are returned for a specific query, without changing the index setting.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="Configure searchable attributes" href="/capabilities/full_text_search/how_to/configure_searchable_attributes">
    Control which fields are searched and their ranking priority
  </Card>

  <Card title="Highlight search results" href="/capabilities/full_text_search/how_to/highlight_search_results">
    Show matched terms in the displayed fields
  </Card>
</CardGroup>
