OrientDB的console.sh有一个INDEXES命令,它提供了所有现有索引的列表,如下所示:
+----+-------------------+-----------------+-------+------------+-------+-----------------+
|# |NAME |TYPE |RECORDS|CLASS |COLLATE|FIELDS |
+----+-------------------+-----------------+-------+------------+-------+-----------------+
|0 |dictionary |DICTIONARY |0 | |default| |
|1 |OFunction.name |UNIQUE_HASH_INDEX|11 |OFunction |default|name(STRING) |
|2 |ORole.name |UNIQUE |3 |ORole |ci |name(STRING) |
|3 |OUser.name |UNIQUE |1 |OUser |ci |name(STRING) |
|4 |UserRole.Desc |UNIQUE |3 |UserRole |default|Desc(STRING) |
+----+-------------------+-----------------+-------+------------+-------+-----------------+
| |TOTAL | |18 | | | |
+----+-------------------+-----------------+-------+------------+-------+-----------------+
有没有办法通过API(或SQL查询)获取此信息?
答案 0 :(得分:1)
我直接联系了OrientDB,@ lvca告诉我关于"元数据:indexmanager"包含我正在寻找的索引信息的类:
select expand(indexes) from metadata:indexmanager
这是指向文档的最新链接:
https://orientdb.com/docs/last/SQL.html#query-the-available-indexes
答案 1 :(得分:0)
使用此查询,您可以获取所有元数据:
SELECT expand(classes) from metadata:schema