code: private void updateDocument(EntityMetadata metadata, final MetamodelImpl metaModel, Object entity, String parentId,
              Class<? extends Object> class1, boolean b)
      {
          updateOrCreateIndex(metadata, metaModel, entity, parentId, entity.getClass(), true);
          onCommit();
      }
docs: Updates document.
  
  @param metadata
  the metadata
  @param entity
  the object
  @param parentId
  the parent id
  @param clazz
  the clazz
  @return the document