In this episode, we revisit our product browser to fix an issue with how filter queries are built for Meilisearch. Right now, when you select multiple sizes (like size 8 and 12), the logic incorrectly removes products that don't match all selected sizes, because it's using an AND condition between filters.
Since these are checkboxes (not radio buttons), we actually want to show products that match any selected option—so we need to use an OR in our query! We walk through the existing filter-building code, where filters are joined together with AND, and show how to switch it so that appropriate filters use OR instead. We keep the AND for price filters, so those still work as expected.
After making this tweak, the UI now behaves intuitively: selecting multiple sizes or colors shows the products that match any of them. It's a small code change, but really improves the filtering experience in our app.