// not a query (expected: /index/prefix:x?y) - treat as regular node lookup
return mk.getNodesStream(path, revisionId, depth, offset, count, filter);
}
String data = index.substring(idx + 1);
index = index.substring(0, idx);
JsopStream s = new JsopStream();
s.array();
if (index.startsWith(PropertyIndexConstants.TYPE_PREFIX)) {
String prefix = index.substring(PropertyIndexConstants.TYPE_PREFIX.length());
PrefixIndex prefixIndex = indexer.getPrefixIndex(prefix);
if (prefixIndex == null) {
throw ExceptionFactory.get("Unknown index: " + index);
}
Iterator<String> it = prefixIndex.getPaths(data, revisionId);
while (it.hasNext()) {
s.value(it.next());
}
} else if (index.startsWith(PropertyIndexConstants.TYPE_PROPERTY)) {
String property = index.substring(PropertyIndexConstants.TYPE_PROPERTY.length());
boolean unique = false;
if (property.endsWith("," + PropertyIndexConstants.UNIQUE)) {
unique = true;
property = property.substring(0, property.length() - PropertyIndexConstants.UNIQUE.length() - 1);
}
PropertyIndex propertyIndex = indexer.getPropertyIndex(property);
if (propertyIndex == null) {
throw ExceptionFactory.get("Unknown index: " + index);
}
if (unique) {
String value = propertyIndex.getPath(data, revisionId);
if (value != null) {
s.value(value);
}
} else {
Iterator<String> it = propertyIndex.getPaths(data, revisionId);
while (it.hasNext()) {
s.value(it.next());
}
}
}
s.endArray();
return s;
}