Interface SolrSearchProvider
- All Known Implementing Classes:
AbstractSolrSearchProvider,SolrCloudSearchProvider,SolrStandaloneSearchProvider,XmlExportSearchProvider
public interface SolrSearchProvider
Abstraction for different search provider implementations.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumCommit type to be used when performing a commit. -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit(Index index, SolrSearchProvider.CommitType commitType) Performs a commit on the given index.voidcreateIndex(Index index) Creates an index (if it does not exist).voiddeleteAllDocuments(Index index) Deletes all documents from an index.voiddeleteDocumentsByPk(Index index, Collection<PK> pks) Deletes documents matching the provided list of pksvoiddeleteIndex(Index index) Deletes an index (if it exists).voiddeleteOldDocuments(Index index, long indexOperationId) Deletes old documents from an index.voidexportConfig(Index index) Exports the configuration to a specific index.org.apache.solr.client.solrj.SolrClientReturnsSolrClientfor specificIndex, that can be used for searches.org.apache.solr.client.solrj.SolrClientgetClientForIndexing(Index index) ReturnsSolrClientfor specificIndex, that can be used for indexing.voidOptimizes a given index.resolveIndex(FacetSearchConfig facetSearchConfig, IndexedType indexedType, String qualifier) Resolves an index.
-
Method Details
-
resolveIndex
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
ReturnsSolrClientfor specificIndex, that can be used for searches.- Parameters:
index- - the index- Returns:
SolrClientinstance- Throws:
SolrServiceException- if an error occurs
-
getClientForIndexing
org.apache.solr.client.solrj.SolrClient getClientForIndexing(Index index) throws SolrServiceException ReturnsSolrClientfor specificIndex, that can be used for indexing.- Parameters:
index- - the index- Returns:
SolrClientinstance- Throws:
SolrServiceException- if an error occurs
-
createIndex
Creates an index (if it does not exist).- Parameters:
index- - the index- Throws:
SolrServiceException- if an error occurs
-
deleteIndex
Deletes an index (if it exists).- Parameters:
index- - the index- Throws:
SolrServiceException- if an error occurs
-
exportConfig
Exports the configuration to a specific index.- Parameters:
index- - the index- Throws:
SolrServiceException- if an error occurs
-
deleteAllDocuments
Deletes all documents from an index.- Parameters:
index- - the index- Throws:
SolrServiceException- if an error occurs
-
deleteOldDocuments
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
Deletes documents matching the provided list of pks- Parameters:
index- - the indexpks- - the pks list- Throws:
SolrServiceException- if an error occurs
-
commit
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
Optimizes a given index. It does not wait for the operation to complete.- Parameters:
index- - the index- Throws:
SolrServiceException- if an error occurs
-