Class MetacatSolrIndex

java.lang.Object
edu.ucsb.nceas.metacat.index.MetacatSolrIndex

public class MetacatSolrIndex extends Object
This class will query the solr server and return the result.
Author:
tao
  • Method Summary

    Modifier and Type
    Method
    Description
     
    query(String query, Set<org.dataone.service.types.v1.Subject> authorizedSubjects, boolean isMNadmin)
    Query the solr server
    query(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 format
    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)
    Handle the query when the query is on the key/value format
    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
    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
    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
    void
    submitDeleteTask(org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata sysMeta)
    Submit a deleting-index task

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getInstance

      public static MetacatSolrIndex getInstance() throws Exception
      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 string
      authorizedSubjects - the authorized subjects in this query session
      isMNadmin - 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 format
      authorizedSubjects - the authorized subjects in this query session
      isMNadmin - the indicator of the authorized subjects are the mn admin or not
      method - 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 format
      authorizedSubjects - the authorized subjects in this query session
      isMNadmin - the indicator of the authorized subjects are the mn admin or not
      method - 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 indexed
      systemMetadata - the system metadata associated with the pid
      fields - extra fields which need to be indexed
      followRevisions - .. 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 indexed
      systemMetadata - the system metadata associated with pid
      isSysmetaChangeOnly - if this is the event of system metadata change only
      fields - extra fields which need to be indexed
      followRevisions - 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 indexed
      systemMetadata - the system metadata associated with pid
      isSysmetaChangeOnly - if this is the event of system metadata change only
      fields - extra fields which need to be indexed
      followRevisions - if the obsoleted version will be indexed
      priority - the priority of this index task