Content Update
POSTOverview
Section titled “Overview”This endpoint is the primary method for adding new objects or completely replacing existing ones in your search index. You send an array of objects in a JSON payload, and Luigi’s Box processes them in a batch.
The index-object
Section titled “The index-object”The fundamental unit of data you send is the index-object. Your request body must be a JSON object containing a single root key, objects, which holds an array of these index-objects.
Top-level Request Structure
Section titled “Top-level Request Structure”| Parameter | Type | Required | Description |
|---|---|---|---|
objects | Array | ✓ | An array of one or more objects to be indexed. Recommended batch size: around 100 objects. |
Index-Object Parameters
Section titled “Index-Object Parameters”Each object in the objects array must follow this structure:
| Parameter | Type | Required | Description |
|---|---|---|---|
identity | String | ✓ | A unique identity for the object at the index level. It must match the identity reported by analytics events. See the Identity guide. |
type | String | ✓ | Object type such as item, category, or article. Different types can be searched separately. |
generation | String | Object generation marker for bulk data synchronization. | |
active_from | String | ISO 8601 date/time when the object should become searchable, for example 2019-05-17T21:12:35+00:00. | |
active_to | String | ISO 8601 date/time when the object should stop being searchable, for example 2019-05-17T21:12:35+00:00. | |
fields | Object | ✓ | Object attributes. Every field is searchable and can be used for filtering. It must include a title field. |
nested | Array | Array of nested objects such as categories or variants linked to the current object. |
Fields guidelines
Section titled “Fields guidelines”When structuring the fields object:
- Required: Include a
titlefield. This serves as the object display name. - Numeric fields: Format values as numbers, not strings, for example
"height": 70.5. - Date fields: Use ISO 8601 format with the
Tdelimiter. - Array values: Arrays are supported for any field, for example
"color": ["red", "black", "blue"]. - Nesting: Use only one level of nesting and avoid deeply nested objects.
- Facets: Any field you send can become a facet for filtering search results.
Read more about structuring your data.
How to Send an Indexing Request
Section titled “How to Send an Indexing Request”The examples show how to prepare and send your objects array to the API endpoint.
Authentication is required for all requests. The code demonstrates how to construct the necessary headers, including Date and Authorization. The Authorization header requires a dynamically generated HMAC signature. For a detailed explanation of how to create this signature, refer to the main API Authentication guide.
Error handling
Section titled “Error handling”| HTTP Status | Description |
|---|---|
| 400 Bad Request | The request structure is invalid, JSON is malformed, or some objects failed validation. Check the response body for details. |
| 413 Payload Too Large | The request exceeds 5 MB, or 10 MB if compressed. Reduce batch size or enable compression. |
| 429 Too Many Requests | The rate limit has been exceeded. Check the Retry-After header and see the Throttling docs. |
Performance guidelines
Section titled “Performance guidelines”For optimal indexing performance, avoid:
- High nested count: More than 10 nested records per object.
- High field count: More than 10 fields per object.
- Large objects: More than 30 KB per object.
- Large batches: More than 100 objects per request.
Related endpoints
Section titled “Related endpoints”- Partial Content Update updates specific fields only.
- Content Removal deletes objects from the index.
- Update by Query performs bulk updates based on search criteria.
Was this page helpful?
Thanks.