Is there somewhere a list of all possible HTTP response codes when creating a new document in ElasticSearch? I only managed to find that in case of a successful creation 201 is responded while in case of a conflict the code is 409.
Are there any other possible cases? For example which code is responded in case the document is created successfully to a primary shard but it failed in a replica?
Moreover which of those error codes is retriable?
There is no Elasticsearch-specific list AFAIK. As well as 201 and 409 off the top of my head I can think of 404 (index not found), 429 (Elasticsearch is overloaded), 400 (bad request, e.g. the index is closed), 403 (forbidden, e.g. the index is readonly). Of these only 429 seems likely to resolve itself without intervention.
There is no special code for a case where the document is written to the primary but not a replica because this is handled internally by Elasticsearch.
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.