I think I understand how this works. I can count the records and fetch in smaller increments using
int resultCount = job.getResultCount(); // Number of results this job returned
int x = 0; // Result counter
int offset = 0; // Start at result 0
int count = 10; // Get sets of 10 results at a time
// Loop through each set of results
while (offset < resultCount) {
CollectionArgs outputArgs = new CollectionArgs();
outputArgs.setCount(count);
outputArgs.setOffset(offset);
// Get the search results and display them
InputStream results = job.getResults(outputArgs);
ResultsReaderXml resultsReader = new ResultsReaderXml(results);
HashMap<String, String> event;
while ((event = resultsReader.getNextEvent()) != null) {
x++;
System.out.println("\n***** RESULT " + x + " *****\n");
for (String key: event.keySet())
System.out.println(" " + key + ": " + event.get(key));
}
resultsReader.close();
// Increase the offset to get the next set of results
offset = offset + count;
}
I think I understand how this works. I can count the records and fetch in smaller increments using
int resultCount = job.getResultCount(); // Number of results this job returned
int x = 0; // Result counter
int offset = 0; // Start at result 0
int count = 10; // Get sets of 10 results at a time
// Loop through each set of results
while (offset < resultCount) {
CollectionArgs outputArgs = new CollectionArgs();
outputArgs.setCount(count);
outputArgs.setOffset(offset);
// Get the search results and display them
InputStream results = job.getResults(outputArgs);
ResultsReaderXml resultsReader = new ResultsReaderXml(results);
HashMap<String, String> event;
while ((event = resultsReader.getNextEvent()) != null) {
x++;
System.out.println("\n***** RESULT " + x + " *****\n");
for (String key: event.keySet())
System.out.println(" " + key + ": " + event.get(key));
}
resultsReader.close();
// Increase the offset to get the next set of results
offset = offset + count;
}