- Learning Elastic Stack 7.0(Second Edition)
- Pranav Shukla Sharath Kumar M N
- 72字
- 2025-04-04 14:18:53
Indexing a document by providing an ID
We have already seen this version of the indexing operation. The user can provide the ID of the document using the PUT method.
The format of this request is PUT /<index>/<type>/<id>, with the JSON document as the body of the request:
PUT /catalog/_doc/1
{
"sku": "SP000001",
"title": "Elasticsearch for Hadoop",
"description": "Elasticsearch for Hadoop",
"author": "Vishal Shukla",
"ISBN": "1785288997",
"price": 26.99
}