Package org.dspace.discovery.indexobject
Class IndexFactoryImpl<T extends IndexableObject,S>
- java.lang.Object
-
- org.dspace.discovery.indexobject.IndexFactoryImpl<T,S>
-
- All Implemented Interfaces:
IndexFactory<T,S>
- Direct Known Subclasses:
ClaimedTaskIndexFactoryImpl,DSpaceObjectIndexFactoryImpl,InprogressSubmissionIndexFactoryImpl,MetadataFieldIndexFactoryImpl,PoolTaskIndexFactoryImpl
public abstract class IndexFactoryImpl<T extends IndexableObject,S> extends Object implements IndexFactory<T,S>
Basis factory interface implementation for indexing/retrieving any IndexableObject in the search core- Author:
- Kevin Van de Velde (kevin at atmire dot com)
-
-
Field Summary
Fields Modifier and Type Field Description protected SolrSearchCoresolrSearchCoreprotected List<SolrServiceIndexPlugin>solrServiceIndexPlugins
-
Constructor Summary
Constructors Constructor Description IndexFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddFacetIndex(org.apache.solr.common.SolrInputDocument document, String field, String authority, String fvalue)Index the provided value as use for a sidebar facetprotected voidaddFacetIndex(org.apache.solr.common.SolrInputDocument document, String field, String sortValue, String authority, String fvalue)Index the provided value as use for a sidebar facetprotected voidaddNamedResourceTypeIndex(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)org.apache.solr.common.SolrInputDocumentbuildDocument(Context context, T indexableObject)Create solr document with all the shared fields initialized.org.apache.solr.common.SolrInputDocumentbuildNewDocument(Context context, T indexableObject)Create solr document with all the shared fields initialized.voiddelete(String indexableObjectIdentifier)Remove the provided indexable object from the solr corevoiddelete(T indexableObject)Remove the provided indexable object from the solr corevoiddeleteAll()Remove all indexable objects of the implementing type from the search coreprotected voidwriteDocument(org.apache.solr.common.SolrInputDocument doc, FullTextContentStreams streams)Write the document to the index under the appropriate unique identifier.voidwriteDocument(Context context, T indexableObject, org.apache.solr.common.SolrInputDocument solrInputDocument)Write the provided document to the solr core-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dspace.discovery.indexobject.factory.IndexFactory
findAll, findIndexableObject, getIndexableObjects, getType, supports
-
-
-
-
Field Detail
-
solrServiceIndexPlugins
@Autowired protected List<SolrServiceIndexPlugin> solrServiceIndexPlugins
-
solrSearchCore
@Autowired protected SolrSearchCore solrSearchCore
-
-
Method Detail
-
buildDocument
public org.apache.solr.common.SolrInputDocument buildDocument(Context context, T indexableObject) throws SQLException, IOException
Description copied from interface:IndexFactoryCreate solr document with all the shared fields initialized.- Specified by:
buildDocumentin interfaceIndexFactory<T extends IndexableObject,S>indexableObject- the indexableObject that we want to index- Returns:
- initialized solr document
- Throws:
SQLExceptionIOException
-
buildNewDocument
public org.apache.solr.common.SolrInputDocument buildNewDocument(Context context, T indexableObject) throws SQLException, IOException
Description copied from interface:IndexFactoryCreate solr document with all the shared fields initialized. Can contain special fields required for "new" documents vs regular buildDocument- Specified by:
buildNewDocumentin interfaceIndexFactory<T extends IndexableObject,S>indexableObject- the indexableObject that we want to index- Returns:
- initialized solr document
- Throws:
SQLExceptionIOException
-
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:IndexFactoryWrite the provided document to the solr core- Specified by:
writeDocumentin interfaceIndexFactory<T extends IndexableObject,S>- Parameters:
context- DSpace context objectindexableObject- The indexable object that we want to store in the search coresolrInputDocument- Solr input document which will be written to our discovery search core- Throws:
SQLException- If database errorIOException- If IO errororg.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.SolrServerExceptionWrite the document to the index under the appropriate unique identifier.- Parameters:
doc- the solr document to be written to the serverstreams- 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 documentfield- The facet field nameauthority- The authority linked to the fieldfvalue- 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 documentfield- The facet field namesortValue- The value on which we should sort our facet fields when retrievingauthority- The authority linked to the fieldfvalue- 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 documentfilterValue- 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:IndexFactoryRemove the provided indexable object from the solr core- Specified by:
deletein interfaceIndexFactory<T extends IndexableObject,S>- Parameters:
indexableObject- The indexable object that we want to remove from the search core- Throws:
IOException- If IO errororg.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:IndexFactoryRemove the provided indexable object from the solr core- Specified by:
deletein interfaceIndexFactory<T extends IndexableObject,S>- Parameters:
indexableObjectIdentifier- The identifier that we want to remove from the search core- Throws:
IOException- If IO errororg.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.SolrServerExceptionDescription copied from interface:IndexFactoryRemove all indexable objects of the implementing type from the search core- Specified by:
deleteAllin interfaceIndexFactory<T extends IndexableObject,S>- Throws:
IOException- If IO errororg.apache.solr.client.solrj.SolrServerException- If the solr document could not be removed to the search core
-
-