After setting distinct_attribute
values inside facetStats
and facetDistribution
become incorrect.
#4677
Labels
support
Issues related to support questions
Describe the bug
I am building e-commerce form. To build form I use values from
facetStats
andfacetDistribution
.Before setting
distinct_attribute
eveything works correctly and I get all values forprice
(min and max):After setting
distinct_attribute
my facets lose data:Here we can see that both
min
andmax
are same andfacetDistribution
shrinked to 1 value.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect facets to show data for all items in index even if they are using
distinct_attribute
. It allows to build complete user interface forms for faceted search.Screenshots
![image](https://private-user-images.githubusercontent.com/5781268/336514581-c4d2bc83-f3c5-4023-8b0a-f59a561f11fb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4NTkxNzEsIm5iZiI6MTcxODg1ODg3MSwicGF0aCI6Ii81NzgxMjY4LzMzNjUxNDU4MS1jNGQyYmM4My1mM2M1LTQwMjMtOGIwYS1mNTlhNTYxZjExZmIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjBUMDQ0NzUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTIwNjgyMzBiZTVlZjA3NDY4MjY0NzAzYmVhYzRiNDk1ZDY1MzNlOTU2MTRkMzE1YzQ0NDNkMDRkODI0Mzg3ZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.7O1SFd1SUkwa4_92ssp7iDamFnO5pirpYuTpLWuXvhQ)
Because of this problem my form looks like that :
But it should look like that:
![image](https://private-user-images.githubusercontent.com/5781268/336515234-5247ef68-8127-49d6-9959-487a02c9950a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4NTkxNzEsIm5iZiI6MTcxODg1ODg3MSwicGF0aCI6Ii81NzgxMjY4LzMzNjUxNTIzNC01MjQ3ZWY2OC04MTI3LTQ5ZDYtOTk1OS00ODdhMDJjOTk1MGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjBUMDQ0NzUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDQ1MDc0NjZkMmRiNDFhZmJkNWY5NWI2ZjNiOTQ2ZTk1NTUyYzBlOWM2ZjQ1MDYwZmFlNmJlNDQ3Yjg4ZWM3MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.uMYTH5Bildjpohj17u8tQEjPnKsr2BN2MhQZ40rV5Z0)
Here we can see that audio speakers are grouped by
nominal impedance
which isdistinct_attribute
for them.But because of current facet behaviour it makes impossible to build UI forms when using facets with
distinct_attribute
because it shrinks data to 1 item which is shown and doesn't take in consideration all of available items.Meilisearch version:
Package version: "1.8.0"
The text was updated successfully, but these errors were encountered: