Skip to main content
  • Type: list<string>
  • Default: ["*"]
  • Scope: search,settings
  • Deprecated name: attributes
This parameter controls which attributes are included with each record in the search response. Retrieving only the necessary attributes can reduce record size, improve search performance, and speed up network transfers. Use this parameter when you don’t need all attributes—for example, to exclude internal metadata or large, unnecessary fields.

Usage

  • Attribute names are case-sensitive.
  • objectID is always retrieved, even when not specified.
  • Use * to include all attributes.
  • Use -attributeName (combined with *) to exclude specific attributes. This can be useful if you want to hide sensitive data—for example, if you don’t want to expose your custom ranking attributes.
  • Attributes listed in unretrievableAttributes are never retrieved unless the request is authenticated with the Admin API key.
  • Nested attributes are supported. For example, author.name returns: {"author": {"name": "Agatha Christie"}}.
There’s no hard limit on the number of attributes you can include, but adding too many can slow down getSettings operations and degrade performance in the Algolia dashboard.

Examples

Current API clients

Set default list of retrievable attributes

var response = await client.SetSettingsAsync(
  "ALGOLIA_INDEX_NAME",
  new IndexSettings
  {
    AttributesToRetrieve = new List<string> { "author", "title", "content" },
  }
);

Make all attributes as retrievable by default

var response = await client.SetSettingsAsync(
  "ALGOLIA_INDEX_NAME",
  new IndexSettings { AttributesToRetrieve = new List<string> { "*" } }
);
var response = await client.SearchSingleIndexAsync<Hit>(
  "ALGOLIA_INDEX_NAME",
  new SearchParams(
    new SearchParamsObject
    {
      Query = "query",
      AttributesToRetrieve = new List<string> { "title", "content" },
    }
  )
);

Specify some attributes not to retrieve

Retrieve all attributes of an item except for its SKU and internal description.
var response = await client.SetSettingsAsync(
  "ALGOLIA_INDEX_NAME",
  new IndexSettings
  {
    AttributesToRetrieve = new List<string> { "*", "-SKU", "-internal_desc" },
  }
);

Set default list of retrievable attributes

IndexSettings settings = new IndexSettings
{
    AttributesToRetrieve = new List { "author", "title", "content" }
};

Make all attributes as retrievable by default

IndexSettings settings = new IndexSettings
{
    AttributesToRetrieve = new List { "*" }
};

Override default list of retrievable attributes for the current search

index.Search(new Query("query")
{
    AttributesToRetrieve = new List{ "title", "content" }
});

Specify some attributes not to retrieve

Retrieve all attributes of an item except for its SKU and internal description.
IndexSettings settings = new IndexSettings
{
    AttributesToRetrieve = new List { "*", "-SKU", "-internal_desc" }
};
I