Class SolrPageIndexer

  • All Implemented Interfaces:
    SolrIndexer

    public class SolrPageIndexer
    extends java.lang.Object
    implements SolrIndexer
    The indexer service for Solr.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String NAME  
      static java.lang.String RESSOURCE_PAGE  
    • Constructor Summary

      Constructors 
      Constructor Description
      SolrPageIndexer()
      Creates a new SolrPageIndexer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<Field> getAdditionalFields()
      Returns the list of dynamic fields.
      java.lang.String getDescription()
      Returns the description.
      java.util.List<SolrItem> getDocuments​(java.lang.String strIdDocument)
      Returns a list of SolR documents to add to the index
      java.lang.String getName()
      Returns the name of the indexer.
      java.util.List<java.lang.String> getResourcesName()
      Returns the name of the indexed resources.
      java.lang.String getResourceUid​(java.lang.String strResourceId, java.lang.String strResourceType)
      Return the uid of a resource
      java.lang.String getVersion()
      Returns the version.
      java.util.List<java.lang.String> indexDocuments()
      Index all solr documents from the plugin, replace List getDocuments( ) method
      boolean isEnable()
      Tells whether the service is enable or not
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SolrPageIndexer

        public SolrPageIndexer()
        Creates a new SolrPageIndexer
    • Method Detail

      • indexDocuments

        public java.util.List<java.lang.String> indexDocuments()
        Index all solr documents from the plugin, replace List getDocuments( ) method
        Specified by:
        indexDocuments in interface SolrIndexer
        Returns:
        A list of error messages or null if there is no error
      • getName

        public java.lang.String getName()
        Returns the name of the indexer.
        Specified by:
        getName in interface SolrIndexer
        Returns:
        the name of the indexer
      • getVersion

        public java.lang.String getVersion()
        Returns the version.
        Specified by:
        getVersion in interface SolrIndexer
        Returns:
        the version.
      • getDescription

        public java.lang.String getDescription()
        Returns the description.
        Specified by:
        getDescription in interface SolrIndexer
        Returns:
        the description.
      • isEnable

        public boolean isEnable()
        Tells whether the service is enable or not
        Specified by:
        isEnable in interface SolrIndexer
        Returns:
        true if enable, otherwise false
      • getAdditionalFields

        public java.util.List<Field> getAdditionalFields()
        Returns the list of dynamic fields. The name of the fields must end with a SolrItem suffix (SolrItem.DYNAMIC_URL_FIELD_SUFFIX, SolrItem.DYNAMIC_TEXT_FIELD_SUFFIX ...)
        Specified by:
        getAdditionalFields in interface SolrIndexer
        Returns:
        the list of additional indexed fields or null if there are no additional fields
      • getDocuments

        public java.util.List<SolrItem> getDocuments​(java.lang.String strIdDocument)
        Returns a list of SolR documents to add to the index
        Specified by:
        getDocuments in interface SolrIndexer
        Parameters:
        strIdDocument - the identifier of the document to convert into a SolrItem object
        Returns:
        A list of documents corresponding to the resource identifier. If nothing has been found, returns null
      • getResourcesName

        public java.util.List<java.lang.String> getResourcesName()
        Returns the name of the indexed resources. To prevent conflicts, the names must begin with PluginName_ where PluginName is the name of the plugin.
        Specified by:
        getResourcesName in interface SolrIndexer
        Returns:
        The list of names of the indexed resources or null
      • getResourceUid

        public java.lang.String getResourceUid​(java.lang.String strResourceId,
                                               java.lang.String strResourceType)
        Return the uid of a resource
        Specified by:
        getResourceUid in interface SolrIndexer
        Parameters:
        strResourceId - the identifier of the resource
        strResourceType - the type of the resource
        Returns:
        the uid of a resource or null if the resource is unknow