Hacker News new | ask | show | jobs
by arkadiyt 2245 days ago
Philosophically building website search on top of Elasticsearch seems fine, but don't call it a static site then - you're deploying a backend.

"Static site search" to me is something like adding a `<form action="https://duckduckgo.com" method="get">` text box to your site.

2 comments

@arkadiyt Thanks - I see your point. However, I believe you can also think about it as a service - similar to how Disqus can be added to your static site. That is, the site is static, but the results for the search are handled with a service. In this case the "service" - Elasticsearch - is tightly coupled to your static site's revision.
You’re confusing static with serverless.

Your content is indeed static but your search is not: It’s handled by a service that parses your requests and produces output.

Static content on the other hand are files being served straight from the filesystem.

As for Disqus, they’re not static either, they’re just “a service for static websites”

@turnipla Indeed, the Elasticsearch is completely a typical request - response kind. However, the point in the post was showing how we could make sure the search is in full sync with static site - even if we for example rolled-back deploys. That is, even if we rollback to a revision with less content than what we have in the "default" index, search will not show it to us.
Yes. I have a Google Custom Search engine which I dispatch via javascript. It just displays the results formatted from a json list. It is just a matter of preference, since DDG can't integrate search with an API as far as I know.