XContentBuilder out = jsonBuilder().startObject();
addValueToTheIndexField(out, indexFieldForRiverName, riverName);
addValueToTheIndexField(out, indexFieldForSpaceKey, spaceKey);
addValueToTheIndexField(out, indexFieldForRemoteDocumentId, documentId);
addCommonFieldsToCommentIndexedDocument(out, documentId, comment);
return out.endObject();
}
private void addCommonFieldsToCommentIndexedDocument(XContentBuilder out, String documentId,
Map<String, Object> comment) throws Exception {
for (String indexFieldName : commentFieldsConfig.keySet()) {