Package org.apache.wiki.search

## Interface SearchManager

All Superinterfaces:
  `java.util.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
`static java.lang.String` `DEFAULT_SEARCHPROVIDER`
`static java.lang.String` `JSON_SEARCH` The name of the JSON object that manages search.
`static java.lang.String` `PROP_SEARCHPROVIDER` Property name for setting the search provider.

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`default java.util.Collection<SearchResult>` `findPages​(java.lang.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 Detail

#### DEFAULT_SEARCHPROVIDER

    static final java.lang.String DEFAULT_SEARCHPROVIDER

See Also:
  Constant Field Values

#### PROP_SEARCHPROVIDER

    static final java.lang.String PROP_SEARCHPROVIDER

Property name for setting the search provider. Value is `"jspwiki.searchProvider"`.

See Also:
  Constant Field Values

#### JSON_SEARCH

    static final java.lang.String JSON_SEARCH

The name of the JSON object that manages search.

See Also:
  Constant Field Values

### Method Detail

#### getSearchEngine

    SearchProvider getSearchEngine()

Returns the SearchProvider used.

Returns:
  The current SearchProvider.

#### findPages

    default java.util.Collection<SearchResult> findPages​(java.lang.String query,
                                                         Context wikiContext)
                                                  throws ProviderException,
                                                         java.io.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.
  `java.io.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.