if (markPrefixQueries) {
urlKey += "*\t";
}
UrlSearchResults results = new UrlSearchResults();
// the various CAPTURE filters to apply to the results:
ObjectFilterChain<CaptureSearchResult> cFilters =
new ObjectFilterChain<CaptureSearchResult>();
// Groupings of filters for clarity(?) and summary annotation of
// results:
List<CaptureFilterGroup> groups = getRequestFilterGroups(wbRequest);
for(CaptureFilterGroup cfg : groups) {
cFilters.addFilters(cfg.getFilters());
}
if (filter != null) {
cFilters.addFilter(filter);
}
// we've filtered the appropriate CaptureResult objects within the
// iterator, now we're going to convert whatever records make it past
// the filters into UrlSearchResults, and then do further window
// filtering on those results:
// Windows:
// the window URL filters to apply to the results, once they're
// UrlSearchResult objects
ObjectFilterChain<UrlSearchResult> uFilters =
new ObjectFilterChain<UrlSearchResult>();
WindowFilterGroup<UrlSearchResult> window =
new WindowFilterGroup<UrlSearchResult>(wbRequest,this);
uFilters.addFilters(window.getFilters());
CloseableIterator<CaptureSearchResult> itrC = null;
CloseableIterator<UrlSearchResult> itrU = null;
try {
PerfStats.timeStart(PerfStat.IndexLoad);
itrC = new ObjectFilterIterator<CaptureSearchResult>(
source.getPrefixIterator(urlKey),cFilters);
itrU = new ObjectFilterIterator<UrlSearchResult>(
new CaptureToUrlSearchResultIterator(itrC),
uFilters);
while(itrU.hasNext()) {
results.addSearchResult(itrU.next());
}
} finally {
if (itrU != null) {
cleanupIterator(itrU);
}