Site search? (e.g. via Lunr)

Just wondering if anyone here has set up client-side search for a Middleman site? For example, like how the jekyll-lunr plugin works.

The Middleman site’s Swiftype integration is lovely, but I’m looking for something that will work behind a firewall.

Thanks!

Woops, I posted too soon — just found this middleman-search-example repo.

We have this running on our multi site middleman implementation and while it works for smaller sites (like sudandola.com) it basically is making search not usable for larger sites (veamosla.com).

Also big sites builds take forever so will probably have to move away from both middleman and lunr :confused:

I ended up using the jekyll-lunr plugin, and a search.json.erb file to create the index.

Case do you have anything on GitHub that shows what you changed on the Jekyll example to work with Middleman?

1 Like

I too would love to hear how exactly you got the jekyll-lunr plugin working with Middleman.

I just wrote up a quick post on how to implement search on a middleman blog: http://willschenk.com/adding-search-to-a-middleman-blog/

I’ve never seen lunr before, so maybe I should check it out instead of implementing everything by scratch. But it’s pretty straightforward to implement something naive.

2 Likes

We’ve just submitted a middleman-search extension that uses lunr.js to build the index, similar to other gems out there and to the jekyll lunr plugin. You can read more about the plugin here, it’s now actually powering the search in our site.