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 type | API field type |
|---|---|
| INT | int, long |
| INT_ARRAY | int[], long[] |
| FLOAT | float |
| FLOAT_ARRAY | float[] |
| DOUBLE | double |
| DOUBLE_ARRAY | double[] |
| LITERAL | string |
| LITERAL_ARRAY | string[] |
| SHORT_TEXT | string |
| TEXT | string |
| TIMESTAMP | long |
| GEO_POINT | string, 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
List of operations by function — full API reference organized by feature
SDK overview — available SDKs and quickstart guides