
public class SearchManager extends BasicPageFilter implements InternalModule, WikiEventListener
| Modifier and Type | Class and Description |
|---|---|
class |
SearchManager.JSONSearch
Provides a JSON RPC API to the JSPWiki Search Engine.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
JSON_SEARCH
The name of the JSON object that manages search.
|
static String |
PROP_SEARCHPROVIDER
Property name for setting the search provider.
|
m_engine| Constructor and Description |
|---|
SearchManager(WikiEngine engine,
Properties properties)
Creates a new SearchManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(WikiEvent event)
If the page has been deleted, removes it from the index.
|
Collection |
findPages(String query,
WikiContext wikiContext)
Sends a search to the current search provider.
|
SearchProvider |
getSearchEngine()
Returns the SearchProvider used.
|
void |
initialize(WikiEngine engine,
Properties properties)
This particular method starts off indexing and all sorts of various activities,
so you need to run this last, after things are done.
|
void |
pageRemoved(WikiPage page)
Removes the page from the search cache (if any).
|
void |
postSave(WikiContext wikiContext,
String content)
Reindexes the page.
|
void |
reindexPage(WikiPage page)
Forces the reindex of the given page.
|
destroy, postTranslate, preSave, preTranslatepublic static final String PROP_SEARCHPROVIDER
public static final String JSON_SEARCH
public SearchManager(WikiEngine engine, Properties properties) throws FilterException
engine - The WikiEngine that owns this SearchManager.properties - The list of Properties.FilterException - If it cannot be instantiated.public void initialize(WikiEngine engine, Properties properties) throws FilterException
initialize in interface PageFilterinitialize in class BasicPageFilterengine - the wiki engineproperties - the properties used to initialize the wiki engineFilterException - if the search provider failed to initializepublic SearchProvider getSearchEngine()
public Collection findPages(String query, WikiContext wikiContext) throws ProviderException, IOException
query - The query. Null is safe, and is interpreted as an empty query.wikiContext - the context within which to run the searchProviderException - If the provider fails and a search cannot be completed.IOException - If something else goes wrong.public void pageRemoved(WikiPage page)
page - The page to removepublic void postSave(WikiContext wikiContext, String content)
postSave in interface PageFilterpostSave in class BasicPageFilterwikiContext - The WikiContextcontent - The content which was just stored.public void reindexPage(WikiPage page)
page - The page.public void actionPerformed(WikiEvent event)
actionPerformed in interface WikiEventListenerevent - a WikiEvent objectCopyright © 2001-2018 The Apache Software Foundation. All rights reserved.