// Before we do anything, make sure that the specified index actually exists in the
// document store - we don't want to rely on ElasticSearch to fail the document
// create because it could be configured to implicitly create a non-existent index,
// which can lead to hard-to-debug behaviour with queries down the road.
OperationResult indexExistsResult = checkIndexExistence(indexName);
// Before we do anything, make sure that the specified index actually exists in the
// document store - we don't want to rely on ElasticSearch to fail the document
// create because it could be configured to implicitly create a non-existent index,
// which can lead to hard-to-debug behaviour with queries down the road.
OperationResult indexExistsResult = checkIndexExistence(indexName);