core/src/main/java/com/orientechnologies/orient/core/sql/parser/OCreateIndexStatement.java
private ODocument calculateMetadata(OCommandContext ctx) {
    if (metadata == null) {
      return null;
    }
    return metadata.toDocument(null, ctx);
  }
private ODocument calculateMetadata(OCommandContext ctx) {
    if (metadata == null) {
      return null;
    }
    return metadata.toDocument(null, ctx);
  }
returns index metadata as an ODocuemnt (as expected by Index API)