Help with do a search for:filtering many to many using a custom state list based on an option set list

I’ve never used the intersect method and not sure if it would return different results than the method I use.

I also don’t use custom states in most cases and opt to use URL parameters, so that the user can navigate using browser navigation and not lose their search…this also allows them to save the URL to the DB as a single text field if they want to save a search.

Here are some screen shots from an application I use during a lesson on Data Modeling in Bootcamps I run.

Screen Shot 2021-03-23 at 12.59.04 PM

Notice in the Restaurant Data type some fields are lists of options while others like Brooklyn Neighborhood is a single option.

Then on the element holding the search results this is the setup for the search using the filters

And here is an example of a search result using only two filters for cuisine type

In that screen shot only 2 restaurants search both American and Seafood, although there is a 3rd restaurant that serves American, however, it doesn’t serve Seafood so it is omitted from the results.

I believe this may be the difference between using intersect with VS the method I employ, however, I am not familiar with the intersect method and how it returns results.

And a final screen shot below of using three filters on cuisine type

1 Like