Indices and languages
What an index is
An index holds one catalog: its documents, its mapping (the fields and what each is used for), its search profiles, synonyms and ranking rules. A project can hold several indices, for example one per shop language or one per brand. Searches never cross indices.
Each index has one language. The language decides how text is split into words, which word forms count as the same word and which short words are ignored.
Create an index
Give the index a name and a language. The name is unique in its project and 1 to 100 characters long. The language defaults to english.

Create an index from the Indices page
Leave out the fields and the index starts with only id. The first document upload then maps every field it can recognise. To control the mapping from the start, send fields with the create request. See inferred mapping.
Open Indices and click New index. Enter a Name, pick a Language and click Create index. Only organization owners and admins see the button.
curl -X POST https://api.zaproo-search.com/v1/projects/$PROJECT_ID/indices \
-H "Authorization: Bearer $ZS_KEY" -H "Content-Type: application/json" \
-d '{"name": "products", "language": "german"}'
Create an index called products in German.
The agent calls create_index.
/v1/projects/:projectId/indicesProject admin or a full-access secret keyGET/v1/projects/:projectId/indicesProject member or any secret keyGET/v1/projects/:projectId/indices/:indexIdProject member or any secret keyDELETE/v1/projects/:projectId/indices/:indexIdProject admin or a full-access secret keyThe list and the single index return id, name, language, status, docCount, activeVersion and buildingVersion. The single index also returns activeReindexTaskId and openReplaceSessionId, so a client can pick up a running reindex or an open replace session again.
DELETE answers 204 and removes the index with its documents, profiles, synonyms and rules at once. Tasks that have not finished are cancelled. There is no undo.
A key limited to some indices cannot create an index: the API answers 403 INDEX_SCOPED_KEY. Such a key sees only its own indices in the list. Any other index id answers 404.
Index status
status tells you whether the index has what its saved mapping asks for. Search keeps working in every status except CREATING.

The index overview shows its status and what is left to set up
| Status | What it means | What to do |
|---|---|---|
CREATING | The index is being set up. It lasts a moment. If setup fails, the index is removed again. | Wait. |
READY | The live version matches the saved mapping. | Nothing. |
NEEDS_REINDEX | You saved a mapping with a breaking change. Search and writes use the live version with the previous mapping. | Reindex. |
REINDEXING | A new version is being built, by a reindex or a replace session. Writes reach both versions. | Wait, or cancel. |
FAILED | The last build failed and was dropped. Search uses the live version as before. | Read the task's errors, then reindex again. |
The cabinet shows the status on the Indices list and on the index overview. The overview also shows a Reindex needed warning while the status is NEEDS_REINDEX.
Languages
Every index language and the analysis it gets:
| Language | language | Analysis |
|---|---|---|
| English (US) | english | Stemming and stop words |
| Bulgarian | bulgarian | Stemming and stop words |
| Croatian | croatian | Basic matching: no word-form reduction |
| Danish | danish | Stemming and stop words |
| Dutch | dutch | Stemming and stop words |
| Estonian | estonian | Stemming and stop words |
| Finnish | finnish | Stemming and stop words |
| French | french | Stemming and stop words |
| German | german | Stemming and stop words |
| Greek | greek | Stemming and stop words |
| Hungarian | hungarian | Stemming and stop words |
| Italian | italian | Stemming and stop words |
| Latvian | latvian | Stemming and stop words |
| Norwegian | norwegian | Stemming and stop words |
| Polish | polish | Stemming and stop words |
| Portuguese | portuguese | Stemming and stop words |
| Romanian | romanian | Stemming and stop words |
| Russian | russian | Stemming and stop words |
| Serbian | serbian | Stemming and stop words |
| Slovenian | slovenian | Basic matching: no word-form reduction |
| Spanish | spanish | Stemming and stop words |
| Swedish | swedish | Stemming and stop words |
| Language-neutral | standard | Basic matching: no word-form reduction |
Language tiers
Languages come in two tiers.
- Stemming and stop words. Stemming reduces word forms, so "boxes" finds "box". Stop words such as "the" and "and" are ignored.
- Basic matching: no word-form reduction. Text is lowercased and accents are folded, so "Café" finds "cafe". "boxes" does not find "box". Croatian and Slovenian are in this tier.
standard(Language-neutral) is too: use it for a catalog in several languages or one made mostly of codes.
The cabinet groups the language picker by tier. The index overview shows the tier under the language when the language has basic matching only.
A single searchable field can use a different language from its index, for example an English title in a German index. See the field's Language option.
Change the language
The language is part of the mapping. A change re-analyses every text field, so it is a breaking change and needs a reindex. The cabinet has no control for it. Send the whole mapping with the new language:
PUT/v1/projects/:projectId/indices/:indexId/mappingProject admin or a full-access secret keycurl https://api.zaproo-search.com/v1/projects/$PROJECT_ID/indices/$INDEX_ID/mapping \
-H "Authorization: Bearer $ZS_KEY" > mapping.json
# edit "language" in mapping.json, then drop the "unmapped" list
curl -X PUT https://api.zaproo-search.com/v1/projects/$PROJECT_ID/indices/$INDEX_ID/mapping \
-H "Authorization: Bearer $ZS_KEY" -H "Content-Type: application/json" -d @mapping.json
The answer's diff lists the language change as breaking and the index moves to NEEDS_REINDEX. The index's language shows the new value at once, but search keeps the old analysis until you reindex.
Errors
| Code | When |
|---|---|
409 INDEX_NAME_TAKEN | The project already has an index with this name. |
403 INDEX_SCOPED_KEY | A key limited to some indices tried to create one. |
400 LANGUAGE_UNAVAILABLE | The search cluster lacks the OpenSearch plugin the language needs. Polish needs analysis-stempel. The hosted service has it. |
404 INDEX_NOT_FOUND | The index does not exist, belongs to another project or is outside the key's scope. |
Related
Rate limits and errors
How many requests each route accepts per minute, what a 429 looks like, the error format and every error code with its HTTP status.
Mapping and fields
Field types, the five flags that decide what a field is used for, text analysis options, unmapped fields, and which changes need a reindex.