Skip to main content
The Search Service API exposes two different patterns:
  • Tables for structured records and explicit search operations.
  • Text Store for text-first retrieval with grouped text sets.
Use Tables when you want direct control over schema, filters, and search operations. Use Text Store when your integration already depends on that workflow and its additional headers.

Create a search table

Create the table with a schema that matches your records.
curl https://apigw.mka1.com/api/v1/search/tables \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <mka1-api-key>' \
  --header 'X-On-Behalf-Of: <end-user-id>' \
  --data '{
    "name": "support_kb",
    "schema": {
      "fields": [
        {
          "name": "id",
          "type": "string",
          "nullable": false
        },
        {
          "name": "content",
          "type": "string",
          "nullable": false,
          "index": "FTS"
        },
        {
          "name": "category",
          "type": "string",
          "nullable": false
        },
        {
          "name": "rating",
          "type": "float",
          "nullable": true
        },
        {
          "name": "embedding",
          "type": "vector",
          "nullable": false,
          "dimensions": 3
        }
      ]
    }
  }'

Insert rows

Insert records that match the table schema.
curl https://apigw.mka1.com/api/v1/search/tables/support_kb/data \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <mka1-api-key>' \
  --header 'X-On-Behalf-Of: <end-user-id>' \
  --data '{
    "data": [
      {
        "id": "doc_001",
        "content": "Reset your password from the account settings page.",
        "category": "account",
        "rating": 4.7,
        "embedding": [0.13, -0.09, 0.41]
      },
      {
        "id": "doc_002",
        "content": "Use two-factor authentication for added account security.",
        "category": "security",
        "rating": 4.9,
        "embedding": [0.07, -0.02, 0.36]
      }
    ]
  }'

Search the table

Combine search operations in one request. The example below uses vector search plus a filter.
curl https://apigw.mka1.com/api/v1/search/tables/support_kb/search \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <mka1-api-key>' \
  --header 'X-On-Behalf-Of: <end-user-id>' \
  --data '{
    "operations": [
      {
        "type": "vector_search",
        "field": "embedding",
        "vector": [0.11, -0.06, 0.37],
        "distance_type": "cosine",
        "limit": 5
      },
      {
        "type": "filter",
        "expression": "category = '\''security'\''",
        "prefilter": true
      }
    ],
    "return_columns": [
      "id",
      "content",
      "category",
      "rating"
    ]
  }'
Use this pattern when you need precise control over ranking, filtering, limits, and returned columns.

Use Text Store when you need grouped text retrieval

The Text Store endpoints in the current OpenAPI spec require extra headers in addition to Authorization:
  • x-api-key-id
  • x-user-id
  • x-exchange-jwt-external-user-id
For example, creating a text store uses this request body:
{
  "store_name": "product_catalog",
  "dimension": 3
}
Searching that store uses this request body:
{
  "query": "noise-cancelling headphones",
  "vector": [0.16, -0.08, 0.29],
  "limit": 5
}
If your integration uses Text Store, make sure you have those additional header values available before you adopt that workflow. Otherwise, start with Tables.