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

Usage

  • Attribute names are case-sensitive.
  • This parameter only works if searchableAttributes isn’t empty or null.
You can’t use this setting to:
  • 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 to "content", but not to "title" or "category" individually, nor 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.

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" }
});
I