private Set<Integer> getPathsForIndex(Index index) throws BagriException {
String path = index.getPath();
Set<Integer> result;
if (PathBuilder.isRegexPath(path)) {
result = mdlMgr.translatePathFromRegex(index.getDocumentType(), PathBuilder.regexFromPath(path));
} else {
int dataType = XQUtils.getBaseTypeForTypeName(index.getDataType());
Path xPath = mdlMgr.translatePath(index.getDocumentType(), path, NodeKind.fromPath(path), 0, dataType, Occurrence.zeroOrOne);
result = new HashSet<>(1);
result.add(xPath.getPathId());
}
logger.trace("getPathsForIndex; returning {} for index {}", result, index);
return result;
}