public void collect(int doc, float score) {
subQueryHits.set(doc);
}
});
TermDocs termDocs = reader.termDocs(new Term(FieldNames.PROPERTIES_SET, refProperty));
String prefix = FieldNames.createNamedValue(refProperty, "");
while (termDocs.next()) {
int doc = termDocs.doc();
String[] values = reader.document(doc).getValues(FieldNames.PROPERTIES);
if (values == null) {
// no reference properties at all on this node
continue;
}
for (int v = 0; v < values.length; v++) {
if (values[v].startsWith(prefix)) {
String uuid = values[v].substring(prefix.length());
TermDocs node = reader.termDocs(TermFactory.createUUIDTerm(uuid));
try {
while (node.next()) {
if (subQueryHits.get(node.doc())) {
hits.set(doc);
}
}
} finally {
node.close();
}
}
}
}