Skip to content

Declare your content's languages

POST
/v1/apps/{appId}/languages
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).

appId
required
string

The app’s id, shown in the dashboard (for example ali-sport-goods). demo-store is the public demo app.

Example

demo-store
Media typeapplication/json
object
languages
required
Array<string>
<= 50 items

Example

[
"en",
"ar",
"fr_FR"
]

The settings, and what was added and skipped.

Media typeapplication/json
object
settings

Every setting has a default. See App settings for what each one does.

object
filterByLang
boolean
default: true
indexLanguages

The languages records are analyzed in. Changing them rebuilds the index.

Array<string>
default: en >= 1 items <= 6 items
Allowed values: ar bg bn ca ckb cs da de el en es et eu fa fi fr ga gl he hi hu hy id it ja ko lt lv nl no pt ro ru sr sv th tr ur zh
queryLanguages

The index languages a query is matched in; empty for all.

Array<string>
default: <= 6 items
Allowed values: ar bg bn ca ckb cs da de el en es et eu fa fi fr ga gl he hi hu hy id it ja ko lt lv nl no pt ro ru sr sv th tr ur zh
ignorePlurals
One of:
boolean
removeStopWords
One of:
boolean
decompoundQuery
boolean
default: true
customNormalization

A character (the key) and what it is read as. Rebuilds the index.

object
key
additional properties
string
>= 1 characters <= 2 characters
keepDiacriticsOnCharacters

Lowercase letters whose diacritics are kept. Rebuilds the index.

string
"" <= 50 characters
dictionaries

Per language code. See Dictionaries.

object
stopWords
object
key
additional properties
object
add
Array<string>
<= 1000 items
remove
Array<string>
<= 1000 items
disableStandard
boolean
plurals
object
key
additional properties
Array<Array<string>>
<= 5000 items
compounds
object
key
additional properties
Array<object>
<= 5000 items
object
word
required
string
decomposition
required
Array<string>
>= 2 items <= 10 items
customFields
Array<object>
<= 100 items
object
name
required
string
type
required
string
Allowed values: text keyword number date boolean
label
string
attributes

The keys records send in attributes, with the names the dashboard and the widget’s facets show them by.

Array<object>
<= 200 items
object
key
required
string
/^[\p{L}\p{N}_\-%]{1,128}$/
label
string
<= 64 characters
semanticAttributes
Array<string>
searchableAttributes
Array<object>
object
field
string
weight
number
<= 20
facets
Array<object>
object
field
string
kind
string
default: terms
Allowed values: terms stats
size
integer
default: 20 >= 1 <= 200
label
string
customRanking
Array<object>
object
field
string
factor
number
default: 1 <= 10
modifier
string
default: log1p
Allowed values: none log1p sqrt
recency
object
weight
number
0 <= 5
halfLifeDays
number
default: 30
field
string
default: date
typoTolerance
object
enabled
boolean
default: true
minWordSizeFor1Typo
integer
default: 4
minWordSizeFor2Typos
integer
default: 8
allowOnNumbers
boolean
disableOnAttributes
Array<string>
disableOnWords
Array<string>
mode
string
Allowed values: hybrid lexical semantic
semanticWeight
number
default: 1 <= 5
lexicalWeight
number
default: 1 <= 5
semanticMinScore
number
<= 1
semanticCutoff
number
default: 0.5 <= 1
rrfK
integer
default: 60 >= 1 <= 500
clickRanking
object
enabled
boolean
default: true
weight
number
default: 0.4 <= 5
answers
object
enabled
boolean
default: true
maxSources
integer
default: 6 >= 1 <= 12
trending
object
enabled
boolean
default: true
boughtTogether
object
enabled
boolean
default: true
related
object
enabled
boolean
default: true
sameType
boolean
default: true
hitsPerPage
integer
default: 20 >= 1 <= 100
attributesToRetrieve
Array<string>
allowedReferers
Array<string>
default:
index
object
languages

The languages the live index has.

Array<string>
Allowed values: ar bg bn ca ckb cs da de el en es et eu fa fi fr ga gl he hi hu hy id it ja ko lt lv nl no pt ro ru sr sv th tr ur zh
analysis

How the live index analyzes text.

object
rebuild

The new index being built, if one is.

object
kind
string
Allowed values: rebuild sync
startedAt
string format: date-time
languages
Array<string>
Allowed values: ar bg bn ca ckb cs da de el en es et eu fa fi fr ga gl he hi hu hy id it ja ko lt lv nl no pt ro ru sr sv th tr ur zh
copying
boolean
copied
integer
total
integer
version

Goes up with every change.

integer
preset

The preset the facets match, or "".

string
Allowed values: store blog ""
entitlements
object
plan
string
Allowed values: free starter growth pro scale
features

Per feature, whether the plan includes it, the app has it on, and so it runs.

object
key
additional properties
object
included
boolean
enabled
boolean
active
boolean
limits
object
rules
integer
synonyms
integer
analyticsDays
integer
added
Array<string>
Allowed values: ar bg bn ca ckb cs da de el en es et eu fa fi fr ga gl he hi hu hy id it ja ko lt lv nl no pt ro ru sr sv th tr ur zh
skipped
Array<object>
object
language
string
reason
string
Allowed values: unsupported limit

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.

Media typeapplication/json
object
error
required
object
code
required

A stable, machine-readable code.

string
message
required

A human-readable explanation.

string
details

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"
}
]
}
}