How about first splitting the input by space, using CommunityCommons’ funtion “StringSplit” and then:
contains($fieldString,'wall') and contains($fieldString,'bedroom')
Hey Zacky,
I have written a blog on this topic and explained it thoroughly.
I am also trying to get it published on mendix community also, so that it can help other people also.
Hope it helps!
Hi Zacky,
If you want to search with the database field containing all keywords:
If you want to search with the database field containing one of the keywords: Use a list operation union at Step 3
Hope this helps!
Hi there,
It seems like you want to filter your database based on a specific input string, 'Wall bedroom,' and you're encountering issues when using the 'contains' function. If I understand correctly, you'd like to retrieve rows that contain both 'wall' and 'bathroom,' even if they are in a different order in the input string.
To achieve this, you can use a combination of functions. Here's a possible solution:
SELECT *
FROM your_table
WHERE (LOWER($fieldString) LIKE '%wall%' AND LOWER($fieldString) LIKE '%bedroom%');
This query will return rows where the 'fieldString' contains both 'wall' and 'bedroom,' regardless of their order in the input string. We're using the 'LIKE' operator with '%' wildcards to search for these terms in a case-insensitive manner (using 'LOWER' to ensure case insensitivity).