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

# Get settings

> Retrieve index settings.

export const Legacy = ({title, href}) => {
  return <Note>

    This page documents an earlier version of the API client.
    For the latest version, see <a href={href}>{title}</a>.

    </Note>;
};

<Legacy title="Retrieve index settings" href="/doc/libraries/sdk/methods/search/get-settings" />

**Required ACL:** `settings`

For an overview over the available settings, see [Index settings](/doc/api-reference/settings-api-parameters).

<Info>
  The response only includes values for settings that aren't null.
</Info>

## Examples

### Retrieve settings for an index

<CodeGroup>
  ```cs C# theme={"system"}
  IndexSettings settings = index.GetSettings();

  // Asynchronous
  IndexSettings settings = await index.GetSettingsAsync();
  ```

  ```go Go theme={"system"}
  settings, err := index.GetSettings()
  ```

  ```java Java theme={"system"}
  IndexSettings settings = index.getSettings();

  //Asynchronous
  CompletableFuture<IndexSettings> settings = index.getSettingsAsync();
  ```

  ```js JavaScript theme={"system"}
  index.getSettings().then(settings => {
    console.log(settings);
  });
  ```

  ```kotlin Kotlin theme={"system"}
  val settings = index.getSettings()
  println(settings)
  ```

  ```php PHP theme={"system"}
  $settings = $index->getSettings();
  var_dump($settings);
  ```

  ```python Python theme={"system"}
  settings = index.get_settings()
  print(settings)
  ```

  ```ruby Ruby theme={"system"}
  settings = index.get_settings
  puts settings.to_json
  ```

  ```scala Scala theme={"system"}
  val result: Future[IndexSettings] = client.execute {
    settings of "myIndex"
  }
  ```

  ```swift Swift theme={"system"}
  index.getSettings { result in
    if case .success(let response) = result {
      print("Response: \(response)")
    }
  }
  ```
</CodeGroup>

## Parameters

<ParamField body="requestOptions" type="object">
  A mapping of request options to send along with the request.
</ParamField>

## Response

### Response as JSON

This section shows the JSON response returned by the API.
Each API client wraps this response in language-specific objects, so the structure may vary.
To view the response, use the `getLogs` method.
Don't rely on the order of properties—JSON objects don't preserve key order.

This response example contains a non-exhaustive list of index settings that can be
returned.

```jsonc JSON icon=braces theme={"system"}
{
  "minWordSizefor1Typo": 4,
  "minWordSizefor2Typos": 8,
  "hitsPerPage": 20,
  "maxValuesPerFacet": 100,
  "searchableAttributes": [
    "title",
    "description",
    "author_name"
  ],
  "numericAttributesToIndex": null,
  "attributesToRetrieve": null,
  "unretrievableAttributes": null,
  "optionalWords": null,
  "attributesForFaceting": null,
  "attributesToSnippet": null,
  "attributesToHighlight": null,
  "paginationLimitedTo": 1000,
  "attributeForDistinct": null,
  "exactOnSingleWordQuery": "attribute",
  "ranking": [
    "typo",
    "geo",
    "words",
    "filters",
    "proximity",
    "attribute",
    "exact",
    "custom"
  ],
  "customRanking": null,
  "separatorsToIndex": "",
  "removeWordsIfNoResults": "none",
  "queryType": "prefixLast",
  "highlightPreTag": "<em>",
  "highlightPostTag": "<\/em>",
  "alternativesAsExact": [
    "ignorePlurals",
    "singleWordSynonym"
  ]
}
```
