So I’ve tried many code scripts but cant seem to find one that actually works.
As of right now, I deleted all the code and would just like to start from scratch.
Here’s what I have:
I have a text input named “searchBar”
I have a loader gif named “loadingGif”
I have a database named “Play Sets”
This database has 2 fields that I want to use in my site search.
Field 1 is “manufacturer” and field 2 is “playSetModel”
I have a repeater named “repeaterResults”
What I want:
To be able to search for multiple words at the same time in the same search box.
For example: “Gorilla” which is from the field manufacturer, and “Adventure Wave” which is from the field playSetModel
I want the loading gif to show up when performing a search
I want the user to get results if any of the words match and in any order
If the user performs a search, I want any results to show up in the repeater, and any items in the repeater that do NOT match the search results, I want to disappear.
Please someone help me. I’ve been hung up on this search issue for almost 2 weeks now.
Kind of a noob when it comes to coding. If you can please paste entire code from start to finish, it would be greatly appreciated. Thanks in advance
What do you mean “generate a search engine”? I’m just talking about velo code for a basic site search. Ive tried a bunch I’ve found on here and on youtube and they all work but you can only type in the words from 1 database field at a time. I just want to be able to search multiple fields at the same time.
Are you saying this is not possible with a simple velo code? I’ve seen other users post similar codes that are very close to what I am asking for. Unfortunately, they never post the code from start to end, just snippets and so I get lost.
I do have a dataset attached the the repeater. Its called “dataset1”
Perhaps I am supposed to be using the 1st code? If i am, I don’t know where I am supposed to insert my own ID’s
I’m sorry. I’m a complete noob and I cant get it to work.
There are no errors showing when I paste the code, yet when I preview and look at the developer console, I see error: “WDE0025: The Play Sets collection does not exist. You cannot work with a collection using the Data API before it is created in the Editor”
Nothing happens when I start to type or press enter aside from that error
Maybe I’m explaining it wrong. I have a collection named “Play Sets” the collection ID is named PlaySets and the Dataset id for this collection is called #dataset1
Originally, I was using this code but had some issues. I had a collapsed repeater that would give search suggestions as the user typed. You could then click a option from the 1st repeater that would filter out the bottom repeater with said results. so it had two repeaters in total. One for the suggested results and one with the final results. This worked a little, but would never let me click on a result in the 1st repeater and it wouldn’t let me search multiple fields at the same time.
Here is that code. Perhaps it would be easier to just make adjustments to this since it was working somewhat: