Interface SolrMetacardClient

All Known Implementing Classes:
SolrMetacardClientImpl

public interface SolrMetacardClient
Interface that defines the different metacard operations performed on Solr.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.apache.solr.common.SolrInputDocument>
    add(List<ddf.catalog.data.Metacard> metacards, boolean forceAutoCommit)
    Adds a list of Metacard objects to Solr.
    void
    deleteByIds(String fieldName, List<? extends Serializable> identifiers, boolean forceCommit)
    Deletes Solr documents by ID.
    void
    Deletes all the Solr documents that match a specific query.
    Set<ddf.catalog.data.ContentType>
     
    List<ddf.catalog.data.Metacard>
     
    ddf.catalog.operation.SourceResponse
    query(ddf.catalog.operation.QueryRequest request)
    Converts a QueryRequest into a Solr query and returns the result as a SourceResponse.
    List<ddf.catalog.data.Metacard>
    query(String queryString)
    Runs a Solr query and converts the result as a list of Metacard objects.
  • Method Details

    • query

      ddf.catalog.operation.SourceResponse query(ddf.catalog.operation.QueryRequest request) throws ddf.catalog.source.UnsupportedQueryException
      Converts a QueryRequest into a Solr query and returns the result as a SourceResponse.
      Parameters:
      request - query request to execute against Solr
      Returns:
      converted Solr response
      Throws:
      ddf.catalog.source.UnsupportedQueryException - if the query is not supported
    • query

      List<ddf.catalog.data.Metacard> query(String queryString) throws ddf.catalog.source.UnsupportedQueryException
      Runs a Solr query and converts the result as a list of Metacard objects.
      Parameters:
      queryString - Solr query string
      Returns:
      list of Metacard objects created from the Solr result
      Throws:
      ddf.catalog.source.UnsupportedQueryException - if the query is not supported, e.g., invalid query string
    • getIds

      List<ddf.catalog.data.Metacard> getIds(Set<String> ids) throws ddf.catalog.source.UnsupportedQueryException
      Throws:
      ddf.catalog.source.UnsupportedQueryException
    • getContentTypes

      Set<ddf.catalog.data.ContentType> getContentTypes()
      Returns:
      set of supported content types.
    • add

      @Nullable List<org.apache.solr.common.SolrInputDocument> add(@Nullable List<ddf.catalog.data.Metacard> metacards, boolean forceAutoCommit) throws IOException, org.apache.solr.client.solrj.SolrServerException, ddf.catalog.data.MetacardCreationException
      Adds a list of Metacard objects to Solr.
      Parameters:
      metacards - list of Metacard objects to add
      forceAutoCommit - force an auto-commit after the addition
      Returns:
      list of documents added
      Throws:
      IOException - if there is a communication error with the server
      org.apache.solr.client.solrj.SolrServerException - if there is an error on the server
      ddf.catalog.data.MetacardCreationException - if a Metacard could not be created
    • deleteByIds

      void deleteByIds(String fieldName, List<? extends Serializable> identifiers, boolean forceCommit) throws IOException, org.apache.solr.client.solrj.SolrServerException
      Deletes Solr documents by ID.
      Parameters:
      fieldName - field name that contains the ID
      identifiers - list of identifiers to delete
      forceCommit - force an auto-commit after the deletion
      Throws:
      IOException - if there is a communication error with the server
      org.apache.solr.client.solrj.SolrServerException - if there is an error on the server
    • deleteByQuery

      void deleteByQuery(String query) throws IOException, org.apache.solr.client.solrj.SolrServerException
      Deletes all the Solr documents that match a specific query.
      Parameters:
      query - Solr query string
      Throws:
      IOException - if there is a communication error with the server
      org.apache.solr.client.solrj.SolrServerException - if there is an error on the server