Skip to main content
  • Type: list<string>
  • Default: [](all searchable attributes)
  • Scope: search

Usage

Usage

  • Attribute names are case-sensitive.
  • This parameter only works if searchableAttributes isn’t empty or null.
This setting doesn’t support:
  • Target attributes from a comma-separated list of attributes within searchableAttributes. For example, if your searchableAttributes is set to ['title, category', 'content'], you can restrict searches to "content", but not to "title" or "category" individually, or to "title,category".
  • Change the ranking priority of matched attributes. For example, if searchableAttributes is ["title", "category", "content"] and you restrict the search to ["category", "title"], matches in the title attribute still rank higher than matches in category.
  • Apply or override searchableAttributes modifiers such as unordered. This parameter only accepts attribute names. For example, if you configured unordered(title) in searchableAttributes, restrict the search with ["title"], not ["unordered(title)"].

Example

The following example restricts the search to the title and author attributes, even if your searchableAttributes setting includes more.

Current API clients

var response = await client.SearchSingleIndexAsync<Hit>(
  "ALGOLIA_INDEX_NAME",
  new SearchParams(
    new SearchParamsObject
    {
      Query = "query",
      RestrictSearchableAttributes = new List<string> { "title", "author" },
    }
  )
);
index.Search(new Query("query")
{
    RestrictSearchableAttributes = new List{ "title", "author" }
});