Wondering why Algolia doesnt generate a snippet of code, where I’d just have to enter the API key and Index ID and use it wherever I needed search?
I tried to work with instantsearch.js like a toddler who doesn’t know exactly what he is doing, and obviously not getting the right results…
Appreciate any help to get me out of misery.
I followed this how-to : https://code.luasoftware.com/tutorials/algolia/add-algolia-search-to-hugo-static-website/
- Created an index and verified that it works in Algolia dashboard.
Here is where I am: https://aravindh.net/test_search.html
(you can view the source to see my messy JS)
However, by default it displays all the results (as if I searched for *) instead of displaying an empty box and waiting for the user to type something to search. I imagine that this is designed in such a way that I can point to this page from a HTML
form tag so that user can see the search results. But, I’d like an autocomplete search from the main page just like their examples.
What I would like is a block of code, that is like below,
<style tag ### Some style code
<script tag ### load necessary JS files
<form tag with a search box and submit button
< results box that is initially empty, but displays the results based on what user types
I would basically reuse the whole thing above in every page I want to add this search feature in…