}
}
private void reCreateIndex(GraphDatabaseService graphDatabaseService, Label label, PrimitivePropertyMethodMetadata propertyMethodMetadata) {
PrimitivePropertyMetadata primitivePropertyMetadata = ((PrimitivePropertyMethodMetadata<PrimitivePropertyMetadata>) propertyMethodMetadata).getDatastoreMetadata();
IndexDefinition index = findIndex(graphDatabaseService, label, primitivePropertyMetadata);
if (propertyMethodMetadata != null && index == null) {
LOGGER.info("Creating index for label {} on property '{}'.", label, primitivePropertyMetadata.getName());
graphDatabaseService.schema().indexFor(label).on(primitivePropertyMetadata.getName()).create();
} else if (propertyMethodMetadata == null && index != null) {
LOGGER.info("Dropping index for label {} on properties '{}'.", label, index.getPropertyKeys());
index.drop();
}
}