Interface SearchIndexer

All Known Implementing Classes:
PageIndexer

public interface SearchIndexer
Interface of pluggable indexer. An Indexer can add documents to the main Lucene index.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the indexer service description
    List<org.apache.lucene.document.Document>
    getDocuments(String strIdDocument)
    Returns a List of lucene documents to add to the index
    Returns all the types of document the service may index.
    Returns the indexer service name
    Returns the search app dedicated to the documents indexed by the service
    default String
    getTypeLabel(String strType, Locale locale)
    Returns the label shown to the user for one of the types of this indexer (search filter, badge of the results).
    Returns the indexer service version
    void
    Index all lucene documents from the plugin, replace List<Document> getDocuments( ) method
    boolean
    Tells whether the service is enable or not
  • Method Details

    • indexDocuments

      void indexDocuments() throws IOException, InterruptedException, SiteMessageException
      Index all lucene documents from the plugin, replace List<Document> getDocuments( ) method
      Throws:
      IOException - If an IO error occured
      InterruptedException - If a thread error occured
      SiteMessageException - occurs when a site message need to be displayed
    • getDocuments

      List<org.apache.lucene.document.Document> getDocuments(String strIdDocument) throws IOException, InterruptedException, SiteMessageException
      Returns a List of lucene documents to add to the index
      Parameters:
      strIdDocument - document id
      Returns:
      A List of lucene documents to add to the index
      Throws:
      IOException - If an IO error occured
      InterruptedException - If a thread error occured
      SiteMessageException - occurs when a site message need to be displayed
    • getName

      String getName()
      Returns the indexer service name
      Returns:
      the indexer service name
    • getVersion

      String getVersion()
      Returns the indexer service version
      Returns:
      the indexer service version
    • getDescription

      String getDescription()
      Returns the indexer service description
      Returns:
      the indexer service description
    • isEnable

      boolean isEnable()
      Tells whether the service is enable or not
      Returns:
      true if enable, otherwise false
    • getListType

      List<String> getListType()
      Returns all the types of document the service may index. (See SearchItem.getType())
      Returns:
      The list
    • getTypeLabel

      default String getTypeLabel(String strType, Locale locale)
      Returns the label shown to the user for one of the types of this indexer (search filter, badge of the results). The type itself stays the value stored in the index and used to filter.

      By default the label is read from the key portal.search.type.<type> (see SearchService.getDefaultTypeLabel(String, Locale)), which a site can define in its i18n override files; an indexer can override this method to use the keys of its own plugin.

      Parameters:
      strType - the type, one of getListType()
      locale - the locale of the label
      Returns:
      the label of the type, never null
    • getSpecificSearchAppUrl

      String getSpecificSearchAppUrl()
      Returns the search app dedicated to the documents indexed by the service
      Returns:
      the url of the app page