How can I add a site search feature to a Jekyll Blog?

10,043

Solution 1

One option to investigate Google Custom Search.

You mention trying to use Google in the past, but I'm not sure if you mean the custom search box as described here. Posting this in case it helps.

Solution 2

Jekyll + lunr.js = powerful full-text search, using JavaScript in your browser, for your Jekyll static website

Solution 3

https://github.com/flaptor/indextank-jquery

Solution 4

https://github.com/chinchang/super-search/

This requires no extra configuration. Just plug and play library that works on your jekyll blog's RSS feeds with neat on-page search UI.

Share:
10,043
cboettig
Author by

cboettig

I am a researcher in theoretical ecology and evolution. My work focuses on regime shifts and draws from many disciplines, including mathematics, computer science, economics, and physics. I'm particularly interested in open science, active learning, big data, web tools, R, high performance computing. Visit my open lab notebook for more information on what I do.

Updated on June 03, 2022

Comments

  • cboettig
    cboettig almost 2 years

    I am looking into migrating my site from Wordpress to Jekyll and would like to maintain the ability to have full-text search for the site. The Wordpress search was fast, reliable, and nicely formatted to match the theme, and I haven't found a decent replacement.

    There's a plugin solution that uses indextank, but I am not interested in tying my search through a commercial API with users ranking the search items, I just want something comparable to Wordpress search.

    I've also looked into the google Ajax api, but I don't want a floating ajax search box on the site.

    There's always google's search for the website, but I haven't found this to be as reliable. (I haven't tried this since I moved to wordpress a few years ago, so perhaps I'm mistaken).

    Since all posts are available in plain-text, it seems like it should not be to difficult to create an index for searching them when the site is built, but I have not found a good solution. Any suggestions or examples?

  • cboettig
    cboettig about 12 years
    I understand google custom search is just a wrapper around site search that lets you embed the results (with advertisements in the free version) into the body of your website? It does look like they let you customize the css a bit to match. This is helpful but not quite what I'm looking for.
  • Janikan
    Janikan about 12 years
    I'm working on getting my jekyll site up and running too. If I figure out something else, I'll post back here.
  • Iaroslav Vorozhko
    Iaroslav Vorozhko almost 12 years
    Also, you need to have an account in Search SaaS. At indexden.com you can get it for free.
  • cboettig
    cboettig about 11 years
    Thanks! Does this load all the site text into browser memory then? Seems like that solution might not scale well, though obviously it takes a lot of text to take up much space. I'm currently using a tweaked version of Marran's stemming search: marran.com/tech/jquery-full-text-indexing-on-jekyll
  • Ben Smith
    Ben Smith about 11 years
    @cboettig yes, it will load the entire index into memory for searching. Would depend upon the size of your Jekyll site, something to consider for large sites. Not sure exactly how 'large' it would need to be to cause an issue.
  • cboettig
    cboettig over 10 years
    After trying both Ben's lunr.js solution (above) and Marran's less memory-intensive fast stemming search I've settled on rolling back to this simple Google search. When I need something different I just grep against my repo copy ;-)
  • Stephen Nguyen
    Stephen Nguyen over 9 years
    Iron.io is moving to Lunr.js are there good examples of sites that execute the user experience well?
  • Samuel
    Samuel about 9 years
    @BenSmith Can it work on the server? I following you step. It works when I use jekyll server. But I upload that to the server. It doesn't work
  • Miloš Miljković
    Miloš Miljković over 7 years
    Lunr.js is a static full text search engine writter in javascript, it doesn't need any backend or server.