Package org.apache.wiki.search
Class SearchMatcher
java.lang.Object
org.apache.wiki.search.SearchMatcher
public class SearchMatcher extends java.lang.Object
SearchMatcher performs the task of matching a search query to a page's contents. This utility class is isolated to simplify
 WikiPageProvider implementations and to offer an easy target for upgrades. The upcoming(?) TranslatorReader rewrite will
 presumably invalidate this, among other things.
- Since:
- 2.1.5
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classSearchMatcher.SearchResultImplA local search result.
- 
Constructor SummaryConstructors Constructor Description SearchMatcher(Engine engine, QueryItem[] queries)Creates a new SearchMatcher.SearchMatcher(WikiEngine engine, QueryItem[] queries)Deprecated.kept for compatibility with page/attachment providers not using public API.
- 
Method SummaryModifier and Type Method Description SearchResultmatchPageContent(java.lang.String wikiname, java.lang.String pageText)Compares the page content, available through the given stream, to the query items of this matcher.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Constructor Details- 
SearchMatcherCreates a new SearchMatcher.- Parameters:
- engine- The Engine
- queries- A list of queries
 
- 
SearchMatcherDeprecated.kept for compatibility with page/attachment providers not using public API. UseSearchMatcher(Engine, QueryItem)instead.Creates a new SearchMatcher.- Parameters:
- engine- The Engine
- queries- A list of queries
 
 
- 
- 
Method Details- 
matchPageContentpublic SearchResult matchPageContent(java.lang.String wikiname, java.lang.String pageText) throws java.io.IOExceptionCompares the page content, available through the given stream, to the query items of this matcher. Returns a search result object describing the quality of the match.This method would benefit of regexps (1.4) and streaming. FIXME! - Parameters:
- wikiname- The name of the page
- pageText- The content of the page
- Returns:
- A SearchResult item, or null, there are no queries
- Throws:
- java.io.IOException- If reading page content fails
 
 
-