core/src/main/java/com/orientechnologies/orient/core/index/OIndexDefinitionFactory.java
public static OIndexDefinition createIndexDefinition(final OClass oClass, final List<String> fieldNames, final List<OType> types,
      List<OCollate> collates, String indexKind, String algorithm) {
    checkTypes(oClass, fieldNames, types);

    if (fieldNames.size() == 1)
      return createSingleFieldIndexDefinition(oClass, fieldNames.get(0), types.get(0), collates == null ? null : collates.get(0),
          indexKind, algorithm);
    else
      return createMultipleFieldIndexDefinition(oClass, fieldNames, types, collates, indexKind, algorithm);
  }
public static OIndexDefinition createIndexDefinition(final OClass oClass, final List<String> fieldNames, final List<OType> types,
      List<OCollate> collates, String indexKind, String algorithm) {
    checkTypes(oClass, fieldNames, types);

    if (fieldNames.size() == 1)
      return createSingleFieldIndexDefinition(oClass, fieldNames.get(0), types.get(0), collates == null ? null : collates.get(0),
          indexKind, algorithm);
    else
      return createMultipleFieldIndexDefinition(oClass, fieldNames, types, collates, indexKind, algorithm);
  }
Creates an instance of {@link OIndexDefinition} for automatic index.

@param oClass     class which will be indexed
@param fieldNames list of properties which will be indexed. Format should be '<property> [by key|value]', use 'by key' or 'by
value' to describe how to index maps. By default maps indexed by key
@param types      types of indexed properties
@param collates
@param indexKind
@param algorithm

@return index definition instance