## Documentation Index

Fetch the complete documentation index at: [/llms.txt](/content/llms.txt)

Use this file to discover all available pages before exploring further.

- **Type:** `list<string>`
- **Default:** `[]` (no excluded attributes)
- **Scope:** [`settings`](/content/doc/api-reference/api-parameters/index.html)

The `unretrievableAttributes` setting specifies attributes in your records to exclude from search results. This can help protect sensitive information, such as internal metrics or access controls, which may be used for ranking or filtering but shouldn’t be visible to end users.

There’s no hard limit on the number of attributes you can include, but adding too many can slow down [`getSettings`](/content/doc/rest-api/search/get-settings/index.html) operations and degrade performance in the Algolia dashboard.

## Usage

- Attribute names are case-sensitive.
- This setting is ignored if the query is authenticated with the **Admin API key**.

## Example

Current API clients

C#

Dart

Go

Java

JavaScript

Kotlin

PHP

Python

Ruby

Scala

Swift

```
var response = await client.SetSettingsAsync(
  "INDEX_NAME",
  new IndexSettings { UnretrievableAttributes = new List<string> { "visible_by" } }
);
```

```
final response = await client.setSettings(
  indexName: "INDEX_NAME",
  indexSettings: IndexSettings(
    unretrievableAttributes: ["visible_by"],
  ),
);
```

```
response, err := client.SetSettings(client.NewApiSetSettingsRequest(
  "INDEX_NAME",
  search.NewEmptyIndexSettings().SetUnretrievableAttributes(
    []string{"visible_by"}))
)
if err != nil {
  // handle the eventual error
  panic(err)
}
```

```
UpdatedAtResponse response = client.setSettings(
  "INDEX_NAME",
  new IndexSettings().setUnretrievableAttributes(Arrays.asList("visible_by"))
);
```

```
const response = await client.setSettings({
  indexName: 'INDEX_NAME',
  indexSettings: { unretrievableAttributes: ['visible_by'] },
});
```

```
var response =
  client.setSettings(
    indexName = "INDEX_NAME",
    indexSettings = IndexSettings(unretrievableAttributes = listOf("visible_by")),
  )
```

```
$response = $client->setSettings(
    'INDEX_NAME',
    ['unretrievableAttributes' => ["visible_by",],],
);
```

```
response = client.set_settings(
    index_name="INDEX_NAME",
    index_settings={
        "unretrievableAttributes": ["visible_by",],
    },
)
```

```
response = client.set_settings(
  "INDEX_NAME",
  Algolia::Search::IndexSettings.new(unretrievable_attributes: ["visible_by"])
)
```

```
val response = Await.result(
  client.setSettings(
    indexName = "INDEX_NAME",
    indexSettings = IndexSettings(
      unretrievableAttributes = Some(Seq("visible_by"))
    )
  ),
  Duration(100, "sec")
)
```

```
let response = try await client.setSettings(
    indexName: "INDEX_NAME",
    indexSettings: IndexSettings(unretrievableAttributes: ["visible_by"])
)
```

Legacy API clients

C#

Go

Java

JavaScript

Kotlin

PHP

Python

Ruby

Scala

Swift

```
IndexSettings settings = new IndexSettings
{
  UnretrievableAttributes = new List { "total_number_of_sales" }
};

index.SetSettings(settings);
```

```
res, err := index.SetSettings(search.Settings{
	UnretrievableAttributes: opt.UnretrievableAttributes(
		"total_number_of_sales",
	),
})
```

```
index.setSettings(
        new IndexSettings().setUnretrievableAttributes(Collections.singletonList(
                "total_number_of_sales"
        ))
);
```

```
index
  .setSettings({
    unretrievableAttributes: ["total_number_of_sales"],
  })
  .then(() => {
    // done
  });
```

```
val settings = settings {
    unretrieveableAttributes {
        +"total_number_of_sales"
    }
}

index.setSettings(settings)
```

```
$index->setSettings([
  'unretrievableAttributes' => [
    'total_number_of_sales'
  ]
]);
```

```
index.set_settings({"unretrievableAttributes": ["total_number_of_sales"]})
```

```
index.set_settings(
  {
    unretrievableAttributes: ["total_number_of_sales"]
  }
)
```

```
client.execute {
  setSettings of "myIndex" `with` IndexSettings(
    unretrievableAttributes = Some(Seq(
      "total_number_of_sales"
    ))
  )
}
```

```
let settings = Settings()
  .set(\.unretrievableAttributes, to: ["total_number_of_sales"])

index.setSettings(settings) { result in
  if case .success(let response) = result {
    print("Response: \(response)")
  }
}
```

Last modified on May 19, 2026
