Indexing

Indexing API

Indexing is how you add your products to the search engine. For better understanding by the Neuralens Engine and better relevance, refer the set of standardized fields. If you product attributes are not in the standardized set, you can use custom field names.

POST https://api.neuralens.ai/search/index

Indexes a new product. You can index up to 100 products in a single request.

Indexing is asynchronous. It may take up to an hour for newly indexed products to reflect in Search.

Request Headers

Header
Value

X-Neuralens-API-Key

Bearer YOUR_API_KEY_HERE

X-Neuralens-Application-ID

YOUR_APPLICATION_ID

Request Params

Param
Value

partition

Partition field's value (required in case partitioning is done)

Let's say partition is enabled on field "continent", then when sending request for the continent "asia", partition will be asia

Request Body

[
    {
        "id": "AD176",
        "title": "Printed T-shirt",
        "categories": ["Women", "Topwear", "Tshirts"],
        "productUrl": "https://example.com/product/id/AD176",
        "images": ["https://cdn.example.com/123", "https://cdn.example.com/789"],
        "currency": "USD",
        "listPrice": 18.99,
        "salePrice": 14.99,
        "size": "L",
        "fabricPrimary": "Cotton",
        "fabricOthers": ["Viscose"],
        "brand": "H&M",
        // Any other custom fields
    },
    {
        ...
    }
]

Response

{
    "status": "success",    // or failure
    "message": ""    // failure message
}

Standardized Fields

These fields allow Neuralens to understand what the product is, and greatly affect the search performance.

Standardized fields are product fields that have a special meaning in the Neuralens system. Use the standardized fields instead of custom fields wherever a standardized field exists. That means, instead of adding the product name to a field called "name", use the standardized "title" field. For a field like Brand, or Fabric, use custom fields.

The following fields are standardized:

Field Name
Type
Description

id

string

The product's unique identifier. A call to /search/index for an id which already exists will overwrite the existing data

title

string

The product's name

productUrl

string

The URL to the product details page of the product. The url that is opened on clicking the product.

categories

list of string

The category hierarchy of the product in the catalog. The categories should be ordered with the top level hierarchy coming first in the list. NOTE: last value of categories will be treated as product type eg: ["Women", "Topwear", "Tshirts"],

images

list of string

eg: ["https://cdn.example.com/123", "https://cdn.example.com/789"]

listPrice

float

The original price of the product

salePrice

float

The discounted price

Custom Fields

Any attribute which is not a part of the standardized fields set is a custom field.

The following types are supported in custom fields:

  • String

  • Integer

  • Float

  • Boolean

  • Datetime

  • List (lists of Strings, Integers, Floats are supported. A list should have values of only one type)

Last updated