Class IndexFactoryImpl<T extends IndexableObject,​S>

    • Constructor Detail

      • IndexFactoryImpl

        public IndexFactoryImpl()
    • Method Detail

      • buildNewDocument

        public org.apache.solr.common.SolrInputDocument buildNewDocument​(Context context,
                                                                         T indexableObject)
                                                                  throws SQLException,
                                                                         IOException
        Description copied from interface: IndexFactory
        Create solr document with all the shared fields initialized. Can contain special fields required for "new" documents vs regular buildDocument
        Specified by:
        buildNewDocument in interface IndexFactory<T extends IndexableObject,​S>
        indexableObject - the indexableObject that we want to index
        Returns:
        initialized solr document
        Throws:
        SQLException
        IOException
      • writeDocument

        public void writeDocument​(Context context,
                                  T indexableObject,
                                  org.apache.solr.common.SolrInputDocument solrInputDocument)
                           throws SQLException,
                                  IOException,
                                  org.apache.solr.client.solrj.SolrServerException
        Description copied from interface: IndexFactory
        Write the provided document to the solr core
        Specified by:
        writeDocument in interface IndexFactory<T extends IndexableObject,​S>
        Parameters:
        context - DSpace context object
        indexableObject - The indexable object that we want to store in the search core
        solrInputDocument - Solr input document which will be written to our discovery search core
        Throws:
        SQLException - If database error
        IOException - If IO error
        org.apache.solr.client.solrj.SolrServerException - If the solr document could not be written to the search core
      • writeDocument

        protected void writeDocument​(org.apache.solr.common.SolrInputDocument doc,
                                     FullTextContentStreams streams)
                              throws IOException,
                                     org.apache.solr.client.solrj.SolrServerException
        Write the document to the index under the appropriate unique identifier.
        Parameters:
        doc - the solr document to be written to the server
        streams - list of bitstream content streams
        Throws:
        IOException - A general class of exceptions produced by failed or interrupted I/O operations.
        org.apache.solr.client.solrj.SolrServerException
      • addFacetIndex

        protected void addFacetIndex​(org.apache.solr.common.SolrInputDocument document,
                                     String field,
                                     String authority,
                                     String fvalue)
        Index the provided value as use for a sidebar facet
        Parameters:
        document - The solr document
        field - The facet field name
        authority - The authority linked to the field
        fvalue - The display value for the facet
      • addFacetIndex

        protected void addFacetIndex​(org.apache.solr.common.SolrInputDocument document,
                                     String field,
                                     String sortValue,
                                     String authority,
                                     String fvalue)
        Index the provided value as use for a sidebar facet
        Parameters:
        document - The solr document
        field - The facet field name
        sortValue - The value on which we should sort our facet fields when retrieving
        authority - The authority linked to the field
        fvalue - The display value for the facet
      • addNamedResourceTypeIndex

        protected void addNamedResourceTypeIndex​(org.apache.solr.common.SolrInputDocument document,
                                                 String filterValue)
        Add the necessary fields to the SOLR document to support a Discover Facet on resourcetypename (archived item, workspace item, workflow item, etc)
        Parameters:
        document - the solr document
        filterValue - the filter value (i.e. \n|||\n###
      • delete

        public void delete​(T indexableObject)
                    throws IOException,
                           org.apache.solr.client.solrj.SolrServerException
        Description copied from interface: IndexFactory
        Remove the provided indexable object from the solr core
        Specified by:
        delete in interface IndexFactory<T extends IndexableObject,​S>
        Parameters:
        indexableObject - The indexable object that we want to remove from the search core
        Throws:
        IOException - If IO error
        org.apache.solr.client.solrj.SolrServerException - If the solr document could not be removed to the search core
      • delete

        public void delete​(String indexableObjectIdentifier)
                    throws IOException,
                           org.apache.solr.client.solrj.SolrServerException
        Description copied from interface: IndexFactory
        Remove the provided indexable object from the solr core
        Specified by:
        delete in interface IndexFactory<T extends IndexableObject,​S>
        Parameters:
        indexableObjectIdentifier - The identifier that we want to remove from the search core
        Throws:
        IOException - If IO error
        org.apache.solr.client.solrj.SolrServerException - If the solr document could not be removed to the search core
      • deleteAll

        public void deleteAll()
                       throws IOException,
                              org.apache.solr.client.solrj.SolrServerException
        Description copied from interface: IndexFactory
        Remove all indexable objects of the implementing type from the search core
        Specified by:
        deleteAll in interface IndexFactory<T extends IndexableObject,​S>
        Throws:
        IOException - If IO error
        org.apache.solr.client.solrj.SolrServerException - If the solr document could not be removed to the search core