@Override public List<Object> edgeLookup(String edgeLabel, String indexPostfix, Object key) { OrientBaseGraph orientBaseGraph = unwrapCurrentGraph(); List<Object> ids = new ArrayList<>(); // Load the edge type in order to access the indices of the edge OrientEdgeType edgeType = orientBaseGraph.getEdgeType(edgeLabel); if (edgeType != null) { // Fetch the required index OIndex<?> index = edgeType.getClassIndex("e." + edgeLabel.toLowerCase() + "_" + indexPostfix); if (index != null) { // Iterate over the sb-tree index entries OIndexCursor cursor = index.iterateEntriesMajor(new OCompositeKey(key), true, false); while (cursor.hasNext()) { Entry<Object, OIdentifiable> entry = cursor.nextEntry(); if (entry != null) { OCompositeKey entryKey = (OCompositeKey) entry.getKey(); // The index returns all entries. We thus need to filter it manually if (entryKey.getKeys().get(1).equals(key)) { Object inId = entryKey.getKeys().get(0); // Only add the inbound vertex id to the list of ids ids.add(inId); } } else { break; } } } } return ids; }
if (includeInOut && e.getClassIndex(name) == null) { e.createIndex(name, OClass.INDEX_TYPE.NOTUNIQUE, new String[] { "in", "out" }); if (includeOut && e.getClassIndex(name) == null) { e.createIndex(name, OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX, new String[] { "out" }); if (includeIn && e.getClassIndex(name) == null) { e.createIndex(name, OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX, new String[] { "in" }); if (extraFields.length != 0 && e.getClassIndex(name) == null) { e.createIndex(name, OClass.INDEX_TYPE.UNIQUE_HASH_INDEX, extraFields);
if (fields.size() != 0 && e.getClassIndex(name) == null) { String[] fieldArray = fields.keySet().stream().toArray(String[]::new); OIndex<?> idx = e.createIndex(name,