if (returnIdsOnly) {
String rowId = selector.getRowId();
if (rowId == null) {
rowId = getRowId(reader, docId);
}
fetchResult.rowResult = new FetchRowResult();
fetchResult.rowResult.row = new Row(rowId, null);
} else {
List<Document> docs;
AtomicBoolean moreDocsToFetch = new AtomicBoolean(false);
AtomicInteger totalRecords = new AtomicInteger();
BlurHighlighter highlighter = new BlurHighlighter(highlightQuery, fieldManager, selector);
Tracer docTrace = Trace.trace("fetchRow - Document read");
docs = BlurUtil.fetchDocuments(reader, fieldVisitor, selector, maxHeap, table + "/" + shard,
tableContext.getDefaultPrimeDocTerm(), filter, moreDocsToFetch, totalRecords, highlighter);
docTrace.done();
Tracer rowTrace = Trace.trace("fetchRow - Row create");
Row row = getRow(docs);
if (row == null) {
String rowId = selector.getRowId();
if (rowId == null) {
rowId = getRowId(reader, docId);
}
row = new Row(rowId, null);
}
fetchResult.rowResult = new FetchRowResult(row, selector.getStartRecord(),
selector.getMaxRecordsToFetch(), moreDocsToFetch.get(), totalRecords.get());
rowTrace.done();
}
return;
}