public class SolrMetacardClientImpl extends Object implements SolrMetacardClient
| Modifier and Type | Field and Description |
|---|---|
static String |
EXCLUDE_ATTRIBUTES |
static String |
POINT_KEY |
protected static String |
RELEVANCE_SORT_FIELD |
static String |
SORT_FIELD_KEY |
| Constructor and Description |
|---|
SolrMetacardClientImpl(org.apache.solr.client.solrj.SolrClient client,
FilterAdapter catalogFilterAdapter,
SolrFilterDelegateFactory solrFilterDelegateFactory,
DynamicSchemaResolver dynamicSchemaResolver) |
| 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. |
MetacardImpl |
createMetacard(org.apache.solr.common.SolrDocument doc) |
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.
|
org.apache.solr.client.solrj.SolrClient |
getClient() |
Set<ContentType> |
getContentTypes() |
String |
getIdentifierQuery(String fieldName,
List<? extends Serializable> identifiers) |
protected org.apache.solr.common.SolrInputDocument |
getSolrInputDocument(Metacard metacard) |
protected org.apache.solr.client.solrj.SolrQuery |
getSolrQuery(QueryRequest request,
SolrFilterDelegate solrFilterDelegate) |
protected org.apache.solr.client.solrj.SolrQuery |
postAdapt(QueryRequest request,
SolrFilterDelegate filterDelegate,
org.apache.solr.client.solrj.SolrQuery query) |
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. |
protected String |
setSortProperty(QueryRequest request,
org.apache.solr.client.solrj.SolrQuery query,
SolrFilterDelegate solrFilterDelegate) |
protected static final String RELEVANCE_SORT_FIELD
public static final String SORT_FIELD_KEY
public static final String POINT_KEY
public static final String EXCLUDE_ATTRIBUTES
public SolrMetacardClientImpl(org.apache.solr.client.solrj.SolrClient client,
FilterAdapter catalogFilterAdapter,
SolrFilterDelegateFactory solrFilterDelegateFactory,
DynamicSchemaResolver dynamicSchemaResolver)
public org.apache.solr.client.solrj.SolrClient getClient()
public SourceResponse query(QueryRequest request) throws UnsupportedQueryException
SolrMetacardClientQueryRequest into a Solr query and returns the result as a SourceResponse.query in interface SolrMetacardClientrequest - query request to execute against SolrUnsupportedQueryException - if the query is not supportedpublic List<Metacard> query(String queryString) throws UnsupportedQueryException
SolrMetacardClientMetacard objects.query in interface SolrMetacardClientqueryString - 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 SolrMetacardClientprotected org.apache.solr.client.solrj.SolrQuery getSolrQuery(QueryRequest request, SolrFilterDelegate solrFilterDelegate) throws UnsupportedQueryException
UnsupportedQueryExceptionprotected org.apache.solr.client.solrj.SolrQuery postAdapt(QueryRequest request, SolrFilterDelegate filterDelegate, org.apache.solr.client.solrj.SolrQuery query) throws UnsupportedQueryException
UnsupportedQueryExceptionprotected String setSortProperty(QueryRequest request, org.apache.solr.client.solrj.SolrQuery query, SolrFilterDelegate solrFilterDelegate)
public MetacardImpl createMetacard(org.apache.solr.common.SolrDocument doc) throws MetacardCreationException
MetacardCreationExceptionpublic List<org.apache.solr.common.SolrInputDocument> add(List<Metacard> metacards, boolean forceAutoCommit) throws IOException, org.apache.solr.client.solrj.SolrServerException, MetacardCreationException
SolrMetacardClientMetacard objects to Solr.add in interface SolrMetacardClientmetacards - 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 createdprotected org.apache.solr.common.SolrInputDocument getSolrInputDocument(Metacard metacard) throws MetacardCreationException
MetacardCreationExceptionpublic void deleteByIds(String fieldName, List<? extends Serializable> identifiers, boolean forceCommit) throws IOException, org.apache.solr.client.solrj.SolrServerException
SolrMetacardClientdeleteByIds in interface SolrMetacardClientfieldName - 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
SolrMetacardClientdeleteByQuery in interface SolrMetacardClientquery - Solr query stringIOException - if there is a communication error with the serverorg.apache.solr.client.solrj.SolrServerException - if there is an error on the serverpublic String getIdentifierQuery(String fieldName, List<? extends Serializable> identifiers)
This work is licensed under a Creative Commons Attribution 4.0 International License.