Building a performant faceted search with hundreds of permutations

I have created an instagram-like feed with clothing images that have a lot of metadata such as size of the piece, color type, and 6-7 other fields with specific dropdown options. On the left I have checkboxes that update the page’s status when they’re checked. The repeating group of images is filtered to only show images that match all the criteria in the status.

Now, the issue is that we want people to be able to use all of the filters simultaneously if they want. So I can’t just show all images, then add a filter when they check a box, because I can’t control for every possible permutation of the filter options I give. Eg. If they decide to filter by color, bottom size, and top size, that’s a different query than filtering by collection and maternity.

They can also search for images combined with these filters, which adds another layer of query complexity.

We currently have 1,000 images and will eventually have tens of thousands.

My question is: is there a way to dynamically alter a data source for a repeating group to add or remove one item at a time instead of completely changing it? I don’t want to “reset” the data source or “display a list”, I just want to add an additional filter or remove a filter at will.

Hi, I may be missing something about your question… but if you are using “Search for X” as the data source in your repeating group, you can use multiple constraints in the “Do a search for” box and the repeating group will update every time a constraint is changed.

Re: performance, try to keep everything in the “Do a search for” box and DON’T use :filter or advanced filter stuff. “Do a search for” is run server side (is fast); while :filter is usually run client side (slow if your data set is big).

Yes, add the constraints in your search and check the box for ignore empty constraints

Hmm, I do currently use “filtered” because I don’t know a better way to do one part of the search.

I have a list of outfit pieces (clothing) that’s around 150 items long. Each image has a list of around 10 outfit pieces attached to it. When a user filters the outfit pieces, I want to show them images that contain all of the pieces they select.

This is in addition to the other filters I’ve mentioned above.

The way I’m doing it right now is with an advanced filter.


I can’t figure out a way to do it with just a search.

Right now my constraints wouldn’t be empty, I think, because on page load I update the page statuses to include all possible values (eg. show all images). If I keep that status empty instead, will it just not filter by that criteria?

If the filters are empty they will not affect the search results when the checkbox for ignore empty constraints is checked…what that means is if you don’t set all those values on page load, all images will be returned by default because all the constraints will be empty.

1 Like

Good to know! That’ll make the search a lot faster I’m sure. Now to figure out this filter thing… I just need a way to check “contains list” for a field within Outfit Images and I’ll be golden.

I tried this but it doesn’t work b/c it returns outfit pieces instead of outfit images. chrome_o7zHp2ipFG

I don’t know what your database structure is so I can’t be of help on that.

Maybe these posts will help you get it figured out

Thanks for the response. I read through your instructions on the first post and it all matches up with what I’m doing. I see you’re also using :filtered with an advanced filter b/c you have to do a “contains list” search. It seems like there’s no way around it.