Interface IndexFactory<T extends IndexableObject,S>
- All Known Subinterfaces:
ClaimedTaskIndexFactory,CollectionIndexFactory,CommunityIndexFactory,DSpaceObjectIndexFactory<T,,S> InprogressSubmissionIndexFactory<T,,S> ItemIndexFactory,MetadataFieldIndexFactory,PoolTaskIndexFactory,WorkflowItemIndexFactory,WorkspaceItemIndexFactory
- All Known Implementing Classes:
ClaimedTaskIndexFactoryImpl,CollectionIndexFactoryImpl,CommunityIndexFactoryImpl,DSpaceObjectIndexFactoryImpl,IndexFactoryImpl,InprogressSubmissionIndexFactoryImpl,ItemIndexFactoryImpl,LDNMessageEntityIndexFactoryImpl,MetadataFieldIndexFactoryImpl,PoolTaskIndexFactoryImpl,WorkflowItemIndexFactoryImpl,WorkspaceItemIndexFactoryImpl
public interface IndexFactory<T extends IndexableObject,S>
Basis factory interface for indexing/retrieving any IndexableObject in the search core
- Author:
- Kevin Van de Velde (kevin at atmire dot com)
-
Method Summary
Modifier and TypeMethodDescriptionorg.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.voidRemove the provided indexable object from the solr corevoidRemove the provided indexable object from the solr corevoidRemove all indexable objects of the implementing type from the search coreRetrieve all instances of a certain indexable object typefindIndexableObject(Context context, String id) Retrieve a single indexable object using the provided identifiergetIndexableObjects(Context context, S object) Retrieve all the indexable objects for the provided objectgetType()Return the type of the indexable objectbooleanDetermine whether the class can handle the factory implementationvoidwriteDocument(Context context, T indexableObject, org.apache.solr.common.SolrInputDocument solrInputDocument) Write the provided document to the solr core
-
Method Details
-
findAll
Retrieve all instances of a certain indexable object type- Parameters:
context- DSpace context object- Returns:
- An iterator containing all the objects to be indexed for the indexable object
- Throws:
SQLException- If database error
-
getType
String getType()Return the type of the indexable object- Returns:
- a string containing the type
-
buildDocument
org.apache.solr.common.SolrInputDocument buildDocument(Context context, T indexableObject) throws SQLException, IOException Create solr document with all the shared fields initialized.- Parameters:
indexableObject- the indexableObject that we want to index- Returns:
- initialized solr document
- Throws:
SQLExceptionIOException
-
buildNewDocument
org.apache.solr.common.SolrInputDocument buildNewDocument(Context context, T indexableObject) throws SQLException, IOException Create solr document with all the shared fields initialized. Can contain special fields required for "new" documents vs regular buildDocument- Parameters:
indexableObject- the indexableObject that we want to index- Returns:
- initialized solr document
- Throws:
SQLExceptionIOException
-
writeDocument
void writeDocument(Context context, T indexableObject, org.apache.solr.common.SolrInputDocument solrInputDocument) throws SQLException, IOException, org.apache.solr.client.solrj.SolrServerException Write the provided document to the solr core- 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
-
delete
Remove the provided indexable object from the solr core- 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
void delete(String indexableObjectIdentifier) throws IOException, org.apache.solr.client.solrj.SolrServerException Remove the provided indexable object from the solr core- 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
Remove all indexable objects of the implementing type 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
-
findIndexableObject
Retrieve a single indexable object using the provided identifier- Parameters:
context- DSpace context objectid- The identifier for which we want to retrieve our indexable object- Returns:
- An indexable object
- Throws:
SQLException- If database error
-
supports
Determine whether the class can handle the factory implementation- Parameters:
object- The object which we want to check- Returns:
- True if the factory implementation can handle the given object. False if it doesn't.
-
getIndexableObjects
Retrieve all the indexable objects for the provided object- Parameters:
context- DSpace context objectobject- The object we want to retrieve our indexable objects for- Returns:
- A list of indexable objects
- Throws:
SQLException- If database error
-