Ask HN: What's the best way to add search to my website?
I have a quite unique website https://ray.run/
I tried to create a website like the ones I remember browsing back in early 2000s. It has questions from the users, discord forum archive, dev tools, videos, etc.
I want to find a way to add search for users. I see it on the other websites, and usually they use Algolia. However, my community is entirely free and their product is paid. What can I do instead? Add a search box, on submit, open a new tab with 'site:ray.run'. You can do this on Google or DuckDuckGo, - https://duckduckgo.com/?q=site%3Aray.run+playwright+test&t=f... - https://www.google.com/search?q=site%3Aray.run+playwright+te... Keep it simple for now. I feel stupid and embarrassed after spending a weekend implementing my own elastic-based solution. At least you can tinker with it and add your own weights and such to float better results, hopefully? If your content is mostly static, you might want to consider pre-building an index and shipping it as a whole. You could look into something like * https://stork-search.net/ (Rust/WASM) * tinysearch: https://github.com/tinysearch/tinysearch (Rust/WASM) * https://lunrjs.com/ (JS, simple, stable) * http://elasticlunr.com/ - based on the former, slightly more sophisticated tuning options Your website https://ray.run/ does have that nostalgic early 2000s vibe, which is cool! Regarding the search functionality, you might want to explore open-source alternatives to Algolia. Projects like Elasticsearch, Solr, or even using Google Custom Search can provide search capabilities without the cost. They might require a bit more setup and maintenance, but they can be budget-friendly options for a free community. In case you need help or assistance with your project, feel free to contact us! https://www.ratherlabs.com This thread makes me feel old... I remember seeing "Google Custom Search" with Custom Search in grey on so many websites just maybe 12-15 years ago - for it to be so unusual that people on HN don't tend to know of it, seems so odd... Looks like Google has a way of doing it https://programmablesearchengine.google.com/controlpanel/cre... Very interesting. You are even allowed to upload your own search annotations, i.e. suggestions for search results. https://cse.google.com/cse?cx=210b5e0b95aee4c07#gsc.tab=0 The end result is not too bad considering it is entirely free! The only downside is that it seems you cannot disable promotions/ads It honestly looks not too bad! Took a bit of time to customize it, but you can match your website style pretty closely. https://cse.google.com/cse?cx=210b5e0b95aee4c07&q=test#gsc.t... Free https://www.mojeek.com/services/search/searchbox.html Paid https://www.mojeek.com/services/search/site-search-api/ Their demo crashes when I try to use it