Loading...

Resources

A resource is data that rides along with a result but is never searched or filtered — a poster URL, a deep link, a price, an external ID.

  • Returned in every search response.
  • Never indexed, so it doesn't bloat or slow the search.

The three field types, side by side:

Field typeSearch it?Filter by it?Returned?Good for
SearchableYesNoYestitle, plot, tagline
FacetNoYesYesgenre, year, rating
ResourceNoNoYesposter URL, deep link, ID

Add a poster field

On the movies list, choose Fields then Add Resource Field, and name it poster_url.

The Add Resource Field dialog with the name 'poster_url'

Edit each film and paste in its poster address.

The movies list showing a poster_url resource column

It comes back with every result

Search as normal. The poster is in the response, ready for an <img> tag:

GET https://api.searchstack.dev/search/Demo/movies/1?query=matrix
X-API-Key: {your key}
{
  "results": [
    {
      "name": "The Matrix",
      "fields": {
        "genre": "Sci-Fi",
        "year": 1999,
        "poster_url": "https://image.tmdb.org/t/p/w500/f89U3ADr1oiB1s9GkdPOEpXUk5H.jpg"
      }
    }
  ],
  "count": 1,
  "total_count": 1
}

Rule of thumb: if a visitor might type it, searchable; if they might click it to narrow results, a facet; if your app just displays it, a resource.

More on resource fields and how the field types differ: the Fields reference.

« Facets
Next: Uploading »
Load a whole catalogue in one file.
Top