Package org.dspace.discovery.indexobject
Class MetadataFieldIndexFactoryImpl
- java.lang.Object
-
- org.dspace.discovery.indexobject.IndexFactoryImpl<IndexableMetadataField,MetadataField>
-
- org.dspace.discovery.indexobject.MetadataFieldIndexFactoryImpl
-
- All Implemented Interfaces:
IndexFactory<IndexableMetadataField,MetadataField>,MetadataFieldIndexFactory
public class MetadataFieldIndexFactoryImpl extends IndexFactoryImpl<IndexableMetadataField,MetadataField> implements MetadataFieldIndexFactory
Factory implementation for indexing/retrievingMetadataFielditems in the search core- Author:
- Maria Verdonck (Atmire) on 14/07/2020
-
-
Field Summary
Fields Modifier and Type Field Description static StringELEMENT_FIELD_NAMEstatic StringFIELD_NAME_VARIATIONSprotected GroupServicegroupServicestatic StringQUALIFIER_FIELD_NAMEstatic StringSCHEMA_FIELD_NAME-
Fields inherited from class org.dspace.discovery.indexobject.IndexFactoryImpl
solrSearchCore, solrServiceIndexPlugins
-
-
Constructor Summary
Constructors Constructor Description MetadataFieldIndexFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.solr.common.SolrInputDocumentbuildDocument(Context context, IndexableMetadataField indexableObject)Create solr document with all the shared fields initialized.Iterator<IndexableMetadataField>findAll(Context context)Retrieve all instances of a certain indexable object typeOptional<IndexableMetadataField>findIndexableObject(Context context, String id)Retrieve a single indexable object using the provided identifierListgetIndexableObjects(Context context, MetadataField object)Retrieve all the indexable objects for the provided objectStringgetType()Return the type of the indexable objectbooleansupports(Object object)Determine whether the class can handle the factory implementation-
Methods inherited from class org.dspace.discovery.indexobject.IndexFactoryImpl
addFacetIndex, addFacetIndex, addNamedResourceTypeIndex, buildNewDocument, delete, delete, deleteAll, writeDocument, writeDocument
-
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
buildNewDocument, delete, delete, deleteAll, writeDocument
-
-
-
-
Field Detail
-
SCHEMA_FIELD_NAME
public static final String SCHEMA_FIELD_NAME
- See Also:
- Constant Field Values
-
ELEMENT_FIELD_NAME
public static final String ELEMENT_FIELD_NAME
- See Also:
- Constant Field Values
-
QUALIFIER_FIELD_NAME
public static final String QUALIFIER_FIELD_NAME
- See Also:
- Constant Field Values
-
FIELD_NAME_VARIATIONS
public static final String FIELD_NAME_VARIATIONS
- See Also:
- Constant Field Values
-
groupService
protected GroupService groupService
-
-
Method Detail
-
buildDocument
public org.apache.solr.common.SolrInputDocument buildDocument(Context context, IndexableMetadataField indexableObject) throws SQLException, IOException
Description copied from interface:IndexFactoryCreate solr document with all the shared fields initialized.- Specified by:
buildDocumentin interfaceIndexFactory<IndexableMetadataField,MetadataField>- Overrides:
buildDocumentin classIndexFactoryImpl<IndexableMetadataField,MetadataField>indexableObject- the indexableObject that we want to index- Returns:
- initialized solr document
- Throws:
SQLExceptionIOException
-
findAll
public Iterator<IndexableMetadataField> findAll(Context context) throws SQLException
Description copied from interface:IndexFactoryRetrieve all instances of a certain indexable object type- Specified by:
findAllin interfaceIndexFactory<IndexableMetadataField,MetadataField>- 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
public String getType()
Description copied from interface:IndexFactoryReturn the type of the indexable object- Specified by:
getTypein interfaceIndexFactory<IndexableMetadataField,MetadataField>- Returns:
- a string containing the type
-
findIndexableObject
public Optional<IndexableMetadataField> findIndexableObject(Context context, String id) throws SQLException
Description copied from interface:IndexFactoryRetrieve a single indexable object using the provided identifier- Specified by:
findIndexableObjectin interfaceIndexFactory<IndexableMetadataField,MetadataField>- 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
public boolean supports(Object object)
Description copied from interface:IndexFactoryDetermine whether the class can handle the factory implementation- Specified by:
supportsin interfaceIndexFactory<IndexableMetadataField,MetadataField>- 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
public List getIndexableObjects(Context context, MetadataField object)
Description copied from interface:IndexFactoryRetrieve all the indexable objects for the provided object- Specified by:
getIndexableObjectsin interfaceIndexFactory<IndexableMetadataField,MetadataField>- Parameters:
context- DSpace context objectobject- The object we want to retrieve our indexable objects for- Returns:
- A list of indexable objects
-
-