Package ddf.catalog.source.solr
Interface SolrMetacardClient
- All Known Implementing Classes:
SolrMetacardClientImpl
public interface SolrMetacardClient
Interface that defines the different metacard operations performed on Solr.
-
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.solr.common.SolrInputDocument>Adds a list ofMetacardobjects to Solr.voiddeleteByIds(String fieldName, List<? extends Serializable> identifiers, boolean forceCommit) Deletes Solr documents by ID.voiddeleteByQuery(String query) Deletes all the Solr documents that match a specific query.Set<ddf.catalog.data.ContentType>List<ddf.catalog.data.Metacard>ddf.catalog.operation.SourceResponsequery(ddf.catalog.operation.QueryRequest request) Converts aQueryRequestinto a Solr query and returns the result as aSourceResponse.List<ddf.catalog.data.Metacard>Runs a Solr query and converts the result as a list ofMetacardobjects.
-
Method Details
-
query
ddf.catalog.operation.SourceResponse query(ddf.catalog.operation.QueryRequest request) throws ddf.catalog.source.UnsupportedQueryException Converts aQueryRequestinto a Solr query and returns the result as aSourceResponse.- 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 ofMetacardobjects.- Parameters:
queryString- Solr query string- Returns:
- list of
Metacardobjects 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 ofMetacardobjects to Solr.- Parameters:
metacards- list ofMetacardobjects to addforceAutoCommit- force an auto-commit after the addition- Returns:
- list of documents added
- Throws:
IOException- if there is a communication error with the serverorg.apache.solr.client.solrj.SolrServerException- if there is an error on the serverddf.catalog.data.MetacardCreationException- if aMetacardcould 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 IDidentifiers- list of identifiers to deleteforceCommit- force an auto-commit after the deletion- Throws:
IOException- if there is a communication error with the serverorg.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 serverorg.apache.solr.client.solrj.SolrServerException- if there is an error on the server
-