Hi
I am making a search for a database that show the results in a repeater. It works but i have this problem: when a user types in a search that has multiple words into the input element ex: "clinical study "
I would like the search to display results for word1 OR word2 OR word 3 – for example, for the search “clinical study” I want results that contain the word “clinical” OR the word “study”. Right now it gives me only results that contain both words.
Here is my code:
import wixData from 'wix-data';
export function ititle_keyPress(event, $w) {
$w("#dataset1").setFilter(wixData.filter()
)
const filterValue = $w("#SearchBox").value
const byTitle = wixData.filter().contains("title", filterValue)
const byTag1 = wixData.filter().contains("tag1", filterValue)
const byTag2 = wixData.filter().contains("tag2", filterValue)
$w("#dataset1").setFilter(byTitle.or(byTag1.or(byTag2)))
}
Thanks!