Core concepts

Collections, queries, facets, filters, merchandising, and queryId.

These ideas are the same on the API and the JS SDK. Hosts and keys: Get your keys.

Collection

A collection is a named index of documents (for example products). Search, browse, and analytics are scoped to that name.

Filterable and sortable fields are configured per collection. Shopify catalog sync: Catalog sync.

Query

Search is a text query (q) plus optional filters, facets, sort, and pagination.

Browse is the same shape without q - category pages and listings.

{ "q": "shirt", "perPage": 20 }

Omit semanticWeight for keyword-only. See Semantic search.

Merchandising is set in the tenant dashboard. Responses already include that order. No extra request field.

Facets

Ask for facets when you want counts per field value (brand, size, color).

{ "q": "shirt", "facets": ["brand", "options.Color"] }

The response includes facetCounts. See Filtering & facets.

Filters

A filter is { "field": string, "op"?: string, "values": string[] }. op defaults to =. Operators: =, !=, >, >=, <, <=, range (values is [min, max]).

{
  "q": "shirt",
  "filters": [
    { "field": "status", "op": "=", "values": ["ACTIVE"] },
    { "field": "minPrice", "op": "range", "values": ["1000", "5000"] }
  ]
}

Clauses AND together. Multiple values in one = clause are OR. See Filtering & facets.

Events and queryId

Every search (and often browse) response includes a queryId. Keep it. Send it on later click and conversion events.

Post events to the events host (https://{TENANT_ID}-events.kelp.click/analytics/events), not the search host. Direct API callers supply sessionId, userId, and occurredAt. See Events.

Documents

Kelp does not impose a document schema. You index your own fields. Each hit is { "document": { ... }, "highlights": [...] }. id and objectId are always present.

Shopify product fields: catalog fields.

On this page