facetingAfterDistinct
false
'facetingAfterDistinct' => true|false
Can be used in these methods:
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browse,
searchForFacetValues
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
searchAsync,
browseAsync,
searchForFacetValues
Search,
Browse,
SearchForFacetValues,
GenerateSecuredApiKey,
AddApiKey,
UpdateApiKey
Search,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
BrowseObjects,
SearchForFacetValues,
GenerateSecuredAPIKey,
AddAPIKey,
UpdateAPIKey
search,
browse index,
search into facet values,
generateSecuredApiKey,
add key,
update key
About this parameter
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.
Usage notes:
-
You should not use
facetingAfterDistinct=trueif you don’t have the same facet values in all records sharing the same distinct key (you would get inconsistent results). -
facetingAfterDistinctcan only be set at query time; it can’t be added as a default setting of the index. -
facetingAfterDistinctwill be ignored if you also set typoTolerance to eitherstrictormin.
Examples
Enable facetingAfterDistinct
1
2
3
$results = $index->search('query', [
'facetingAfterDistinct' => true
]);