No other search engine can compare to Google, so the simplest, fastest way to get a site search in working order is to include jQuery and then put this either somewhere on your page or included as a js script file:

<script>
(function($){
$(document).ready(function() {
    $('.site_search').submit(function(event) {
        $(this).find('input[name="q"]').val( $(this).find('#search_box').val() + " site:{{site.url}}");
        });
    });
})( jQuery );
</script>

If you’re not using Jekyll as your static site generator, be sure and change out the {{site.url}} part above to your site’s URL.

And then put this wherever you want your actual form to appear. The markup assumes you’re using Twitter Bootstrap but feel free to adjust as needed:

<form class="site_search section small" method="get" action="//google.com/search">
  <div class="form-group">
    <input type="text" id="search_box" class="form-control" placeholder="Search term">
    </div>
  <input type="hidden" name="q">
  <div class="form-group">
    <input type="submit" value="Search" class="button btn btn-primary">
  </div>
</form>

If you’re looking for fancier search options, Jekyll Tips has some good alternatives, but I’m sticking with this one.