Settings

Theme

Ask HN: What's the best way to add search to my website?

5 points by lucgagan 2 years ago · 12 comments · 1 min read


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?

rovr138 2 years ago

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.

  • ggeorgovassilis 2 years ago

    I feel stupid and embarrassed after spending a weekend implementing my own elastic-based solution.

    • solardev 2 years ago

      At least you can tinker with it and add your own weights and such to float better results, hopefully?

fabianholzer 2 years ago

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

ezedv 2 years ago

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

james-revisoai 2 years ago

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...

lucgaganOP 2 years ago

Looks like Google has a way of doing it https://programmablesearchengine.google.com/controlpanel/cre...

dotcoma 2 years ago

Free https://www.mojeek.com/services/search/searchbox.html

Paid https://www.mojeek.com/services/search/site-search-api/

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection