Ingest documents into index

The following curl command can be used to ingest a single document in the my_index index:

curl -X PUT 'localhost:9200/my_index/customer/1' -H 'Content-Type: application/json' -d '{"name": "Angela Martin","birthdate": "1997-11-02","street": "63542 Times Square","city": "New York","state": "NY","zip": "10036","homePhone": "212-415-8929","cellPhone": "212-171-8187"}'

In the previous command, we use a type called customer, which is a logical partition of an index. In a RDBMS analogy, a type is like a table in Elasticsearch.

Also, we used the number 1 after the type customer. It is an ID of a customer. If we omit it, then Elasticsearch will generate an arbitrary ID for the document.

We have multiple documents to be ...

Get Modern Big Data Processing with Hadoop now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.