Declare your content's languages
const url = 'https://api.shoofai.com/v1/apps/demo-store/languages';const options = { method: 'POST', headers: {'x-shoof-api-key': '<x-shoof-api-key>', 'Content-Type': 'application/json'}, body: '{"languages":["en","ar","fr_FR"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.shoofai.com/v1/apps/demo-store/languages \ --header 'Content-Type: application/json' \ --header 'x-shoof-api-key: <x-shoof-api-key>' \ --data '{ "languages": [ "en", "ar", "fr_FR" ] }'Adds the languages the app doesn’t index yet to its indexLanguages, as many as fit (6 in
all), which rebuilds the index. Languages are never removed this way. Codes can be as sites
send them (ar, fr_FR, pt-BR).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The app’s id, shown in the dashboard (for example ali-sport-goods). demo-store is the public demo app.
Example
demo-storeRequest Bodyrequired
Section titled “Request Bodyrequired”object
Example
[ "en", "ar", "fr_FR"]Responses
Section titled “Responses”The settings, and what was added and skipped.
object
Every setting has a default. See App settings for what each one does.
object
The languages records are analyzed in. Changing them rebuilds the index.
The index languages a query is matched in; empty for all.
A character (the key) and what it is read as. Rebuilds the index.
object
Lowercase letters whose diacritics are kept. Rebuilds the index.
Per language code. See Dictionaries.
object
object
object
object
object
object
object
The keys records send in attributes, with the names the dashboard and the widget’s facets show them by.
object
object
object
object
object
object
object
object
object
object
object
object
The languages the live index has.
How the live index analyzes text.
object
The new index being built, if one is.
object
Goes up with every change.
The preset the facets match, or "".
object
Per feature, whether the plan includes it, the app has it on, and so it runs.
object
object
object
object
Example
{ "settings": { "filterByLang": true, "indexLanguages": [ "en" ], "queryLanguages": [], "ignorePlurals": true, "removeStopWords": true, "decompoundQuery": true, "customNormalization": {}, "keepDiacriticsOnCharacters": "", "dictionaries": { "stopWords": { "fr": { "add": [ "svp" ], "remove": [], "disableStandard": false } }, "plurals": { "ar": [ [ "كتاب", "كتب" ] ] }, "compounds": { "de": [ { "word": "kopfschmerztabletten", "decomposition": [ "kopfschmerz", "tabletten" ] } ] } }, "customFields": [ { "type": "text" } ], "facets": [ { "kind": "terms", "size": 20 } ], "customRanking": [ { "factor": 1, "modifier": "none" } ], "recency": { "weight": 0, "halfLifeDays": 30, "field": "date" }, "typoTolerance": { "enabled": true, "minWordSizeFor1Typo": 4, "minWordSizeFor2Typos": 8, "allowOnNumbers": false }, "mode": "hybrid", "semanticWeight": 1, "lexicalWeight": 1, "semanticCutoff": 0.5, "rrfK": 60, "clickRanking": { "enabled": true, "weight": 0.4 }, "answers": { "enabled": true, "maxSources": 6 }, "trending": { "enabled": true }, "boughtTogether": { "enabled": true }, "related": { "enabled": true, "sameType": true }, "hitsPerPage": 20, "allowedReferers": [] }, "index": { "languages": [ "ar" ], "rebuild": { "kind": "rebuild", "languages": [ "ar" ] } }, "preset": "store", "entitlements": { "plan": "free" }, "added": [ "ar" ], "skipped": [ { "reason": "unsupported" } ]}The request is invalid (bad_request). details lists each problem with its path.
object
object
A stable, machine-readable code.
A human-readable explanation.
More about the error, such as the validation problems.
Example
{ "error": { "code": "bad_request", "message": "Invalid request", "details": [ { "path": "hitsPerPage", "message": "Must be 100 or less" } ] }}