Hi guys, so i'm starting this message like most people and saying i know nothing about coding.
we are trying to filter a business listing search with 2 categories the first being a general search and the second by location.
Now we have managed to use a simple code to achieve this, but the only problem is it displays the results for both searches, for example, if
Searchbar 1 searches = Media
Searchbar 2 searches = South Africa
It shows all the media companies regardless of the location as well as it showing everything to do with South Africa regardless if its related to media.
We need it to show only Media companies that are in South Africa, if that makes sense.
Our Code looks as follows:
import wixData from 'wix-data'; $w.onReady(function () { // TODO: write your page related code here... }); export function button26_click(event) { let SearchValue = $w("#input2").value; $w("#teamDataset").setFilter(wixData.filter().contains('title', SearchValue) .or(wixData.filter().contains('sector', SearchValue)) .or (wixData.filter().contains('shortdiscription', SearchValue))); let SearchValue2 = $w("#input1").value; $w("#teamDataset").setFilter(wixData.filter().contains('location', SearchValue2)); }
this code is great and simple for us beginners to understand, so if we could just add one line of code that will help us achive our goal as a dual search that would be great.