Package edu.ucsb.nceas.metacat.index
Class MetacatSolrIndex
java.lang.Object
edu.ucsb.nceas.metacat.index.MetacatSolrIndex
This class will query the solr server and return the result.
- Author:
- tao
-
Method Summary
Modifier and TypeMethodDescriptionstatic MetacatSolrIndex
query
(String query, Set<org.dataone.service.types.v1.Subject> authorizedSubjects, boolean isMNadmin) Query the solr serverquery
(org.apache.solr.common.params.SolrParams solrParams, Set<org.dataone.service.types.v1.Subject> authorizedSubjects, boolean isMNadmin) Use the default GET method to handle the query when the query is on the key/value formatquery
(org.apache.solr.common.params.SolrParams solrParams, Set<org.dataone.service.types.v1.Subject> authorizedSubjects, boolean isMNadmin, org.apache.solr.client.solrj.SolrRequest.METHOD method) Handle the query when the query is on the key/value formatvoid
submit
(org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata systemMetadata, boolean followRevisions) Submit the index task to the index queuevoid
submit
(org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata systemMetadata, boolean isSysmetaChangeOnly, boolean followRevisions) Submit a index task into the index queuevoid
submit
(org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata systemMetadata, boolean isSysmetaChangeOnly, boolean followRevisions, int priority) Submit a index task into the index queuevoid
submitDeleteTask
(org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata sysMeta) Submit a deleting-index task
-
Method Details
-
getInstance
- Throws:
Exception
-
query
public InputStream query(String query, Set<org.dataone.service.types.v1.Subject> authorizedSubjects, boolean isMNadmin) throws org.apache.solr.client.solrj.SolrServerException, IOException, edu.ucsb.nceas.utilities.PropertyNotFoundException, SQLException, ClassNotFoundException, ParserConfigurationException, SAXException, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.UnsupportedType, org.apache.solr.common.SolrException Query the solr server- Parameters:
query
- the solr query stringauthorizedSubjects
- the authorized subjects in this query sessionisMNadmin
- the indicator of the authorized subjects are the mn admin or not- Returns:
- the result as the InputStream
- Throws:
org.apache.solr.client.solrj.SolrServerException
ClassNotFoundException
SQLException
edu.ucsb.nceas.utilities.PropertyNotFoundException
SAXException
ParserConfigurationException
org.dataone.service.exceptions.UnsupportedType
org.dataone.service.exceptions.NotFound
org.dataone.service.exceptions.NotImplemented
IOException
org.apache.solr.common.SolrException
-
query
public InputStream query(org.apache.solr.common.params.SolrParams solrParams, Set<org.dataone.service.types.v1.Subject> authorizedSubjects, boolean isMNadmin) throws org.apache.solr.client.solrj.SolrServerException, IOException, edu.ucsb.nceas.utilities.PropertyNotFoundException, SQLException, ClassNotFoundException, ParserConfigurationException, SAXException, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.UnsupportedType Use the default GET method to handle the query when the query is on the key/value format- Parameters:
solrParams
- the query with the key/value formatauthorizedSubjects
- the authorized subjects in this query sessionisMNadmin
- the indicator of the authorized subjects are the mn admin or notmethod
- the method such as GET, POST and et al will be used in the query- Returns:
- the query result as the InputStream object
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
edu.ucsb.nceas.utilities.PropertyNotFoundException
SQLException
ClassNotFoundException
ParserConfigurationException
SAXException
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.NotFound
org.dataone.service.exceptions.UnsupportedType
-
query
public InputStream query(org.apache.solr.common.params.SolrParams solrParams, Set<org.dataone.service.types.v1.Subject> authorizedSubjects, boolean isMNadmin, org.apache.solr.client.solrj.SolrRequest.METHOD method) throws org.apache.solr.client.solrj.SolrServerException, IOException, edu.ucsb.nceas.utilities.PropertyNotFoundException, SQLException, ClassNotFoundException, ParserConfigurationException, SAXException, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.UnsupportedType Handle the query when the query is on the key/value format- Parameters:
solrParams
- the query with the key/value formatauthorizedSubjects
- the authorized subjects in this query sessionisMNadmin
- the indicator of the authorized subjects are the mn admin or notmethod
- the method such as GET, POST and et al will be used in the query- Returns:
- the query result as the InputStream object
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
edu.ucsb.nceas.utilities.PropertyNotFoundException
SQLException
ClassNotFoundException
ParserConfigurationException
SAXException
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.NotFound
org.dataone.service.exceptions.UnsupportedType
-
submitDeleteTask
public void submitDeleteTask(org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata sysMeta) Submit a deleting-index task- Parameters:
pid
- the pid's solr document will be deleted.
-
submit
public void submit(org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata systemMetadata, boolean followRevisions) Submit the index task to the index queue- Parameters:
pid
- the pid will be indexedsystemMetadata
- the system metadata associated with the pidfields
- extra fields which need to be indexedfollowRevisions
- .. if the obsoleted version will be indexed
-
submit
public void submit(org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata systemMetadata, boolean isSysmetaChangeOnly, boolean followRevisions) Submit a index task into the index queue- Parameters:
pid
- the pid of the object which will be indexedsystemMetadata
- the system metadata associated with pidisSysmetaChangeOnly
- if this is the event of system metadata change onlyfields
- extra fields which need to be indexedfollowRevisions
- if the obsoleted version will be indexed
-
submit
public void submit(org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata systemMetadata, boolean isSysmetaChangeOnly, boolean followRevisions, int priority) Submit a index task into the index queue- Parameters:
pid
- the pid of the object which will be indexedsystemMetadata
- the system metadata associated with pidisSysmetaChangeOnly
- if this is the event of system metadata change onlyfields
- extra fields which need to be indexedfollowRevisions
- if the obsoleted version will be indexedpriority
- the priority of this index task
-