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

# disableExactOnAttributes

> Attributes for which to turn off the Exact ranking criterion

export const Setting = ({type, default: defaultValue, defaultNote, scope, min, max, formerly}) => {
  const renderedDefault = defaultValue === '' ? '""' : defaultValue;
  const renderedNote = defaultNote ? `(${defaultNote})` : '';
  return <ul>
      <li><strong>Type:</strong> <code>{type}</code></li>
      <li><strong>Default:</strong> <code>{renderedDefault}</code>{renderedNote}</li>
      {min && <li><strong>Min:</strong> <code>{min}</code></li>}
      {max && <li><strong>Max:</strong> <code>{max}</code></li>}
      <li><strong>Scope:</strong> <a href="/doc/api-reference/api-parameters"><code>{scope}</code></a></li>
      {formerly && <li>
          <strong>Deprecated name:</strong> <code>{formerly}</code>
        </li>}
    </ul>;
};

<Setting type="list<string>" default="[]" scope="settings,search" />

The `disableExactOnAttributes` parameter turns off the [Exact ranking criterion](/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria#exact)
for specific attributes.

This reduces the influence of exact matches for attributes with many words,
such as `description` or `content`.
Because these attributes often have many words, exact matches are more likely but not necessarily more relevant.
Turning off the Exact criterion for those attributes helps to reduce noise.

## Usage

* Attribute names are case-sensitive.
* The list must be a subset of [`searchableAttributes`](/doc/api-reference/api-parameters/searchableAttributes).

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

## Example

<AccordionGroup>
  <Accordion title="Current API clients" defaultOpen="true">
    <CodeGroup>
      ```cs C# theme={"system"}
      var response = await client.SetSettingsAsync(
        "INDEX_NAME",
        new IndexSettings { DisableExactOnAttributes = new List<string> { "description" } }
      );
      ```

      ```dart Dart theme={"system"}
      final response = await client.setSettings(
        indexName: "INDEX_NAME",
        indexSettings: IndexSettings(
          disableExactOnAttributes: [
            "description",
          ],
        ),
      );
      ```

      ```go Go theme={"system"}
      response, err := client.SetSettings(client.NewApiSetSettingsRequest(
        "INDEX_NAME",
        search.NewEmptyIndexSettings().SetDisableExactOnAttributes(
          []string{"description"})))
      if err != nil {
        // handle the eventual error
        panic(err)
      }
      ```

      ```java Java theme={"system"}
      UpdatedAtResponse response = client.setSettings(
        "INDEX_NAME",
        new IndexSettings().setDisableExactOnAttributes(Arrays.asList("description"))
      );
      ```

      ```js JavaScript theme={"system"}
      const response = await client.setSettings({
        indexName: 'theIndexName',
        indexSettings: { disableExactOnAttributes: ['description'] },
      });
      ```

      ```kotlin Kotlin theme={"system"}
      var response =
        client.setSettings(
          indexName = "INDEX_NAME",
          indexSettings = IndexSettings(disableExactOnAttributes = listOf("description")),
        )
      ```

      ```php PHP theme={"system"}
      $response = $client->setSettings(
          'INDEX_NAME',
          ['disableExactOnAttributes' => [
              'description',
          ],
          ],
      );
      ```

      ```python Python theme={"system"}
      response = client.set_settings(
          index_name="INDEX_NAME",
          index_settings={
              "disableExactOnAttributes": [
                  "description",
              ],
          },
      )
      ```

      ```ruby Ruby theme={"system"}
      response = client.set_settings(
        "INDEX_NAME",
        Algolia::Search::IndexSettings.new(disable_exact_on_attributes: ["description"])
      )
      ```

      ```scala Scala theme={"system"}
      val response = Await.result(
        client.setSettings(
          indexName = "INDEX_NAME",
          indexSettings = IndexSettings(
            disableExactOnAttributes = Some(Seq("description"))
          )
        ),
        Duration(100, "sec")
      )
      ```

      ```swift Swift theme={"system"}
      let response = try await client.setSettings(
          indexName: "INDEX_NAME",
          indexSettings: IndexSettings(disableExactOnAttributes: ["description"])
      )
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Legacy API clients">
    <CodeGroup>
      ```cs C# theme={"system"}
      IndexSettings settings = new IndexSettings();
      settings.DisableExactOnAttributes = new List
      {
        "description"
      };

      index.SetSettings(settings);
      ```

      ```go Go theme={"system"}
      res, err := index.SetSettings(search.Settings{
      	DisableExactOnAttributes: opt.DisableExactOnAttributes(
      		"description",
      	),
      })
      ```

      ```java Java theme={"system"}
      index.setSettings(
        new IndexSettings()
          .setDisableExactOnAttributes(
            Collections.singletonList(
              "description"
            )
          )
      );
      ```

      ```js JavaScript theme={"system"}
      index
        .setSettings({
          disableExactOnAttributes: ["description"],
        })
        .then(() => {
          // done
        });
      ```

      ```kotlin Kotlin theme={"system"}
      val settings = settings {
          disableExactOnAttributes { +"description" }
      }

      index.setSettings(settings)
      ```

      ```php PHP theme={"system"}
      $index->setSettings([
        'disableExactOnAttributes' => [
          'description',
        ]
      ]);
      ```

      ```python Python theme={"system"}
      index.set_settings(
          {
              "disableExactOnAttributes": [
                  "description",
              ]
          }
      )
      ```

      ```ruby Ruby theme={"system"}
      index.set_settings(
        {
          disableExactOnAttributes: [
            "description"
          ]
        }
      )
      ```

      ```scala Scala theme={"system"}
      client.execute {
        setSettings of "myIndex" `with` IndexSettings(
          disableExactOnAttributes = Some(Seq(
            "description"
          ))
        )
      }
      ```

      ```swift Swift theme={"system"}
      let settings = Settings()
        .set(\.disableExactOnAttributes, to: ["description"])

      index.setSettings(settings) { result in
        if case .success(let response) = result {
          print("Response: \(response)")
        }
      }
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>
