Loading...

Start here: build a search box

One worked example, one feature per page: the search box for a movie-night website. It ends live on the last page.

The finished search box showing a result for the query 'dream'

What a list is

A list is where your searchable data lives — a collection of results sharing the same fields, like a single table. A movies list has a title, a plot and a genre; a cinemas list has a name and a location. Every list gets its own live search API the moment it exists.

Sign in to the console, choose Create List, type movies and leave the rest on their defaults — free plan, no embedding model, platform storage. (Add a semantic model later, and a paid plan on Go live.)

The Create List dialog with the name 'movies' entered

Add a few movies

A single entry is a search result — here, a film. Open the movies list, choose Add Search Result, type a film title and save. A result needs nothing but a name to start. Add a handful.

The Add Search Result dialog with a film title entered The movies list showing five films: Parasite, The Dark Knight, Interstellar, Inception, The Matrix

You already have a working search API

  • Live and read-only from the moment the list existed. Nothing to deploy.
  • Base address https://api.searchstack.dev/, with your API key in an X‑API‑Key header.
  • Create a key on the Developers tab; a read-only key is safe in a browser.

The three things a list can do:

  • suggest – fast as-you-type completions, made for an autocomplete box.
  • search – full search over your fields, returning complete results, paged, with filters applied.
  • facet – counts grouped by a field's values, for building filter menus (you'll use this once your list has facet fields).

A suggestion as your visitor types inc. The version in the path is 1 for a brand-new list:

GET https://api.searchstack.dev/suggest/Demo/movies/1/inc
X-API-Key: {your key}
[
  { "name": "Inception" }
]

The search operation returns full results with a total count:

GET https://api.searchstack.dev/search/Demo/movies/1?query=dark
X-API-Key: {your key}
{
  "results": [
    { "name": "The Dark Knight" }
  ],
  "count": 1,
  "total_count": 1
}

A search matches only the film's name so far, because that is the list's only field.

How lists store data, related-result lookups and every option: the Lists reference.

Next: Searchable fields »
Make your movies findable by plot, not just title.
Top