All Products
Search
Document Center

OpenSearch:Import data by using the API or SDKs

Last Updated:Apr 01, 2026

OpenSearch supports three ways to import data: configuring data sources, using the API or SDKs, and uploading files in the OpenSearch console. API and SDK import is flexible and user-friendly.

Console file upload is limited to 2 MB per upload and is intended for search tests only — uploading large numbers of files through the console is time-consuming. For production data import, use the API or SDKs. For rate and volume limits, see Limits.

Field type mappings

When you push data through the API or SDKs, map your source field types to the corresponding OpenSearch field types:

OpenSearch field typeAPI field type
INTint, long
INT_ARRAYint[], long[]
FLOATfloat
FLOAT_ARRAYfloat[]
DOUBLEdouble
DOUBLE_ARRAYdouble[]
LITERALstring
LITERAL_ARRAYstring[]
SHORT_TEXTstring
TEXTstring
TIMESTAMPlong
GEO_POINTstring, in lon lat format. Both values must be DOUBLE type, separated by a space. Valid range: lon [-180, 180], lat [-90, 90].

Usage notes

No data source plugins. When importing through the API or SDKs, data source plugins are not available. Pre-process and format your data before sending it to OpenSearch.

Array types must be sent as arrays, not strings. If a field is typed as an array (such as INT_ARRAY or LITERAL_ARRAY), the value must be a native array in your request — not a serialized string. The following Java example shows the correct way to build a document with an array field:

// Build a document with an array-typed field
Map<String, Object> doc2 = Maps.newLinkedHashMap();
doc2.put("id", 1);

String[] literal_arr2 = {"Element 1", "Element 2"};
doc2.put("literal_arr", literal_arr2);

Related topics