Replace a dictionary
const url = 'https://api.shoofai.com/v1/apps/demo-store/dictionaries/stopWords';const options = { method: 'PUT', headers: {'x-shoof-api-key': '<x-shoof-api-key>', 'Content-Type': 'application/json'}, body: '{"ar":[["كتاب","كتب"]]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.shoofai.com/v1/apps/demo-store/dictionaries/stopWords \ --header 'Content-Type: application/json' \ --header 'x-shoof-api-key: <x-shoof-api-key>' \ --data '{ "ar": [ [ "كتاب", "كتب" ] ] }'Replaces one dictionary in every language: the body is the dictionary by language code. Stop
words and plurals apply at once; compounds rebuild the index (index.rebuild).
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
{ "ar": [ [ "كتاب", "كتب" ] ]}Responses
Section titled “Responses”The dictionaries as saved, and the index’s state.
object
Per language code. See Dictionaries.
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
Example
{ "dictionaries": { "stopWords": { "fr": { "add": [ "svp" ], "remove": [], "disableStandard": false } }, "plurals": { "ar": [ [ "كتاب", "كتب" ] ] }, "compounds": { "de": [ { "word": "kopfschmerztabletten", "decomposition": [ "kopfschmerz", "tabletten" ] } ] } }, "index": { "languages": [ "ar" ], "rebuild": { "kind": "rebuild", "languages": [ "ar" ] } }}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" } ] }}The record doesn’t exist (not_found).
object
object
A stable, machine-readable code.
A human-readable explanation.
More about the error, such as the validation problems.
Example generated
{ "error": { "code": "example", "message": "example", "details": "example" }}