Add Search to Ghost using Swiftype


  1. Head to swiftype.com and type your URL into the screen shown.
    swiftype main page
  2. Create an account if you don't have one already.
  3. It will then do a check of your URL and some validation, then ask for you to name the engine. Enter in a name.
    swiftype setup
  4. Add in your contact info if you would like.
  5. Click on "Complete Setup"
    swiftype sitemap
  6. Click on "Install Swiftype On Your Website" and it will give you the code you need.

    The code is in two chunks, the first is the input where the search will go, and the second is the script needed for it to work. swiftype code

  7. In order for swiftype to work, you do have to wait for it to finish crawling your site. It can take a little while. So, while its doing that, lets edit the theme code.
  8. Open up your theme and go to where you would like the search to be (default.hbs if you want on every page, index.hbs if you want on the home page). I am going to use the index.hbs to put the search on my home page.
  9. Add the body and the script they give you (its fine to just keep them right by each other) to your theme where you want them to show up. We put it just below the header:
  10. Once Swiftype is done indexing (we did have to refresh to see when it was done, the button just kept spinning), stop and start Ghost, and then you will see the search on your site!
    swiftype complete
10. Once Swiftype is done indexing (we did have to refresh to see when it was done, the button just kept spinning), stop and start Ghost, and then you will see the search on your site! ![swiftype complete](/content/images/2015/11/swiftype-5.jpg)