BrowseIndex bi = BrowseIndex.getBrowseIndex(plugInBrowserIndex);
// now start up a browse engine and get it to do the work for us
BrowseEngine be = new BrowseEngine(context);
// we need to assure that the right names will be present in the browse
IndexBrowse ib = new IndexBrowse(context);
int count = 1;
for (ResearcherPage rp : rps)
{
String authKey = ResearcherPageUtils
.getPersistentIdentifier(rp);
log.debug("work on " + rp.getFullName() + "[staffno "
+ rp.getSourceID() + "] with identifier " + authKey
+ " (" + count + " of " + rps.size() + ")");
// set up a BrowseScope and start loading the values into it
BrowserScope scope = new BrowserScope(context);
scope.setBrowseIndex(bi);
// scope.setOrder(order);
scope.setFilterValue(authKey);
scope.setAuthorityValue(authKey);
scope.setResultsPerPage(Integer.MAX_VALUE);
scope.setBrowseLevel(1);
BrowseInfo binfo = be.browse(scope);
log.debug("Find " + binfo.getResultCount()
+ "item(s) for the reseracher " + authKey);
Item[] items = binfo.getItemResults(context);
for (Item item : items)
{
DSIndexer.indexContent(context, item, true);
ib.indexItem(item);
}
}
context.commit();
context.clearCache();
}