public class NoOpSolrMetacardClient extends Object implements SolrMetacardClient
SolrMetacardClient
interface.Modifier and Type | Method and Description |
---|---|
List<org.apache.solr.common.SolrInputDocument> |
add(List<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 |
deleteByQuery(String query)
Deletes all the Solr documents that match a specific query.
|
Set<ContentType> |
getContentTypes() |
static NoOpSolrMetacardClient |
getInstance() |
SourceResponse |
query(QueryRequest request)
Converts a
QueryRequest into a Solr query and returns the result as a SourceResponse . |
List<Metacard> |
query(String queryString)
Runs a Solr query and converts the result as a list of
Metacard objects. |
public static NoOpSolrMetacardClient getInstance()
public SourceResponse query(QueryRequest request) throws UnsupportedQueryException
SolrMetacardClient
QueryRequest
into a Solr query and returns the result as a SourceResponse
.query
in interface SolrMetacardClient
request
- query request to execute against SolrUnsupportedQueryException
- if the query is not supportedpublic List<Metacard> query(String queryString) throws UnsupportedQueryException
SolrMetacardClient
Metacard
objects.query
in interface SolrMetacardClient
queryString
- Solr query stringMetacard
objects created from the Solr resultUnsupportedQueryException
- if the query is not supported, e.g., invalid query stringpublic Set<ContentType> getContentTypes()
getContentTypes
in interface SolrMetacardClient
public List<org.apache.solr.common.SolrInputDocument> add(List<Metacard> metacards, boolean forceAutoCommit) throws IOException, org.apache.solr.client.solrj.SolrServerException, MetacardCreationException
SolrMetacardClient
Metacard
objects to Solr.add
in interface SolrMetacardClient
metacards
- list of Metacard
objects to addforceAutoCommit
- force an auto-commit after the additionIOException
- if there is a communication error with the serverorg.apache.solr.client.solrj.SolrServerException
- if there is an error on the serverMetacardCreationException
- if a Metacard
could not be createdpublic void deleteByIds(String fieldName, List<? extends Serializable> identifiers, boolean forceCommit) throws IOException, org.apache.solr.client.solrj.SolrServerException
SolrMetacardClient
deleteByIds
in interface SolrMetacardClient
fieldName
- field name that contains the IDidentifiers
- list of identifiers to deleteforceCommit
- force an auto-commit after the deletionIOException
- if there is a communication error with the serverorg.apache.solr.client.solrj.SolrServerException
- if there is an error on the serverpublic void deleteByQuery(String query) throws IOException, org.apache.solr.client.solrj.SolrServerException
SolrMetacardClient
deleteByQuery
in interface SolrMetacardClient
query
- Solr query stringIOException
- if there is a communication error with the serverorg.apache.solr.client.solrj.SolrServerException
- if there is an error on the serverThis work is licensed under a Creative Commons Attribution 4.0 International License.