Package org.dspace.authority
Class AuthoritySolrServiceImpl
- java.lang.Object
-
- org.dspace.authority.AuthoritySolrServiceImpl
-
- All Implemented Interfaces:
AuthoritySearchService,AuthorityIndexingService
public class AuthoritySolrServiceImpl extends Object implements AuthorityIndexingService, AuthoritySearchService
- Author:
- Antoine Snyers (antoine at atmire.com), Kevin Van de Velde (kevin at atmire dot com), Ben Bosman (ben at atmire dot com), Mark Diggory (markd at atmire dot com)
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.solr.client.solrj.SolrClientsolrNon-Static CommonsHttpSolrServer for processing indexing events.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAuthoritySolrServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanIndex()voidcommit()List<String>getAllIndexedMetadataFields()Retrieves all the metadata fields which are indexed in the authority controlprotected org.apache.solr.client.solrj.SolrClientgetSolr()voidindexContent(AuthorityValue value)booleanisConfiguredProperly()org.apache.solr.client.solrj.response.QueryResponsesearch(org.apache.solr.client.solrj.SolrQuery query)protected voidwriteDocument(org.apache.solr.common.SolrInputDocument doc)Write the document to the solr index
-
-
-
Method Detail
-
getSolr
protected org.apache.solr.client.solrj.SolrClient getSolr() throws MalformedURLException, org.apache.solr.client.solrj.SolrServerException, IOException- Throws:
MalformedURLExceptionorg.apache.solr.client.solrj.SolrServerExceptionIOException
-
indexContent
public void indexContent(AuthorityValue value)
- Specified by:
indexContentin interfaceAuthorityIndexingService
-
cleanIndex
public void cleanIndex() throws Exception- Specified by:
cleanIndexin interfaceAuthorityIndexingService- Throws:
Exception
-
commit
public void commit()
- Specified by:
commitin interfaceAuthorityIndexingService
-
isConfiguredProperly
public boolean isConfiguredProperly()
- Specified by:
isConfiguredProperlyin interfaceAuthorityIndexingService
-
writeDocument
protected void writeDocument(org.apache.solr.common.SolrInputDocument doc) throws IOExceptionWrite the document to the solr index- Parameters:
doc- the solr document- Throws:
IOException- if IO error
-
search
public org.apache.solr.client.solrj.response.QueryResponse search(org.apache.solr.client.solrj.SolrQuery query) throws org.apache.solr.client.solrj.SolrServerException, MalformedURLException, IOException- Specified by:
searchin interfaceAuthoritySearchService- Throws:
org.apache.solr.client.solrj.SolrServerExceptionMalformedURLExceptionIOException
-
getAllIndexedMetadataFields
public List<String> getAllIndexedMetadataFields() throws Exception
Retrieves all the metadata fields which are indexed in the authority control- Specified by:
getAllIndexedMetadataFieldsin interfaceAuthoritySearchService- Returns:
- a list of metadata fields
- Throws:
Exception- if error
-
-