}
private Collection findPages( QueryItem[] query )
{
TreeSet<SearchResult> res = new TreeSet<SearchResult>( new SearchResultComparator() );
SearchMatcher matcher = new SearchMatcher( m_engine, query );
Collection allPages = null;
try
{
allPages = m_engine.getPageManager().getAllPages();
}
catch( ProviderException pe )
{
log.error( "Unable to retrieve page list", pe );
return null;
}
Iterator it = allPages.iterator();
while( it.hasNext() )
{
try
{
WikiPage page = (WikiPage) it.next();
if (page != null)
{
String pageName = page.getName();
String pageContent = m_engine.getPageManager().getPageText(pageName, WikiPageProvider.LATEST_VERSION) +
attachmentNames(page, " ");
SearchResult comparison = matcher.matchPageContent( pageName, pageContent );
if( comparison != null )
{
res.add( comparison );
}