Package org.apache.wiki.search
Class BasicSearchProvider
java.lang.Object
org.apache.wiki.search.BasicSearchProvider
- All Implemented Interfaces:
WikiProvider,SearchProvider
public class BasicSearchProvider extends Object implements SearchProvider
Interface for the search providers that handle searching the Wiki
- Since:
- 2.2.21.
-
Field Summary
Fields inherited from interface org.apache.wiki.api.providers.WikiProvider
LATEST_VERSION -
Constructor Summary
Constructors Constructor Description BasicSearchProvider() -
Method Summary
Modifier and Type Method Description Collection<SearchResult>findPages(String query, Context wikiContext)Search for pages matching a search query.StringgetProviderInfo()Return a valid HTML string for information.voidinitialize(Engine engine, Properties props)Initializes the page provider.voidpageRemoved(Page page)Delete a page from the search index.QueryItem[]parseQuery(String query)Parses a query into something that we can use.voidreindexPage(Page page)Adds a WikiPage for indexing queue.
-
Constructor Details
-
BasicSearchProvider
public BasicSearchProvider()
-
-
Method Details
-
initialize
public void initialize(Engine engine, Properties props) throws NoRequiredPropertyException, IOExceptionInitializes the page provider.- Specified by:
initializein interfaceWikiProvider- Parameters:
engine- Engine to own this providerprops- A set of properties used to initialize this provider- Throws:
NoRequiredPropertyException- If the provider needs a property which is not found in the property setIOException- If there is an IO problem
-
pageRemoved
Delete a page from the search index.- Specified by:
pageRemovedin interfaceSearchProvider- Parameters:
page- Page to remove from search index.
-
reindexPage
Adds a WikiPage for indexing queue. This is called a queue, since this method is expected to return pretty quickly, and indexing to be done in a separate thread.- Specified by:
reindexPagein interfaceSearchProvider- Parameters:
page- The WikiPage to be indexed.
-
parseQuery
Parses a query into something that we can use.- Parameters:
query- A query string.- Returns:
- A parsed array.
-
findPages
Search for pages matching a search query.- Specified by:
findPagesin interfaceSearchProvider- Parameters:
query- query to search forwikiContext- the context within which to run the search- Returns:
- collection of pages that match query
-
getProviderInfo
Return a valid HTML string for information. May be anything.- Specified by:
getProviderInfoin interfaceWikiProvider- Returns:
- A string describing the provider.
-