I am trying to create the lock on the document, but the same snippet which you gave, gives error as below.
Could you let me know if there is any process which should be done before creating the lock.
Also, if you are to create just a single document, there is no need to use the bulk api.
Lastly, keep in mind that this is not a lock. You are just creating documents in elasticsearch. What is described here Solving Concurrency Issues | Elasticsearch: The Definitive Guide [2.x] | Elastic is just a way to implement locking in Elasticsearch, but in the end you are just creating and deleting a bunch of documents.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.