How to not filter items in a list that dont exactly match a given search parameter?
In my use case I’m filtering a list of Restaurants with FoodCategories list as a member, The filter removes all restaurants that don’t contain what is entered into the search parameter. However my issue is that if the Restaurant has two FoodCategories associated to it and a user enters just one of those two FoodCategories into their search box it does not show the restaurant. For example, if a Steak House has Burgers and Steak as it’s two Food Categories and the user searches for just Burgers then the restaurant will not appear in the search results which it needs to as Steak House has Burgers and the user would want to see that. In this situation how do I filter objects in a list that don’t include at least one food category and make it so the the users search parameter has to include every FoodCategory that a restaurant has associated to it for it to appear in the search results? Screenshots Thank you
You can do this in Mendix, but not by filtering. If you do not want to commit your SearchParameter, you could solve it as follows:
Retrieve all FoodCategories from the Search helper,
Iterate over the FoodCategories,
For each FoodCategory, retrieve all its restaurants,
Add these restaurants to a list (which you have to create outside the loop),
After the loop, filter out the blacklisted restaurants.