final OSchema schema = databaseDocumentTx.getMetadata().getSchema();
final OClass indexWithLimitAndOffset = schema.createClass("IndexWithLimitAndOffsetClass");
indexWithLimitAndOffset.createProperty("val", OType.INTEGER);
indexWithLimitAndOffset.createProperty("index", OType.INTEGER);
databaseDocumentTx.command(new OCommandSQL(
"create index IndexWithLimitAndOffset on IndexWithLimitAndOffsetClass (val) notunique"));
for (int i = 0; i < 30; i++) {
final ODocument document = new ODocument("IndexWithLimitAndOffsetClass");
document.field("val", i / 10);