DBBroker broker = null;
try {
broker = pool.get(user);
final MutableDocumentSet docs = new DefaultDocumentSet();
parent.getCollection().allDocs(broker, docs, inclusive);
return broker.getTextEngine().scanIndexTerms(docs, docs.docsToNodeSet(), start, end);
} catch (final PermissionDeniedException e) {
throw new XMLDBException(ErrorCodes.PERMISSION_DENIED,
"permission denied", e);
} catch (final EXistException e) {
throw new XMLDBException(