String uuid = reader.document(i, FieldSelectors.UUID).get(FieldNames.UUID);
uuids.put(i, uuid);
}
// get child node entries for each hit
Hits childrenHits = new AdaptingHits();
for (String uuid : uuids.values()) {
NodeId id = new NodeId(uuid);
try {
long time = System.currentTimeMillis();
NodeState state = (NodeState) itemMgr.getItemState(id);
time = System.currentTimeMillis() - time;
log.debug("got NodeState with id {} in {} ms.", id, time);
List<ChildNodeEntry> entries;
if (nameTest != null) {
entries = state.getChildNodeEntries(nameTest);
} else {
// get all children
entries = state.getChildNodeEntries();
}
for (ChildNodeEntry entry : entries) {
NodeId childId = entry.getId();
Term uuidTerm = new Term(FieldNames.UUID, childId.toString());
TermDocs docs = reader.termDocs(uuidTerm);
try {
if (docs.next()) {
childrenHits.set(docs.doc());
}
} finally {
docs.close();
}
}