Creating an index

In order to save any order document to Order Search, create an index with a predefined schema consisting of mappings and settings by using the createSearchIndex API.

Mapping is the structure in which the order documents are stored in an index. The process of defining the mappings is made flexible to suit the customer requirements. The order fields such as billToId, shopper name, phone number, address, email, item information, and so on can be defined in the mapping with searchable, sortable and returnable characteristics. It allows you to define which fields should be numbers, dates, and so on and what should be the date format or whether the strings should be treated as full text fields and so on.

The name of the index is generated by appending the current year and month in the -YYYYMM format to the index ID (order) as a suffix. For example, order-202109.

You can define mappings for fields by using Elasticsearch field data types. For more information about the mapping guidelines, see Creating an index mapping.