Help Center> Cloud Search Service> Troubleshooting> Data Import and Export> Why Is An Error Reported When I Import Data by Calling an API for Cluster 7.1.1?

Why Is An Error Reported When I Import Data by Calling an API for Cluster 7.1.1?

Issue

When calling an API to import data, an error is reported.

Symptom

Failed to import data.

Possible Causes

The command used to create an index is incorrect.

Procedure

  1. Run the following command to create an index:

    curl -X PUT -u admin:gh_-Ut=zm7H7A8E https://IP:9200/zxh_store -H 'Content-Type: application/json' -d '{ "settings": { "number_of_shards": 1 }, "mappings": { "properties": {"products": { "properties": { "productName": { "type": "text" }, "size": { "type": "keyword" } } } } } }' -k

  2. If the error persists after an index is created, contact technical support.