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

# Search dictionary entries

> Search for entries in a dictionary.

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="Search dictionary entries" href="/doc/libraries/sdk/methods/search/search-dictionary-entries" />

**Required ACL:** `settings`

## Examples

<CodeGroup>
  ```cs C# theme={"system"}
  Query query = new Query("und") { QueryLanguages = new List<String>() { "de"} };

  AlgoliaDictionary algoliaDictionary = new AlgoliaDictionary
  {
    Name = AlgoliaDictionaryType.Stopwords
  };

  // Synchronous
  DictionaryClient.SearchDictionaryEntries<String>(algoliaDictionary, query);

  // Asynchronous
  var SearchDictionaryResponse = await DictionaryClient.SearchDictionaryEntriesAsync<string>(algoliaDictionary, query);
  ```

  ```go Go theme={"system"}
  res, err := client.SearchDictionaryEntries(search.Stopwords, "und")
  res, err := client.SearchDictionaryEntries(search.Stopwords, "und", opt.Language("de"))
  ```

  ```java Java theme={"system"}
  Query query = new Query("und").setQueryLanguages(Collections.singletonList("de"));
  // Synchronous
  client.searchDictionaryEntries(Dictionary.STOPWORDS, query);
  // Asynchronous
  client.searchDictionaryEntriesAsync(Dictionary.STOPWORDS, query);
  ```

  ```js JavaScript theme={"system"}
  client.searchDictionaryEntries("stopwords", "und");
  client.searchDictionaryEntries("stopwords", "und", { language: "de" });
  ```

  ```kotlin Kotlin theme={"system"}
  val response = client.searchDictionaryEntries(
      dictionary = Dictionary.Stopwords,
      query = Query("und", queryLanguages = listOf(Language.Dutch)))
  // or using extension function:
  val response = client.searchStopwordEntries(
      query = Query("und", queryLanguages = listOf(Language.Dutch))
  )
  ```

  ```php PHP theme={"system"}
  $client->searchDictionaryEntries('stopwords', 'und');
  $client->searchDictionaryEntries('stopwords', 'und',
    array('language' => 'de')
  );
  ```

  ```python Python theme={"system"}
  client.search_dictionary_entries("stopwords", "und")
  client.search_dictionary_entries("stopwords", "und", {language: "de"})
  ```

  ```ruby Ruby theme={"system"}
  client.search_dictionary_entries("stopwords", "und")
  client.search_dictionary_entries("stopwords", "und", {language: "de"})
  ```

  ```scala Scala theme={"system"}
  client.execute {
    search into Stopwords query QueryDictionary(query = Some("und"), language = Some("de"))
  }
  ```

  ```swift Swift theme={"system"}
  let query = DictionaryQuery(query: "und")
    .set(\.language, to: .german)

  client.searchDictionaryEntries(in: StopwordsDictionary.self, query: query) { result in
    if case .success(let response) = result {
      print("Response: \(response)")
    }
  }
  ```
</CodeGroup>

## Parameters

<ParamField body="dictionary" type="enum<string>" required>
  Dictionary type. One of: `stopwords`, `plural`, `compounds`.
</ParamField>

<ParamField body="query" type="string" required>
  The term to search for in the dictionary.
</ParamField>

<ParamField body="params" type="object">
  Additional parameters for searching.

  <Expandable>
    <ParamField body="hitsPerPage" type="integer" default={0}>
      Number of hits retrieved per page of search results.
      From 1 to 1,000.
    </ParamField>

    <ParamField body="language" type="string">
      The language ISO code of the dictionary,
      for example `de` for German.
    </ParamField>

    <ParamField body="page" type="integer" default={0}>
      Page of search results to retrieve.
    </ParamField>
  </Expandable>
</ParamField>

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

## Response

<ResponseField name="hits" type="object">
  Dictionary entries that match the query.
  For details,
  see the [`dictionaryEntries`](/doc/libraries/sdk/v1/methods/save-dictionary-entries#param-dictionary-entries)
  parameter.
</ResponseField>

<ResponseField name="nbHits" type="integer">
  Number of dictionary entries that matched the query.
</ResponseField>

<ResponseField name="nbPages" type="integer">
  Number of pages in the paginated response.
</ResponseField>

<ResponseField name="page" type="integer">
  Page number of the paginated response.
</ResponseField>

### 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.

```jsonc JSON icon=braces theme={"system"}
{
  "hits": [
    {
      "objectID": "under",
      "language": "en",
      "word": "under",
      "type": "custom"
    },
    {
      // ...
    }
  ],
  "nbHits": 2,
  "page": 0
  "nbPages": 1
}
```
