public static OIndexInternal<?> createIndex(OStorage storage, String name, String indexType, String algorithm,
String valueContainerAlgorithm, ODocument metadata, int version) throws OConfigurationException, OIndexException {
if (indexType.equalsIgnoreCase(OClass.INDEX_TYPE.UNIQUE_HASH_INDEX.name()) || indexType
.equalsIgnoreCase(OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX.name()) || indexType
.equalsIgnoreCase(OClass.INDEX_TYPE.DICTIONARY_HASH_INDEX.name())) {
if (!algorithm.equalsIgnoreCase("autosharding")) {
algorithm = OHashIndexFactory.HASH_INDEX_ALGORITHM;
}
}
return findFactoryByAlgorithmAndType(algorithm, indexType)
.createIndex(name, storage, indexType, algorithm, valueContainerAlgorithm, metadata, version);
}