String uuid = reader.document(i, FieldSelectors.UUID).get(FieldNames.UUID);
uuids.put(new Integer(i), uuid);
}
// get child node entries for each hit
Hits childrenHits = new AdaptingHits();
for (Iterator it = uuids.values().iterator(); it.hasNext(); ) {
String uuid = (String) it.next();
NodeId id = new NodeId(UUID.fromString(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, new Long(time));
Iterator entries;
if (nameTest != null) {
entries = state.getChildNodeEntries(nameTest).iterator();
} else {
// get all children
entries = state.getChildNodeEntries().iterator();
}
while (entries.hasNext()) {
NodeId childId = ((ChildNodeEntry) entries.next()).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();
}
}