New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get count for each filter? #2
Comments
You can use $filterData = $search->findAcceptableFilters($filters); It returns only acceptable filters: === Size === === Color === === Brand === Not === Size === === Color === === Brand === I think I can update the library to solve your case. If you realy need this. |
That's really good actually. But getting the counts would be the final goal. Great job by the way! |
Already done, give me a few hours to test |
Implemented in 1.2.5 https://github.com/k-samuel/faceted-search/releases/tag/1.2.5 // If you want to get acceptable filters values with items count use findAcceptableFiltersCount
// note that filters is not applied for itself for counting
// values count of a particular field depends only on filters imposed on other fields
$filterData = $search->findAcceptableFiltersCount($filters); |
That's awesome! Will play around with it over the weekend. |
If an item has multiple attributes of the same type, for ex. ["id"=>1,"color"=>["Black","White"]], do they need to be separate entries under the same "id"? or it's possible to directly pass an array? |
Multiple attributes can be set as an array ["id"=>1,"color"=>["Black","White"]], its ok |
I'm looking to achieve the result in this post https://stackoverflow.com/questions/35418885/multi-select-faceting-in-mysql-how-to-ignore-any-constraints-on-a-facet
The text was updated successfully, but these errors were encountered: