Class SolrResourceIndexer

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.content.indexing.solr.SolrResourceIndexer
All Implemented Interfaces:
SolrFieldNames, LogEnabled, Component, Serviceable

Solr resource indexer.

Populate a Solr input document with the following fields:

id
resource id
type
with "document" value
full
resource content
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • indexResource

      public void indexResource(Resource resource, org.apache.solr.common.SolrInputDocument document, String documentType) throws Exception
      Index a resource.
      Parameters:
      resource - The resource to index.
      document - The Solr document to index into.
      documentType - The document type of the resource
      Throws:
      Exception - if an error occurs.
    • indexResource

      public void indexResource(Resource resource, org.apache.solr.common.SolrInputDocument document, String documentType, String language) throws Exception
      Index a resource.
      Parameters:
      resource - The resource to index.
      document - The Solr document to index into.
      documentType - The document type of the resource
      language - The query language.
      Throws:
      Exception - if an error occurs.
    • indexResource

      public void indexResource(Resource resource, org.apache.solr.common.SolrInputDocument document, String documentType, TraversableAmetysObject resourceRoot) throws Exception
      Index a resource.
      Parameters:
      resource - The resource to index.
      document - The Solr document to index into.
      documentType - The document type of the resource
      resourceRoot - The resource root, can be null. When null, it will have to be computed.
      Throws:
      Exception - if an error occurs.
    • indexResource

      public void indexResource(Resource resource, org.apache.solr.common.SolrInputDocument document, String documentType, String language, TraversableAmetysObject resourceRoot) throws Exception
      Index a resource.
      Parameters:
      resource - The resource to index.
      document - The Solr document to index into.
      documentType - The document type of the resource
      language - The language, can be null.
      resourceRoot - The resource root, can be null. When null, it will have to be computed.
      Throws:
      Exception - if an error occurs.
    • _populateDatesOfPage

      protected void _populateDatesOfPage(Resource resource, org.apache.solr.common.SolrInputDocument document)
      Populate the solr input document with dates from the resource
      Parameters:
      resource - The resource
      document - The Solr document
    • indexResourceCollection

      public void indexResourceCollection(ResourceCollection resourceCollection, org.apache.solr.common.SolrInputDocument document, String language) throws Exception
      Index a collection of resources.
      Parameters:
      resourceCollection - the resource collection to index.
      document - The document to index into.
      language - The current language.
      Throws:
      Exception - if an error occurs while indexing.
    • indexResourceContent

      public void indexResourceContent(Resource resource, org.apache.solr.common.SolrInputDocument document, String language)
      Index a resource content (text in case of a document, and Dublin Core metadata).
      Parameters:
      resource - The resource to index.
      document - The document to index into.
      language - The current language, can be null.
    • indexFulltextValue

      protected void indexFulltextValue(org.apache.solr.common.SolrInputDocument document, String text, String language)
      Index a full-text value.
      Parameters:
      document - The document to index into.
      text - The text to index.
      language - The content language, can be null.
    • indexDublinCoreMetadata

      public void indexDublinCoreMetadata(DublinCoreAwareAmetysObject object, org.apache.solr.common.SolrInputDocument document)
      Index Dublin core metadata.
      Parameters:
      object - the DublinCoreAwareAmetysObject holding Dublin Core metadata.
      document - the solr input document to populate.