Suppose I have a user data type and a list of texts field called: categories. What I want to achieve is:
Search for users and do the following:
Get categories parameter from URL, split it, and filter users by checking whether the intersection of this list and the categories of each user is not empty. Basically, do an intersect with in the search.
Currently, the only way I can achieve this is by using advanced filters. but as we know this is slow as it is done in the frontend. do you know a way I can circumvent this? I tried to change the list of texts field into a simple text field by merging the list elements but still I could not achieve what I wanted.
but what happens when the text field is: apple,orange,peach and the URL parameter is: apple,grape. Searching by âis inâ will return false but I still want to return true since apple is in both texts. @cmarchan
I have experimented with it, but from my perspective, I cannot do much after splitting because I cannot refer to âthis userâs categoriesâ. @cmarchan
in the pic above the data field is a list of texts. but even if the field is a text (as you suggested in the first comment) I still would face similar issues imo @cmarchan
there is still a problem though . when the field is apple,orange,peach and the URL is apple,orange,peach,grape âcontains keywordsâ returns nothing. @cmarchan
But I still would want to return the user. Because, if the field = apple,orange,peach, the user:
is returned when the URL parameter = apple,orange
is not returned when the URL parameter = apple,orange,peach,grape
but I want the user to be returned in both cases since apple is contained both in the user and in the parameter. @cmarchan