private static TermMatcher createChildrenOfTermMatcher(final SequencedSet<DocRef> nodePath) {
        return (queryField, condition, termValue, docRef) -> {
            if (Condition.OF_DOC_REF.equals(condition)) {
                if (docRef == null) {
                    return false;
                }
                if (!nodePath.isEmpty()) {
                    final DocRef parent = nodePath.getLast();
                    return docRef.equals(parent);
                }
            }
            return false;
        };
    }
Create a map of folders and their child items.
stroom-explorer/stroom-explorer-impl/src/main/java/stroom/explorer/impl/ExplorerServiceImpl.java