Package org.apache.wiki.search

# Interface SearchManager

All Superinterfaces:
  `EventListener`, `InternalModule`, `PageFilter`, `WikiEventListener`

All Known Implementing Classes:
  `DefaultSearchManager`

public interface SearchManager extends PageFilter, InternalModule, WikiEventListener
Manages searching the Wiki.

Since:
  2.2.21.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`DEFAULT_SEARCHPROVIDER`
`static final String`
`JSON_SEARCH`
The name of the JSON object that manages search.
`static final String`
`PROP_SEARCHPROVIDER`
Property name for setting the search provider.

## Method Summary

Modifier and Type
Method
Description
`default Collection<SearchResult>`
`findPages(String query, Context wikiContext)`
Sends a search to the current search provider.
`SearchProvider`
`getSearchEngine()`
Returns the SearchProvider used.
`default void`
`pageRemoved(Page page)`
Removes the page from the search cache (if any).
`default void`
`reindexPage(Page page)`
Forces the reindex of the given page.

### Methods inherited from interface org.apache.wiki.api.filters.PageFilter

`destroy, initialize, postSave, postTranslate, preSave, preTranslate`

### Methods inherited from interface org.apache.wiki.event.WikiEventListener

`actionPerformed`

## Field Details

### DEFAULT_SEARCHPROVIDER

static final String DEFAULT_SEARCHPROVIDER

See Also:
  - Constant Field Values

### PROP_SEARCHPROVIDER

static final String PROP_SEARCHPROVIDER
Property name for setting the search provider. Value is `"jspwiki.searchProvider"`.

See Also:
  - Constant Field Values

### JSON_SEARCH

static final String JSON_SEARCH
The name of the JSON object that manages search.

See Also:
  - Constant Field Values

## Method Details

### getSearchEngine

SearchProvider getSearchEngine()
Returns the SearchProvider used.

Returns:
  The current SearchProvider.

### findPages

default Collection<SearchResult> findPages(String query, Context wikiContext) 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.
  `wikiContext` - the context within which to run the search
Returns:
  A collection of WikiPages that matched.
Throws:
  `ProviderException` - If the provider fails and a search cannot be completed.
  `IOException` - If something else goes wrong.

### pageRemoved

default void pageRemoved(Page page)
Removes the page from the search cache (if any).

Parameters:
  `page` - The page to remove

### reindexPage

default void reindexPage(Page page)
Forces the reindex of the given page.

Parameters:
  `page` - The page.