Indexing

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.

What the mapping is

The mapping lists every field search knows about. Each field has a type and five flags that say what it is used for: searched, filtered, shown as a facet, sorted by or returned with results. Searchable fields also have text analysis options.

A document may carry fields the mapping does not list. Zaproo stores them, but search ignores them until you map them. See unmapped fields.

The first upload to a new index maps every field it can recognise (see inferred mapping). Check the result before you build search profiles.

Change fields in the cabinet

Open the index, then Fields & mapping. The table lists every field with its type and a badge for each setting that is on.

The Fields & mapping page with the Reindex panel on top, a Filter fields box and a table of fields such as id, sku, name and sold, each with its type, setting badges like Searchable, Filterable and Returnable, and Edit and Remove buttonsFields & mapping lists every field with its type and settings

Edit a field

Click Edit on the field's row. In the dialog, pick the Type and tick what the field is Used for: Searchable, Filterable, Facetable, Sortable or Returnable. Once Searchable is on, the dialog also shows the Text analysis options. Click Apply.

Apply only puts the change into a draft. Nothing is saved yet, so you can edit several fields first.

Add or remove fields

To add a field, enter its New field name (for example attributes.color), pick the New field type and click Add field. To add a field your documents already carry, click Add next to it under Not mapped yet. To drop a field, click Remove on its row. The id field has no Remove button, and neither does a saved field while a shop plugin manages the mapping (see Integrations).

Review and save

The Changes panel lists every draft change and whether it is additive or breaking. A breaking draft shows Saving flags the index as NEEDS_REINDEX. If the draft would break a profile, rule, the index facets, autocomplete or the data source, the panel names and links each use of the field, and Save mapping stays off until you change them. See Fields in use.

Click Save mapping. To throw the draft away instead, click Discard changes.

After a breaking save, the page shows Reindex needed. Click Reindex now in the Reindex panel at the top of the page to build the index with the new mapping. See Reindex and versions.

The table groups every attributes.* field under one collapsible attributes row, which starts collapsed when there are more than eight of them. Filter fields above the table narrows it to the fields whose full name contains what you type.

Find fields by setting or type

Under Filter fields, two rows of chips narrow the table further. Each chip shows how many fields it matches.

  • Settings: Searchable, Filterable, Facetable, Sortable and Returnable. Pick several to see the fields that have all of them, for example every field that is both filterable and sortable.
  • Type: one chip for each field type the mapping uses. Pick several to see the fields of any of those types.

Click a chip again to turn it off. The chips and the text box work together, so price with Sortable on shows the sortable fields whose name contains "price". Reset filters clears the text and every chip. While a filter is on, the attributes group opens so that matching attributes are not hidden.

Only organization owners and admins can change the mapping. Members see the table without the edit controls.

Change the mapping with the API

GET/v1/projects/:projectId/indices/:indexId/mappingProject member or any secret keyPUT/v1/projects/:projectId/indices/:indexId/mappingProject admin or a full-access secret keyPATCH/v1/projects/:projectId/indices/:indexId/mappingProject admin or a full-access secret key

GET returns language, fields and unmapped. PUT takes language and fields and replaces the whole mapping, so send every field you want to keep. A field left out is removed. PATCH takes only fields and changes just the fields it names: a definition adds or replaces that field, null removes it, and every other field and the language stay as they are. Send each named field's whole definition, because a flag left out takes its default. Both answers hold the saved mapping, the updated index and a diff with kind (none, additive or breaking) and one entry per change.

{
  "language": "english",
  "fields": {
    "id": { "type": "keyword", "filterable": true, "sortable": true },
    "title": { "type": "text", "searchable": true, "sortable": true },
    "brand": { "type": "keyword", "searchable": true, "filterable": true, "facetable": true },
    "price": { "type": "float", "filterable": true, "facetable": true, "sortable": true },
    "categories": { "type": "hierarchy", "filterable": true, "facetable": true },
    "attributes.color": { "type": "keyword", "filterable": true, "facetable": true }
  }
}

A flag left out takes its default: returnable is on, the other four are off. Over MCP, get_mapping, update_mapping and update_fields do the same.

Field types

A field holds one value or an array of values of its type. null is allowed.

TypeValuesUse it for
keywordA string, matched as a wholeBrands, SKUs, colours, sizes, URLs
textA string, split into wordsTitles and descriptions
integerA whole number from -2147483648 to 2147483647Stock levels, ratings
longA whole numberLarge counters and ids
floatA numberPrices, weights
doubleA numberSame as float
booleantrue or falseIn stock, on sale
dateAn ISO 8601 date (2026-10-16) or date and time with an offset (2026-10-16T09:30:00Z)Release dates
hierarchyA category path such as "Packaging > Boxes > Cardboard boxes"Category trees

A document whose value does not fit the field's type is rejected when you upload it. A hierarchy field may hold several paths, one per category the product is in. Only text, keyword and hierarchy fields can be searchable.

Flags

The cabinet lists them under Used for when you click Edit on a field, with the same labels.

Searchable

searchableType booleanDefault falseValues text, keyword and hierarchy fields

What it does

Search queries match the words in it. A profile can only list searchable fields in its search fields.

Best practices and common mistakes

  • Make titles, brands and SKUs searchable. Leave prices, URLs and internal ids off: their values only add noise to matching.
  • Turning it on for a field that already holds data is a breaking change. Turning it off is additive.

Related

Filterable

filterableType booleanDefault false

What it does

Results can be narrowed to its values, for example color is Brown or price is between 1 and 5.

Best practices and common mistakes

  • A text field filters on its whole value, and only on values up to 256 characters. Filter on a keyword field instead.
  • Turning it on is additive when the field is already facetable or sortable, and breaking when none of the three was on.

Facetable

facetableType booleanDefault false

What it does

Shows as a filter panel with counts next to the results. Facets themselves are set on the index or in a profile; this flag allows the field to be used there.

Best practices and common mistakes

  • Facet on fields with a short list of values: brand, colour, size, category. A facet on titles or ids lists thousands of values nobody picks.
  • Like filterable, turning it on is additive only when the field is already filterable or sortable.

Related

Sortable

sortableType booleanDefault false

What it does

Results can be ordered by it, for example price:asc in a profile's sort options.

Best practices and common mistakes

  • Sort by numbers and dates. Sorting by a text field uses its whole value, which is rarely what shoppers expect.
  • Like filterable, turning it on is additive only when the field is already filterable or facetable.

Returnable

returnableType booleanDefault true

What it does

Sent back with each result. A profile can narrow the returned fields further, but only to returnable ones.

Best practices and common mistakes

  • Turn it off for data the storefront does not show, such as purchase prices or internal notes. Fewer fields also make responses smaller.
  • Turning it on or off is always additive.

Text analysis

A searchable field has four more options. The cabinet shows them under Text analysis in the field editor once Searchable is on. In the API they go in the field's analysis object. An option left out takes its default.

Every analysis option changes how stored text is split into words, so changing one on an existing field is breaking and needs a reindex.

Split numbers

analysis.splitNumbersType booleanDefault true

What it does

Also index the letter and digit parts of words like 600x400mm or HP12K, so "600" or "12" find them.

Best practices and common mistakes

  • Keep it on for catalogs with sizes and model numbers in titles.
  • Turn it off for a field of codes where "12" finding every code that contains 12 is noise.

Codes

analysis.normalizeCodesType booleanDefault false

What it does

Match codes however they are typed: "hp12k ne", "HP-12K/NE" and "hp12kne" all find HP12K/NE.

Best practices and common mistakes

  • Turn it on for SKU, part number and model fields. Leave it off for titles and descriptions.

Word pairs

analysis.wordPairsType booleanDefault false

What it does

Rank documents higher when two query words appear next to each other, as in "carton box".

Best practices and common mistakes

  • Use it on titles in catalogs where two-word product names matter. It makes the index larger, so leave it off on long descriptions.

Related

Language

analysis.languageType language codeDefault the index language

What it does

Stemming and stop words for this field when they differ from the index language. Every index language can be picked.

Best practices and common mistakes

  • Use it for a field written in another language than the rest, for example English product names in a Finnish catalog.
  • A field without its own language follows the index language, also when that changes.

Field names

  • A name starts with a letter and holds letters, digits and _, up to 64 characters: brand, price_eur.
  • Put product attributes under attributes: the mapping field attributes.color reads color from the document's attributes object. Only one level is allowed.
  • attributes itself is reserved and cannot be mapped.
  • Names that start with zs_alt. belong to language groups. You cannot add or remove them.
  • Every mapping has an id field of type keyword. You cannot remove it or change its type.
  • A mapping holds at most 500 fields.

Other nested objects in a document are stored but never mapped.

Inferred mapping

An index created without fields maps its fields from the first upload. Each field gets a type and flags from its values:

ValuesBecomes
true or falseboolean, filterable and facetable
Numbersfloat, filterable and sortable
ISO 8601 datesdate, filterable and sortable
Strings longer than 64 characters or with more than three wordstext, searchable
Links starting with http://, https:// or /keyword, returnable only
Other stringskeyword, searchable, filterable and facetable
Mixed typesNot mapped

Common product fields keep fixed flags when their values fit: title, shortDescription, description, url, imageUrl, price, currency, brand, categories (as hierarchy), sku and inStock.

Inference runs once. Fields that later uploads bring are not mapped automatically. They appear under unmapped fields.

Review the inferred mapping before you build profiles. Inference cannot tell that color should be a facet but ean should not.

Unmapped fields

GET mapping lists in unmapped every field your documents carry that the mapping lacks, with a sample value, the suggested definition inference would give it (null when its values mix types) and firstSeenAt. Up to 1000 field names are recorded per index.

In the cabinet they appear under Not mapped yet on Fields & mapping, each with a sample value. Add puts the field into the draft with the suggested definition. Click Edit on it if needed, then Save mapping.

Documents already uploaded hold values for these fields, and a mapping update does not index stored values. Adding an unmapped field is therefore breaking: save it, then reindex so search covers every document.

Additive and breaking changes

A save compares the new mapping with the live version.

  • Additive changes apply at once, and the index stays READY.
  • Breaking changes are saved, but the live version keeps the previous mapping. The index moves to NEEDS_REINDEX until a reindex builds a version with the new mapping.
ChangeKind
Add a field no document carries yetAdditive
Add a field documents already carryBreaking
Remove a fieldBreaking
Change a field's typeBreaking
Any flag offAdditive
returnable onAdditive
searchable onBreaking
filterable, facetable or sortable on, when one of the three is already onAdditive
filterable, facetable or sortable on, when none of the three is onBreaking
Any text analysis optionBreaking
The index languageBreaking

Search, filters and profiles keep working on the live version while the index waits for a reindex. While a version is being built, a breaking save answers 409 VERSION_BUILDING. Additive saves still work.

Fields in use

A mapping change may not break the search configuration that uses it. Remove a field from the profiles, rules and facets that use it first, then remove it from the mapping. The same holds for a type change or a flag turned off: a profile that filters on price with a range needs price to stay numeric and filterable.

A save is refused with 409 MAPPING_BREAKS_CONFIG when it would make any of these invalid:

details lists every use, so you know what to change:

{
  "error": {
    "code": "MAPPING_BREAKS_CONFIG",
    "message": "This mapping change would break search configuration that uses \"brand\". Remove or change those uses in the profiles, rules, facets, autocomplete or data source listed in details first.",
    "details": [
      { "kind": "facets", "id": null, "name": "Index facets", "path": "facets.0.field", "field": "brand", "message": "\"brand\" is not a mapped field" }
    ]
  }
}

kind is profile, rule, facets, suggest or feed. id is the profile or rule id, and null for the others. path points into that configuration. A use that was already invalid before the change does not block it.

GET/v1/projects/:projectId/indices/:indexId/mapping/usageProject member or any secret key

Returns what the guard checks: profiles, rules (each { id, rule }), facets, suggestFields and feedFields. The cabinet uses it to show the same issues in the Changes panel before you save, with a link to each profile, rule or page that uses the field.

Integrations

A shop platform plugin can seed the mapping for you. While the plugin's Add new attributes to the Zaproo mapping setting is on, the plugin adds each new shop attribute as a field. Once a field is saved, Zaproo owns it: a later sync from the plugin adds only fields the mapping lacks, and never changes or removes a saved field or the index language. In Fields & mapping you can change any field and add new ones, but you can't remove a field. A PUT or PATCH .../mapping from anyone but the plugin's key that removes a field answers 409 MAPPING_MANAGED_BY_INTEGRATION; exclude the attribute in the plugin, or turn the setting off there, to remove it. A breaking change still marks the index Reindex needed, and the plugin rebuilds the index on its next sync. See Integrations.

Language group fields

An index in a language group holds the text the other members lend it. Each copy is a mapping field named zs_alt.<source language>.<field>, for example zs_alt.english.title. The group adds and removes these fields when you save it. The cabinet lists them in a section of their own.

A borrowed field is always text and analyzed in the language it came from. It is always searchable, and filterable, facetable and sortable stay off. It starts not returnable. Turning Returnable on is additive, and then a profile's returned fields can include it. You may change Split numbers, Codes and Word pairs, which are breaking changes as on any other field. A search profile only searches a borrowed field once it lists it under Fields and weights.

A PUT or PATCH .../mapping that adds a zs_alt. field answers 400 MAPPING_FIELD_RESERVED. One that leaves out or removes a field the group lends answers 409 MAPPING_MANAGED_BY_LANGUAGE_GROUP. Change the group's shared fields instead. Removing a borrowed field through the group is additive: the next sync strips its text from the documents.

Errors

CodeWhen
400 VALIDATION_FAILEDPATCH names no field, a field name is invalid, id is missing or not keyword, attributes is mapped, there are more than 500 fields, or a flag or option does not fit the type. details names each field.
409 VERSION_BUILDINGA breaking save while a reindex or replace session is running.
409 MAPPING_BREAKS_CONFIGThe change would break a profile, rule, facet, autocomplete field or data source. details lists each use. See Fields in use.
409 MAPPING_MANAGED_BY_INTEGRATIONA shop platform plugin manages the mapping, and the change removes a field. See Integrations.
400 MAPPING_FIELD_RESERVEDThe change adds a zs_alt. field. Only a language group adds those. See Language group fields.
409 MAPPING_MANAGED_BY_LANGUAGE_GROUPThe change removes a field a language group lends the index. See Language group fields.
400 LANGUAGE_UNAVAILABLEA field or the index uses a language the cluster cannot analyse.