private void processUpsert(Row row, RequestIndexer indexer) {
			final byte[] document = serializationSchema.serialize(row);
			if (keyFieldIndices.length == 0) {
				final IndexRequest indexRequest = requestFactory.createIndexRequest(
					index,
					docType,
					contentType,
					document);
				indexer.add(indexRequest);
			} else {
				final String key = createKey(row);
				final UpdateRequest updateRequest = requestFactory.createUpdateRequest(
					index,
					docType,
					key,
					contentType,
					document);
				indexer.add(updateRequest);
			}
		}
Sink function for converting upserts into Elasticsearch {@link ActionRequest}s.
elasticsearch5-xh/elasticsearch5-xh-sink/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchUpsertTableSinkBase.java