@Override
    public ResultPage<FindInContentResult> findInContent(final FindInContentRequest request) {
        final ResultPage<DocContentMatch> resultPage = contentIndex.findInContent(request);
        final List<FindInContentResult> list = new ArrayList<>();
        for (final DocContentMatch docContentMatch : resultPage.getValues()) {
            final List<String> parents = new ArrayList<>();
            parents.add(docContentMatch.getDocRef().getName());
            final UnmodifiableTreeModel masterTreeModel = explorerTreeModel.getModel();
            if (masterTreeModel != null) {
                ExplorerNode parent = masterTreeModel.getParent(ExplorerNode
                        .builder()
                        .docRef(docContentMatch.getDocRef())
                        .build());
                while (parent != null) {
                    parents.add(parent.getName());
                    parent = masterTreeModel.getParent(parent);
                }
            }
            final StringBuilder parentPath = new StringBuilder();
            for (int i = parents.size() - 1; i >= 0; i--) {
                String parent = parents.get(i);
                parentPath.append(parent);
                if (i > 0) {
                    parentPath.append(" / ");
                }
            }

            final FindInContentResult explorerDocContentMatch = FindInContentResult.builder()
                    .docContentMatch(docContentMatch)
                    .path(parentPath.toString())
                    .build();
            list.add(explorerDocContentMatch);
        }
        return new ResultPage<>(list, resultPage.getPageResponse());
    }
Create a map of folders and their child items.
stroom-explorer/stroom-explorer-impl/src/main/java/stroom/explorer/impl/ExplorerServiceImpl.java