*/
public Collection findPages( QueryItem[] query )
{
File wikipagedir = new File( m_pageDirectory );
TreeSet<SearchResult> res = new TreeSet<SearchResult>( new SearchResultComparator() );
SearchMatcher matcher = new SearchMatcher( m_engine, query );
File[] wikipages = wikipagedir.listFiles( new WikiFileFilter() );
for( int i = 0; i < wikipages.length; i++ )
{
FileInputStream input = null;
// log.debug("Searching page "+wikipages[i].getPath() );
String filename = wikipages[i].getName();
int cutpoint = filename.lastIndexOf( FILE_EXT );
String wikiname = filename.substring( 0, cutpoint );
wikiname = unmangleName( wikiname );
try
{
input = new FileInputStream( wikipages[i] );
String pagetext = FileUtil.readContents( input, m_encoding );
SearchResult comparison = matcher.matchPageContent( wikiname, pagetext );
if( comparison != null )
{
res.add( comparison );
}
}