June 2017
Beginner to intermediate
404 pages
8h 22m
English
A new document can be added using the Document API's. For the e-commerce example, to add a new product, we execute the following command. The body of the request is the product document we want to index.
PUT http://localhost:9200/chapter1/product/1{ "title": "Learning Elasticsearch", "author": "Abhishek Andhavarapu", "category": "books"}
Let's inspect the request:
| INDEX | chapter1 |
| TYPE | product |
| IDENTIFIER | 1 |
| DOCUMENT | JSON |
| HTTP METHOD | PUT |
The document's properties, such as title, author, the category, are also known as fields, which are similar to SQL columns.
Read now
Unlock full access