Complete the code to index a document using POST method.
POST /my_index/_doc/[1] { "title": "Learn Elasticsearch", "content": "Elasticsearch is a search engine" }
The document ID is specified after _doc/ in the POST request to index the document.
Complete the code to index a document using PUT method with a specific ID.
PUT /my_index/_doc/[1] { "user": "alice", "message": "Hello Elasticsearch" }
The document ID 2 is used in the PUT request to index or update the document.
Fix the error in the code to correctly index a document with ID 3.
POST /my_index/_doc/[1] { "name": "Bob", "age": 30 }
The document ID 3 must be specified after _doc/ to index the document correctly.
Fill both blanks to index a document with ID 4 and specify the index name.
[1] /[2]/_doc/4 { "title": "Elasticsearch Basics", "tags": ["search", "database"] }
Use PUT method to index with a specific ID and specify the index name my_index.
Fill all three blanks to index a document with ID 5 in the 'blog' index using POST method.
[1] /[2]/[3]/5 { "author": "Jane", "content": "Elasticsearch tutorial" }
The POST method is used to index the document in the blog index under the _doc type with ID 5.