com.ecyrd.jspwiki.search
Class SearchManager

java.lang.Object
  extended by com.ecyrd.jspwiki.filters.BasicPageFilter
      extended by com.ecyrd.jspwiki.search.SearchManager
All Implemented Interfaces:
PageFilter

public class SearchManager
extends BasicPageFilter

Manages searching the Wiki.

Since:
2.2.21.
Author:
Arent-Jan Banck for Informatica

Field Summary
protected  WikiEngine m_engine
           
static String PROP_SEARCHPROVIDER
           
static String PROP_USE_LUCENE
           
 
Constructor Summary
SearchManager(WikiEngine engine, Properties properties)
           
 
Method Summary
 Collection findPages(String query)
          Sends a search to the current search provider.
 SearchProvider getSearchEngine()
           
 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)
          This method is called after the page has been successfully saved.
 void reindexPage(WikiPage page)
          Forces the reindex of the given page.
 
Methods inherited from class com.ecyrd.jspwiki.filters.BasicPageFilter
initialize, postTranslate, preSave, preTranslate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_USE_LUCENE

public static final String PROP_USE_LUCENE
See Also:
Constant Field Values

PROP_SEARCHPROVIDER

public static final String PROP_SEARCHPROVIDER
See Also:
Constant Field Values

m_engine

protected WikiEngine m_engine
Constructor Detail

SearchManager

public SearchManager(WikiEngine engine,
                     Properties properties)
              throws WikiException
Throws:
WikiException
Method Detail

initialize

public void initialize(WikiEngine engine,
                       Properties properties)
                throws WikiException
This particular method starts off indexing and all sorts of various activities, so you need to run this last, after things are done.

Parameters:
engine -
properties -
Throws:
WikiException

getSearchEngine

public SearchProvider getSearchEngine()

findPages

public Collection findPages(String query)
                     throws ProviderException,
                            IOException
Sends a search to the current search provider. The query is is whatever native format the query engine wants to use.

Parameters:
query - The query. Null is safe, and is interpreted as an empty query.
Returns:
A collection of WikiPages that matched.
Throws:
ProviderException
IOException

pageRemoved

public void pageRemoved(WikiPage page)
Removes the page from the search cache (if any).

Parameters:
page - The page to remove

postSave

public void postSave(WikiContext wikiContext,
                     String content)
Description copied from interface: PageFilter
This method is called after the page has been successfully saved. If the saving fails for any reason, then this method will not be called.

Since the result is discarded from this method, this is only useful for things like counters, etc.

Specified by:
postSave in interface PageFilter
Overrides:
postSave in class BasicPageFilter

reindexPage

public void reindexPage(WikiPage page)
Forces the reindex of the given page.

Parameters:
page -