logoalt Hacker News

jtbaylylast Sunday at 3:12 PM3 repliesview on HN

But how in the world will you shove a decent search into a static site?

I really want to know because there is a Drupal 7 site that I need to migrate to something but I need good search on it (I’m using solr now).

Edit: I should have specified that I need more functionality than just word searching. I need filtering (ie faceted search) too. I’ve used a SSG that uses a JavaScript index and appreciate it, but that’s not going to cut it for this project.


Replies

stavroslast Sunday at 3:19 PM

The usual way is to create an index on generation time and serve it statically. JS just uses the index to do the search. It's a big file, so I'm not saying it's a great solution for everyone, but it works reasonably well.

Of course, for my site I just redirect the user to a search engine plus `site:stavros.io`.

seanwilsonlast Sunday at 3:16 PM

See https://gohugo.io/tools/search/. Not sure how well they scale to thousands of posts, but they work by statically generating multiple static search index files at build time that are queried via client JavaScript when hosted. The search UX is actually really good because they tend to respond instantly as you type your query and allow complex queries.

show 1 reply
anotherevanlast Sunday at 11:51 PM

> there is a Drupal 7 site that I need to migrate to something

You may be interested in Backdrop, which is a maintained fork of Drupal 7.

https://backdropcms.org/

(No experience with it personally. Only know about it from a friend who uses it.)