Skip to main content
Required ACL: editSettings Each Recommend Rule is created or updated, depending on whether a Recommend Rule with the same objectID already exists. You may also specify true for clearExistingRules, in which case the batch will atomically replace all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the conditions and consequences apply to a source item instead of a query. The main differences are the following:
  • Conditions pattern and anchoring are unavailable.
  • Condition filters triggers if the source item matches the specified filters.
  • Condition filters accepts numeric filters.
  • Consequence params only covers filtering parameters.
  • Consequence automaticFacetFilters doesn’t require a facet value placeholder (it tries to match the data source item’s attributes instead).

Usage

// Initialize the client
var client = new RecommendClient(
  new RecommendConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
);

// Call the API
var response = await client.BatchRecommendRulesAsync(
  "<YOUR_INDEX_NAME>",
  Enum.Parse<RecommendModels>("RelatedProducts")
);
// >LOG

See the full API reference

For more details about input parameters and response fields.
I