Interface SearchManager

All Superinterfaces:
EventListener, InternalModule, org.apache.wiki.api.filters.PageFilter, org.apache.wiki.event.WikiEventListener
All Known Implementing Classes:
DefaultSearchManager

public interface SearchManager extends org.apache.wiki.api.filters.PageFilter, InternalModule, org.apache.wiki.event.WikiEventListener
Manages searching the Wiki.
Since:
2.2.21.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
    The name of the JSON object that manages search.
    static final String
    the name of the Plugin discovery endpoint
    static final String
    Property name for setting the search provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Collection<org.apache.wiki.api.search.SearchResult>
    findPages(String query, org.apache.wiki.api.core.Context wikiContext)
    Sends a search to the current search provider.
    Returns the SearchProvider used.
    default void
    pageRemoved(org.apache.wiki.api.core.Page page)
    Removes the page from the search cache (if any).
    default void
    reindexPage(org.apache.wiki.api.core.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

  • Method Details

    • getSearchEngine

      Returns the SearchProvider used.
      Returns:
      The current SearchProvider.
    • findPages

      default Collection<org.apache.wiki.api.search.SearchResult> findPages(String query, org.apache.wiki.api.core.Context wikiContext) throws org.apache.wiki.api.exceptions.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:
      org.apache.wiki.api.exceptions.ProviderException - If the provider fails and a search cannot be completed.
      IOException - If something else goes wrong.
    • pageRemoved

      default void pageRemoved(org.apache.wiki.api.core.Page page)
      Removes the page from the search cache (if any).
      Parameters:
      page - The page to remove
    • reindexPage

      default void reindexPage(org.apache.wiki.api.core.Page page)
      Forces the reindex of the given page.
      Parameters:
      page - The page.