# Accept new fields

Child route of the settings route.

This setting takes a Boolean value (true or false) and defines whether new fields should be automatically added to the searchable-attributes and the displayed-attributes.

  • If set to true, which is the default value, all new fields are automatically added to the searchable-attributes and the displayed-attributes lists.

  • If set to false, fields are stored but neither searchable nor displayed in returned documents.

TIP

When accept-new-fields is set to false, the fields are still stored. This means you can add them to the searchable attributes list or the displayed attributes list at any time.

The accept-new-fields value can also be updated directly through the global settings route along with the other settings.

::: note
Updating the settings means overwriting the default settings of MeiliSearch. You can reset to default values using the DELETE routes.
:::

Learn more about accept new fields

# Get the accept-new-fields value

GET
/indexes/:index_uid/settings/accept-new-fields

Get if MeiliSearch accepts new fields for an index.

# Path Variables

Variable Description
index_uid The index UID

# Example

# Response: 200 Ok

false

# Update the accept-new-fields value

POST
/indexes/:index_uid/settings/accept-new-fields

Update if MeiliSearch should accepts new fields for an index.

# Path Variables

Variable Description
index_uid The index UID

# Body

This setting takes a Boolean value, true or false, and defaults to true.

If true, each field found in the newly added documents are searchable and displayed in returned documents.

Otherwise, if false, fields are stored but neither searchable nor displayed in returned documents.

More information about the body.

# Example

# Response: 202 Accepted

{
  "updateId": 1
}

This updateId allows you to track the current update.