We’re making a super easy drop in search box that will index your site automatically or via a REST request.

  1. Put some HTML for the search box and include the JavaScript widget for searching.
  2. Optionally request an index when content changes via a REST request.

Check out the generators for specific docs.

API

Index

Indexing will happen nightly or on demand in the dashboard

Sample HTML

Create a form with results below the search box

<div class="row mb-4">
  <div class="col">
    <form id="cloudsh" class="search form-inline">
      <div class="form-group">
        <input class="form-control" id="q" placeholder="search" type="text"></input>
        <button class="btn btn-primary">Search</button> </div>
    </form>
  </div>
</div>

<div class="row">
  <div class="col">
    <div id="results"></div>
  </div>
</div>

The form needs to have an iput with a q id on it.

There needs to be a div with the id results.

Create a form that submits to the search page

<form class="search form-inline" method="get" action="/my-search-page">
  <div class="form-group">
    <input class="form-control" id="q" placeholder="search" type="text"></input>
    <button class="btn btn-primary">Search</button>
  </div>
</form>

For other forms, just submit to the search page via GET with a q querystring.

JavaScript

Include some JavaScript on the search page

<script src="https://app.cloudsh.com/js/cloudsh.js"></script>
<script>
  var CshConf = {
    token: "JWT TOKEN",
    formId: "#cloudsh",
    resultsId: "#results",
  };
</script>