diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index 87fdb95a01..b148e84599 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -104,6 +104,7 @@ let _algoliaQueryParameters: QueryParameters = { attributesToRetrieve: [''], restrictSearchableAttributes: [''], facets: '', + facetingAfterDistinct: true, maxValuesPerFacet: 2, attributesToHighlight: [''], attributesToSnippet: [''], diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 71684995a4..a0bb0e0e45 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1129,6 +1129,14 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#facets */ facets?: string | string[]; + /** + * Force faceting to be applied after de-duplication (via the Distinct setting). + * When using the distinct setting in combination with faceting, facet counts may be higher than expected. + * This is because the engine, by default, computes faceting before applying de-duplication (distinct). + * When facetingAfterDistinct is set to true, the engine calculates faceting after the de-duplication has been applied. + * default "" + */ + facetingAfterDistinct?: boolean; /** * Limit the number of facet values returned for each facet. * default: ""