Can anyone show me an implementation of the search plugin? I checked the documentation and it just shows how to set it up - and I can't find anything that showcases how to actually use it. I just want to make a search bar in the products page for the e-commerce template and i'd really appreciate any and all help I can get. Thanks!
#Implementing Search Plugin in E-commerce Template Help
5 messages · Page 1 of 1 (latest)
Original message from @dapper torrent - Moved from #general message
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
Hey, I was also having issues with this plugin. The docs are not very clear but I found a github thread with an answer. If you still need help here is the solution:
-
Adding additional fields to each search items:
You need to add a search override field which you can then access and add values to via the beforeSync hook as seen in the screenshot. -
If you have pre existing data within your collections, you will need to update those collection items for them to be added to the search list. You can select all of your docs in the admin panel and do a batch update and change a field like published on to trigger them to be added to the search list.
-
To access the search data in your front end you can query the collection search.
Hope this helps! 🙂