Skip to content

Create Index

Overview

Before you can start adding products and performing searches, you need to create an index. An index is a collection that stores and organizes your product data for efficient search and retrieval. The Marqo Ecommerce API provides specialized model types optimized for different retail sectors.

What is an Index?

An index serves as the foundation for your search functionality. It defines:

  • Data Structure: How your product information is organized and stored
  • Search Capabilities: What types of searches and recommendations are available
  • Model Optimization: Which AI models are used for understanding and matching your products

Think of an index as a smart catalog that not only stores your products but also understands their content, relationships, and context to deliver relevant search results.

Model Types

The Marqo Ecommerce API offers several specialized model types:

custom

  • Best for: Production use cases
  • Optimized for: Your own specific ecommerce product catalogues, with customized models trained on your data to understand your unique product attributes, terminology, and customer search patterns
  • Features:
    • Tailored search relevance for your product domain
    • Custom-trained models that understand your specific product categories
    • Optimized for your unique business requirements
  • How to access: Custom models will be provided by the Marqo team, please reach out to Marqo for more information

ecommerce

  • Best for: General retail products across various categories
  • Optimized for: Broad product catalogs, multi-category stores, marketplace platforms
  • Use cases: Electronics, home goods, books, general merchandise

fashion

  • Best for: Fashion, apparel, and style-related products
  • Optimized for: Clothing, accessories, footwear, fashion items
  • Use cases: Fashion retailers, clothing brands, style platforms

API Reference

Create Index Endpoint

Endpoint: POST https://ecom.marqo-ep.ai/api/v1/indexes

Headers:

  • Authorization: Bearer {api_key} - Your API key for authentication
  • Content-Type: application/json - Specify JSON content type

Request Body:

{
  "indexName": "<your-index-name>",
  "modelType": "ecommerce"
}

Parameters

Parameter Type Required Description
indexName string Yes A unique name for your index. Must be alphanumeric and can contain hyphens or underscores.
modelType string Yes The model type optimized for your product catalog. Options: ecommerce, fashion, or custom

Example Request

curl -X POST https://ecom.marqo-ep.ai/api/v1/indexes \
    -H "Authorization: Bearer {api_key}" \
    -H "Content-Type: application/json" \
    -d '{
  "indexName": "my-store-products",
  "modelType": "ecommerce"
}'

Best Practices

Index Naming

  • Use descriptive names that reflect your business or product category
  • Avoid spaces; use hyphens or underscores instead

Model Type Selection

  • Choose ecommerce for diverse product catalogs spanning multiple categories
  • Choose fashion specifically for apparel, accessories, and style-focused products
  • Consider your primary product categories when making this decision

Next Steps

After creating your index, you can:

  1. Add Products - Start populating your index with product data
  2. Configure Search - Set up search functionality for your customers
  3. Enable Recommendations - Activate product recommendation features

Common Issues

Index Already Exists

If you try to create an index with a name that already exists, you'll receive a 409 Conflict error. Choose a different name or delete the existing index first.

Invalid Model Type

Ensure you specify either ecommerce or fashion exactly as shown. The API is case-sensitive.

Authentication Errors

Make sure your API key is valid and included in the Authorization header with the "Bearer " prefix.


Need Help? If you encounter any issues creating your index, please reach out to the Marqo team for support.