Skip to content

Search

Search is a standalone service with its own API. Declare indexes under resources.search_indexes[] in stack.json — not as nested resources on tables or buckets. Each index has a sources[] list that can reference multiple tables and buckets in the same environment.

Declare a search index

Add an entry under resources.search_indexes[], then run kernstack deploy.

Field Required Description
name Yes Index name (no /)
sources Yes Tables and buckets to index (see below)
index_type No text (default) or vector

Each sources[] entry:

Field Required Description
type Yes tables or buckets
name Yes Table or bucket name
prefix No Bucket object prefix
include_subfolders No Index objects under prefix recursively (buckets)
fields Tables: yes Fields to index for this source; required for table sources
max_size_bytes No Size cap for this bucket source

Example

{
  "resources": {
    "search_indexes": [
      {
        "name": "catalog",
        "sources": [
          {
            "type": "tables",
            "name": "products",
            "fields": ["title", "description"]
          },
          {
            "type": "tables",
            "name": "articles",
            "fields": ["title", "body"]
          },
          {
            "type": "buckets",
            "name": "media",
            "prefix": "docs/",
            "include_subfolders": true
          }
        ]
      }
    ]
  }
}
kernstack deploy

Schema reference: IAC reference — Search.