Interface SolrSearchProvider
-
- All Known Implementing Classes:
AbstractSolrSearchProvider
,SolrCloudSearchProvider
,SolrStandaloneSearchProvider
,XmlExportSearchProvider
public interface SolrSearchProvider
Abstraction for different search provider implementations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SolrSearchProvider.CommitType
Commit type to be used when performing a commit.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
commit(Index index, SolrSearchProvider.CommitType commitType)
Performs a commit on the given index.void
createIndex(Index index)
Creates an index (if it does not exist).void
deleteAllDocuments(Index index)
Deletes all documents from an index.void
deleteDocumentsByPk(Index index, java.util.Collection<PK> pks)
Deletes documents matching the provided list of pksvoid
deleteIndex(Index index)
Deletes an index (if it exists).void
deleteOldDocuments(Index index, long indexOperationId)
Deletes old documents from an index.void
exportConfig(Index index)
Exports the configuration to a specific index.org.apache.solr.client.solrj.SolrClient
getClient(Index index)
ReturnsSolrClient
for specificIndex
, that can be used for searches.org.apache.solr.client.solrj.SolrClient
getClientForIndexing(Index index)
ReturnsSolrClient
for specificIndex
, that can be used for indexing.void
optimize(Index index)
Optimizes a given index.Index
resolveIndex(FacetSearchConfig facetSearchConfig, IndexedType indexedType, java.lang.String qualifier)
Resolves an index.
-
-
-
Method Detail
-
resolveIndex
Index resolveIndex(FacetSearchConfig facetSearchConfig, IndexedType indexedType, java.lang.String qualifier)
Resolves an index. Resolving an index only creates a search provider specific instance ofIndex
.- Parameters:
facetSearchConfig
- - the facet search configurationindexedType
- - the indexed typequalifier
- - the qualifier- Returns:
- the index
-
getClient
org.apache.solr.client.solrj.SolrClient getClient(Index index) throws SolrServiceException
ReturnsSolrClient
for specificIndex
, that can be used for searches.- Parameters:
index
- - the index- Returns:
SolrClient
instance- Throws:
SolrServiceException
- if an error occurs
-
getClientForIndexing
org.apache.solr.client.solrj.SolrClient getClientForIndexing(Index index) throws SolrServiceException
ReturnsSolrClient
for specificIndex
, that can be used for indexing.- Parameters:
index
- - the index- Returns:
SolrClient
instance- Throws:
SolrServiceException
- if an error occurs
-
createIndex
void createIndex(Index index) throws SolrServiceException
Creates an index (if it does not exist).- Parameters:
index
- - the index- Throws:
SolrServiceException
- if an error occurs
-
deleteIndex
void deleteIndex(Index index) throws SolrServiceException
Deletes an index (if it exists).- Parameters:
index
- - the index- Throws:
SolrServiceException
- if an error occurs
-
exportConfig
void exportConfig(Index index) throws SolrServiceException
Exports the configuration to a specific index.- Parameters:
index
- - the index- Throws:
SolrServiceException
- if an error occurs
-
deleteAllDocuments
void deleteAllDocuments(Index index) throws SolrServiceException
Deletes all documents from an index.- Parameters:
index
- - the index- Throws:
SolrServiceException
- if an error occurs
-
deleteOldDocuments
void deleteOldDocuments(Index index, long indexOperationId) throws SolrServiceException
Deletes old documents from an index. Old documents are documents that were not created/updated since a given index operation.- Parameters:
index
- - the indexindexOperationId
- - the index operation id- Throws:
SolrServiceException
- if an error occurs
-
deleteDocumentsByPk
void deleteDocumentsByPk(Index index, java.util.Collection<PK> pks) throws SolrServiceException
Deletes documents matching the provided list of pks- Parameters:
index
- - the indexpks
- - the pks list- Throws:
SolrServiceException
- if an error occurs
-
commit
void commit(Index index, SolrSearchProvider.CommitType commitType) throws SolrServiceException
Performs a commit on the given index. An hard commit makes sure that indexed documents are persisted and visible, a soft commit makes sure indexed documents are visible.- Parameters:
index
- - the indexcommitType
- - the commit type- Throws:
SolrServiceException
- if an error occurs
-
optimize
void optimize(Index index) throws SolrServiceException
Optimizes a given index. It does not wait for the operation to complete.- Parameters:
index
- - the index- Throws:
SolrServiceException
- if an error occurs
-
-