Skip to main content
Required ACL: settings This helper method iterates over the paginated API response from the Search for rules API operation and lets you run an aggregator function on every iteration. You can use this, for example, to retrieve all rules from your index.

Usage

using Algolia.Search.Clients;
using Algolia.Search.Models.Search;

var appID = "ALGOLIA_APPLICATION_ID";
var apiKey = "ALGOLIA_API_KEY";
var indexName = "ALGOLIA_INDEX_NAME";

var client = new SearchClient(appID, apiKey);

var results = await client.BrowseRulesAsync(indexName, new SearchRulesParams {});

results.ToList().ForEach(rule => Console.WriteLine($"  - Rule: {rule.ObjectID}"));

Parameters

  • C#
  • Go
  • Java
  • JavaScript
  • Kotlin
  • PHP
  • Python
  • Ruby
  • Scala
  • Swift
indexName
string
required
Index name from which to retrieve the rules.
searchRulesParams
SearchRulesParams
required
Parameters for the Search for rules request.
requestOptions
RequestOptions
Additional request options.
I