Changed check of ID existence before persisting in order to allow elasticsearch create its own ids