Last updated
Last updated
POST
/v1/indexes
Create or update an index configuration in the Omni system. This endpoint defines how entities are stored, what fields are indexed, and which index name you should pass to other endpoints (e.g., /v1/entity
, /v1/duplicates
) to run deduplication queries against.
Index Naming
Make sure you use a descriptive, unique indexName
.
Subsequent calls to POST /v1/entity
or POST /v1/entity/batch
should include ?indexName=my-product-index
to ensure the correct index is used.
Field Configuration
Specifying fields as text
vs. string
(or other types) allows for different matching strategies and indexing performance.
The more fields you include (e.g., name
, description
, brand
, specifications
), the better the deduplication accuracy — but be mindful that indexing more fields can increase processing time.
Updating an Index
If you need to add new fields or alter field types, you can re-POST to the same indexName
. However, large indexes may require a re-indexing process that could take significant time (similar to initial indexing).
Below is an example JSON Schema for the POST /v1/indexes
request body:
Example Fields
text
: Field is large or free-form text (e.g., product descriptions).
string
: Field is a shorter string (e.g., color, brand).
number
: Field is numeric (e.g., cost, weight).
date
: Field is a date value (e.g., release date, createdAt).
Success (201 Created or 200 OK)
On success, you can now use my-product-index
in subsequent calls to the Products and Duplicates endpoints (e.g., POST /v1/products?indexName=my-product-index
).
Error (e.g., 400, 401, 409)
400 Bad Request: Invalid JSON or missing required fields.
401 Unauthorized: Invalid or missing API key.
409 Conflict: Index name already exists, and you are not allowed to update it (depends on your system’s rules).