I’m having trouble getting consistent results with the search terms from the database I have set up, and I don’t know what the problem is. You can look at the database here: www.aseatatthepiano.com/database
The code I have for the search right now is:
import wixData from 'wix-data';
export function input1_keyPress(event) {
let SearchValue = $w("#input1").value;
$w('#dataset1').setFilter(wixData.filter().contains('title', SearchValue)
.or(wixData.filter().contains('birthyear', SearchValue)
.or(wixData.filter().contains('compositionTitle', SearchValue)
.or(wixData.filter().contains('duration', SearchValue)
.or(wixData.filter().contains('level', SearchValue)
.or(wixData.filter().contains('nationality', SearchValue))
.or(wixData.filter().contains('identifier', SearchValue)
.or(wixData.filter().contains('searchTerms', SearchValue))))))))
}
I’m wondering if it has something to do with the .or function? Does it stop filtering once it finds a match in the database?
For example, when searching for the piece Pickles and Peppers by Adaline Shepherd, you get the result when searching pickles and when searching Adaline, but not when searching adaline pickles.
I’m not very experience with this, so if anyone can help me out with this, that would be great!