private int nextResult()
{
if( m_iterator != null && m_iterator.hasNext() && m_count++ < m_maxItems )
{
SearchResult r = (SearchResult) m_iterator.next();
// Create a wiki context for the result
WikiEngine engine = m_wikiContext.getEngine();
HttpServletRequest request = m_wikiContext.getHttpRequest();
Command command = PageCommand.VIEW.targetedCommand( r.getPage() );
WikiContext context = new WikiContext( engine, request, command );
// Stash it in the page context
pageContext.setAttribute( WikiTagBase.ATTR_CONTEXT,
context,