public static OBaseIndexEngine createIndexEngine(final String name, final String algorithm, final String type, final Boolean durableInNonTxMode, final OStorage storage, final int version, int apiVersion, boolean multivalue, final Map<String, String> indexProperties, ODocument metadata) { final OIndexFactory factory = findFactoryByAlgorithmAndType(algorithm, type); return factory .createIndexEngine(algorithm, name, durableInNonTxMode, storage, version, apiVersion, multivalue, indexProperties); }
/** * @param storage TODO * @param indexType index type * * @return OIndexInternal * * @throws OConfigurationException if index creation failed * @throws OIndexException if index type does not exist */ 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); }