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

# enableReRanking

> Whether Dynamic Re-Ranking should be used for the current search

\<ul><li>**Type:** `boolean`</li>
      \<li>**Default:** `true`</li>
      
      
      \<li>**Scope:** [`search`](https://www.algolia.com/doc/api-reference/api-parameters)</li></ul>The `enableReRanking` parameter controls whether [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking) is applied to the current search query.This setting lets you selectively activate or deactivate re-ranking on a per-query basis.## Usage- This parameter doesn't have any effect unless Dynamic Re-Ranking is enabled in your [Algolia dashboard](https://dashboard.algolia.com/reranking).### A/B testingIf you use this parameter in an [A/B test with Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking#a/b-test-dynamic-re-ranking):- `true`: the user is included in the re-ranked test group.
- `false`: the user is excluded from the re-ranked group.To ensure valid A/B test results, use a consistent value for `enableReRanking` across all variants.## Example> [accordion] Current API clients
>
> ```cs C# theme={"system"}
> var response = await client.SearchSingleIndexAsync<Hit>(
>   "INDEX_NAME",
>   new SearchParams(new SearchParamsObject { Query = "query", EnableReRanking = false })
> );
> ```
>
> ```dart Dart theme={"system"}
> final response = await client.searchSingleIndex(
>   indexName: "INDEX_NAME",
>   searchParams: SearchParamsObject(
>     query: "query",
>     enableReRanking: false,
>   ),
> );
> ```
>
> ```go Go theme={"system"}
> response, err := client.SearchSingleIndex(client.NewApiSearchSingleIndexRequest(
>   "INDEX_NAME").WithSearchParams(search.SearchParamsObjectAsSearchParams(
>   search.NewEmptySearchParamsObject().SetQuery("query").SetEnableReRanking(false))))
> if err != nil {
>   // handle the eventual error
>   panic(err)
> }
> ```
>
> ```java Java theme={"system"}
> SearchResponse response = client.searchSingleIndex(
>   "INDEX_NAME",
>   new SearchParamsObject().setQuery("query").setEnableReRanking(false),
>   Hit.class
> );
> ```
>
> ```js JavaScript theme={"system"}
> const response = await client.searchSingleIndex({
>   indexName: 'indexName',
>   searchParams: { query: 'query', enableReRanking: false },
> });
> ```
>
> ```kotlin Kotlin theme={"system"}
> var response =
>   client.searchSingleIndex(
>     indexName = "INDEX_NAME",
>     searchParams = SearchParamsObject(query = "query", enableReRanking = false),
>   )
> ```
>
> ```php PHP theme={"system"}
> $response = $client->searchSingleIndex(
>     'INDEX_NAME',
>     ['query' => 'query',
>         'enableReRanking' => false,
>     ],
> );
> ```
>
> ```python Python theme={"system"}
> response = client.search_single_index(
>     index_name="INDEX_NAME",
>     search_params={
>         "query": "query",
>         "enableReRanking": False,
>     },
> )
> ```
>
> ```ruby Ruby theme={"system"}
> response = client.search_single_index(
>   "INDEX_NAME",
>   Algolia::Search::SearchParamsObject.new(query: "query", enable_re_ranking: false)
> )
> ```
>
> ```scala Scala theme={"system"}
> val response = Await.result(
>   client.searchSingleIndex(
>     indexName = "INDEX_NAME",
>     searchParams = Some(
>       SearchParamsObject(
>         query = Some("query"),
>         enableReRanking = Some(false)
>       )
>     )
>   ),
>   Duration(100, "sec")
> )
> ```
>
> ```swift Swift theme={"system"}
> let response: SearchResponse<Hit> = try await client.searchSingleIndex(
>     indexName: "INDEX_NAME",
>     searchParams: SearchSearchParams.searchSearchParamsObject(SearchSearchParamsObject(
>         query: "query",
>         enableReRanking: false
>     ))
> )
> ```> [accordion] Legacy API clients
>
> ```cs C# theme={"system"}
> index.Search(new Query("")
> {
>     EnableReRanking = false
> });
> ```
>
> ```go Go theme={"system"}
> res, err := index.Search(
> 	"query",
> 	opt.EnableReRanking(false),
> )
> ```
>
> ```java Java theme={"system"}
> index.search(
>   new Query("query")
>     .setCustomParameter("enableReRanking", false)
> );
> ```
>
> ```js JavaScript theme={"system"}
> index
>   .search("query", {
>     enableReRanking: false,
>   })
>   .then(({ hits }) => {
>     console.log(hits);
>   });
> ```
>
> ```php PHP theme={"system"}
> $results = $index->search('query', [
>   'enableReRanking' => false
> ]);
> ```
>
> ```python Python theme={"system"}
> results = index.search("query", {"enableReRanking": False})
> ```
>
> ```ruby Ruby theme={"system"}
> results = index.search(
>   "query",
>   {
>     enableReRanking: false
>   }
> )
> ```
>
> ```scala Scala theme={"system"}
> client.execute {
>   search into "myIndex" query Query(
>     query = Some("query"),
>     enableReRanking = Some(false)
>   )
> }
> ```
>
> ```swift Swift theme={"system"}
> let query = Query("query")
>   .set(\.enableReRanking, to: false)
>
> index.search(query: query) { result in
>   if case .success(let response) = result {
>     print("Response: \(response)")
>   }
> }
> ```
