for (int i = 0; i < sd.length; i++) {
Document doc = reader.document(sd[i].doc);
uids[i] = Long.parseLong(doc.get("id"));
}
sb.append(Thread.currentThread() + Arrays.toString(uids)).append("\n");
int max = reader.maxDoc();
uids = new long[max];
for (int i = 0; i < max; i++) {
Document doc = reader.document(i);
uids[i] = Long.parseLong(doc.get("id"));
}