{
OpenSearchModule osMod = new OpenSearchModuleImpl();
osMod.setTotalResults(qRes.getHitCount());
osMod.setStartIndex(qRes.getStart());
osMod.setItemsPerPage(qRes.getPageSize());
OSQuery osq = new OSQuery();
osq.setRole("request");
try
{
osq.setSearchTerms(URLEncoder.encode(query, "UTF-8"));
}
catch(UnsupportedEncodingException e)
{
log.error(e);
}
osq.setStartPage(1 + (qRes.getStart() / qRes.getPageSize()));
osMod.addQuery(osq);
return osMod;
}