Skip to main content
The attributeForDistinct attribute works in combination with distinct:
  • attributeForDistinct establishes groups: all records with the same value of attributeForDistinct are treated as a group.
  • distinct determines how many variants per group are included in the search results.

Usage

  • You can specify only one attribute.
  • Valid values for the attribute:
    • String values are used as-is.
    • Numbers are rounded to the nearest integer and converted to strings. For example, 1.2 and 1 both become "1".
    • Boolean or null values are ignored.
    • Arrays and objects are not supported and result in unspecified behavior.

Example

Current API clients

IndexSettings settings = new IndexSettings();
settings.AttributeForDistinct = "url";

index.SetSettings(settings);
IndexSettings settings = new IndexSettings();
settings.AttributeForDistinct = "url";

index.SetSettings(settings);
I