Records
A record is one searchable item in one language: a product, a post, a page, a help article. You send records with an admin key; Shoof AI indexes their text for keyword search and embeds it for semantic search.
A record
Section titled “A record”{ "id": "sku-1042-en", "group_id": "sku-1042", "type": "product", "lang": "en", "title": "Trail running shoe", "excerpt": "Grippy, waterproof and light.", "content": "Deep 5 mm lugs grip on wet rock and mud. The waterproof upper keeps feet dry…", "url": "https://example.com/products/trail-shoe", "image": "https://example.com/images/trail-shoe.jpg", "brand": "Salomon", "categories": ["Shoes", "Running"], "category_paths": ["Shoes > Running"], "tags": ["waterproof", "trail"], "sku": ["SAL-1042", "SAL-1042-42", "SAL-1042-43"], "price": 140, "regular_price": 180, "sale_price": 140, "currency": "AED", "in_stock": true, "rating": 4.6, "review_count": 212, "popularity": 1840, "date": "2026-03-02T09:00:00Z", "attributes": { "color": ["Black", "Red"], "size": ["42", "43"] }, "fields": { "material": "Gore-Tex", "weight_kg": 0.31 }}Only id is required. Send the fields that fit your content; a blog post might
only have id, type, lang, title, content, url, author,
categories, tags and date.
Fields
Section titled “Fields”Identity
Section titled “Identity”| Field | Type | Notes |
|---|---|---|
id |
string, ≤ 256 | Unique within the app. Sending a record with an existing id replaces it. |
type |
string, ≤ 64 | product, post, page, or any type of yours, such as recipe or faq. Defaults to post. Filter and facet on it. |
lang |
string | en or ar. Guessed from the text when left out. |
group_id |
string, ≤ 256 | The same for every translation of one item. See Languages. |
These are searched, in this order of weight by default: SKU, title, brand and categories, tags and attributes, excerpt, content. See Relevance to change the weights.
| Field | Type | Notes |
|---|---|---|
title |
string, ≤ 2,000 | Always embedded, first. |
content |
string, ≤ 200,000 | The full text, as plain text. Long text is split into passages for semantic search, so a passage deep in a long article can still be found. |
excerpt |
string, ≤ 10,000 | A summary. |
brand |
string | |
author |
string | |
categories |
string[], ≤ 100 | Category names. |
category_paths |
string[], ≤ 100 | Full paths, such as Clothing > Jackets > Rain, for filtering by branch. |
tags |
string[], ≤ 200 | |
sku |
string, or string[] ≤ 500 | Matches exactly, never with typos. Send the product’s SKU and its variations’ so any of them finds the product. |
attributes |
object of string[] | Product attributes such as {"color": ["Red"]}. Searched together, and filterable as attributes.<key>. See Attributes. |
Display
Section titled “Display”| Field | Type | Notes |
|---|---|---|
url |
string | Where the result links to. |
image |
string | A thumbnail URL, shown by the widget. |
Commerce and ranking
Section titled “Commerce and ranking”| Field | Type | Notes |
|---|---|---|
price |
number ≥ 0 | The current price. Filter, facet and sort on it. |
regular_price, sale_price |
number ≥ 0 | The widget shows a sale when sale_price < regular_price. |
currency |
string | ISO code, such as AED or USD. |
in_stock |
boolean | |
stock_status |
string | Your own status, such as onbackorder. |
rating |
number, 0–5 | |
review_count |
integer | |
popularity |
number ≥ 0 | Sales, views or another popularity measure. A ranking signal by default. |
boost |
number, 0–100 | A manual push up the results. A ranking signal by default. |
ranking |
object of numbers | Your own signals, such as {"margin": 0.4}, for ranking and sorting as ranking.<name>. |
date, modified |
string | ISO 8601. For sorting, date filters and recency. |
Everything else
Section titled “Everything else”| Field | Type | Notes |
|---|---|---|
fields |
object | Values for the app’s declared custom fields: typed, searchable, filterable and sortable. |
meta |
object | Any other values to return with hits. Filterable as meta.<key>, but not searched. |
Attributes
Section titled “Attributes”Records can send any attribute keys. Declare the ones your records use in the
attributes setting, up to 200, each with the name people know it by:
{ "attributes": [{ "key": "color", "label": "Color" }, { "key": "size" }] }The dashboard offers declared attributes by name wherever a setting picks a
field (searchable attributes, facets, exact attributes), with how many records
have each. The widget titles their facets with the name. Without a label, an
attribute goes by its key made readable (shoe_size is “Shoe size”). Keys are
letters, digits, _, - and %, up to 128 characters; names up to 64.
The WordPress plugin declares a store’s product attributes
itself, named as in WooCommerce, and keeps them up to date as attributes and
products change. It marks them "site": true, and the dashboard shows those
read-only, with a lock: rename them in WooCommerce. A facet’s own label can still title one
differently in the widget.
Keys your records send that aren’t declared are still searched, as part of all attributes.
Send records
Section titled “Send records”POST /v1/apps/{appId}/records/batch adds or replaces up to 500 records and
deletes up to 1,000, in a body of up to 10 MB.
curl -s "https://api.shoofai.co/v1/apps/$SHOOF_APP/records/batch" \ -H "x-shoof-api-key: $SHOOF_ADMIN_KEY" \ -H "content-type: application/json" \ -d '{ "upserts": [{ "id": "sku-1042-en", "type": "product", "lang": "en", "title": "Trail running shoe", "price": 140 }], "deletes": ["sku-0007-en"] }'import { ShoofAdminClient } from "@shoof/js-client/admin";
const admin = new ShoofAdminClient({ appId: "my-store", apiKey: process.env.SHOOF_ADMIN_KEY! });
// Any number of records: split into batches for you.const result = await admin.upsertAll(records);
// Or one batch:await admin.batch({ upserts: [record], deletes: ["sku-0007-en"] });The response counts what happened:
{ "indexed": 1, "updated": 0, "skipped": 0, "deleted": 1, "embedded": 1, "errors": [], "warnings": [] }| Field | Means |
|---|---|
indexed |
Records written in full: new ones, and ones whose text changed or that dropped a field. These are embedded. |
updated |
Records whose text was unchanged. They’re updated in place and keep their embeddings. |
skipped |
Records that didn’t need embedding again (the same records as updated). |
deleted |
Records deleted. Deleting an ID that doesn’t exist isn’t an error. |
embedded |
Records embedded, however many passages each one has. |
errors |
{id, error} for each record that failed. The others still went through. |
warnings |
Problems that didn’t stop indexing, such as undeclared custom fields. |
warnedIds |
Each problem in warnings, without its count and example, and the records it was seen on. Left out when there are no warnings. |
Updates replace the whole record
Section titled “Updates replace the whole record”An upsert replaces the record: a field you leave out is removed. To change a price, send the whole record with the new price. Don’t worry about the cost: records whose text hasn’t changed keep their embeddings, so re-sending your whole catalog every night is cheap and fast.
When changes appear
Section titled “When changes appear”Changes become searchable shortly after the call returns. Add ?refresh=true to
wait until they are, for tests and for “save and see it” flows. Don’t use it for
bulk loads; it slows each batch down.
Delete records
Section titled “Delete records”Put IDs in deletes, or delete one at a time with
DELETE /v1/apps/{appId}/records/{id}. To remove everything,
POST /v1/apps/{appId}/records/clear.
To remove records you no longer have without tracking deletions yourself, use a full resync: send everything you have, and whatever you didn’t send is removed at the end.
Read a record
Section titled “Read a record”GET /v1/apps/{appId}/records/{id} returns the record as stored, which is
handy to check what a connector sent.
Languages and translations
Section titled “Languages and translations”Shoof AI supports English (en) and Arabic (ar). Each translation of
an item is its own record, with its own id and lang, and a shared
group_id:
[ { "id": "sku-1042-en", "group_id": "sku-1042", "lang": "en", "title": "Trail running shoe" }, { "id": "sku-1042-ar", "group_id": "sku-1042", "lang": "ar", "title": "حذاء جري للمسارات" }]Searches that send a lang return only records in that language (setting
filterByLang). The group_id lets Shoof AI connect translations: when an
Arabizi query matches an Arabic record, an English
search returns its English translation.
Text in each language is analyzed with that language’s rules: English stemming (“running” finds “run”), and Arabic normalization (letter variants, diacritics and the article). See Arabic and Arabizi.
Limits
Section titled “Limits”| What | Limit |
|---|---|
| Upserts per batch | 500 |
| Deletes per batch | 1,000 |
| Batch body | 10 MB |
| Records per workspace | your plan’s record quota |
A batch that would take your workspace past its record quota is refused with
402 quota_exceeded. Updates and deletes still go through, so you can keep
your index current; you just can’t add records until you upgrade or remove some.