I’m using this search code I found but its not ideal. When I search for “Raffle” for example my correct results are returned but if I search for “Bobby won the Raffle” then no results come up. The search is comparing the search bar text to a keyword field. Any help?
HOME PAGE
import {local} from ‘wix-storage’;
import wixLocation from ‘wix-location’;
$w.onReady( function () {
});
export function searchButton_click() {
let word = $w(“#searchBar”).value;
local.setItem(“searchWord”, word);
wixLocation.to(/mysearchresults
);
}
RESULTS PAGE
import {local} from ‘wix-storage’;
import wixData from ‘wix-data’;$w.onReady( function () {
var sameWord = local.getItem(“searchWord”);
$w(“#searchBar”).value = sameWord;
$w(“#searchBar”).placeholder = sameWord;
$w(‘#dataset1’).onReady( function () {
search();
});
}); export function searchButton_click() {
search();
} function search() {
wixData.query(‘Tutorial_search’).contains(‘tut_keywords’, $w(“#searchBar”).value) .find()
.then(res => {
$w(‘#repeater1’).data = res.items;
});}