Search bar for my wix store

hello Friends,
Can anyone please help me in creating a search bar for my wix store page. So my customers could search any particular product from my wix store.
Thank you

1 Like

Hey
You can add a dataset to the page where you want the searchbox to be, then add a text input field and a search button. Add some box to handle the results or how you want the results to be displayed and connect the dataset to Stores / Products Data Collection. Then when they click the button just use the setFilter function on the dataset to make the search execute on the dataset.

setFilter

dataset info

Text input

Button and onClick

Box

Thank you Andreas
But i have done this all ready. Problem is results for filters appears very slow on my landing page.

1 Like

@hamidrazawasim Hey, okey but you asked “Can anyone please help me in creating a search bar for my wix store page. So my customers could search any particular product from my wix store.” and not how to make it a fast search on your page.

How many products do you have in the results? How many datasets do you have on your landing page? What is the url for the page so I can test it.

1 Like

@andreas-kviby i have more than 1000 products
https://www.domov.in/search-result

@hamidrazawasim Ok so I have tested it and the search takes around 2-3 seconds to load the results. I guess you populate the repeater first with all records (1,000) and then when you search you use the contains condition on the setFilter?

If you want the search to be a lot faster you need to code it so when you load all products you store them in a array in code. Then when you search you search in that array instead of searching in the data collection. Then moving those functions to backend modules will speed up the search quite a bit I think.

I @andreas-kviby thank alot
I hope your idea works, i will try to do the way you have suggested.
I’m not a coder that’s a bit problematic for me too.

@hamidrazawasim I am publishing an example soon, hold on

@andreas-kviby thank you

@hamidrazawasim Here you go, https://wixshow.wixanswers.com/en/article/search-faster-using-filter-function

@andreas-kviby bro i have followed the steps as described on that page.
in the preview page its showing few error, please help.

@andreas-kviby bro please

I’m stuck there

@hamidrazawasim What error shows? Can’t help without seeing the errors.

@andreas-kviby brother after giving the input text to filter it’s not giving back any result.

@hamidrazawasim yes but you wrote it gives you some errors in Preview mode, what is the errors you get?

@andreas-kviby yeah it is showing me an erro on preview window.

Screenshot :point_up:

@hamidrazawasim Those are not errors.
@andreas-kviby Great example!
Roi.

Perfect I am going to attempt to implement this in my store! I am not a coder so I hope it goes well lol