Package org.ametys.cms.search.solr
Interface SolrClientProvider
- All Known Implementing Classes:
DefaultSolrClientProvider
public interface SolrClientProvider
Component acting as a single entry point to get access to Solr clients.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the name of the collection to use.getCollectionName
(String workspaceName) Get the collection to use.org.apache.solr.client.solrj.SolrClient
Get the "read" mode solr client.default org.apache.solr.client.solrj.SolrClient
getUpdateClient
(String workspaceName) Get a (default) Solr client suited to update.org.apache.solr.client.solrj.SolrClient
getUpdateClient
(String workspaceName, boolean autoCommit) Get a Solr client suited to update.
-
Field Details
-
ROLE
The component role.
-
-
Method Details
-
getReadClient
org.apache.solr.client.solrj.SolrClient getReadClient()Get the "read" mode solr client.- Returns:
- the "read" mode solr client.
-
getUpdateClient
Get a (default) Solr client suited to update.- Parameters:
workspaceName
- The name of the workspace- Returns:
- a Solr client suited to update.
-
getUpdateClient
Get a Solr client suited to update.
You must call this method withfalse
value for argument `autocommit` so as to get a client that will not trigger any autocommit on Solr side.
Otherwise, calling this method withtrue
value for argument `autocommit` is equivalent to callinggetUpdateClient(String)
- Parameters:
workspaceName
- The name of the workspaceautoCommit
-false
so as to get a client that will not trigger any autocommit on Solr side.- Returns:
- a Solr client suited to update.
-
getCollectionName
Get the name of the collection to use.- Returns:
- The name of the collection to search in.
-
getCollectionName
Get the collection to use.- Parameters:
workspaceName
- The workspace name.- Returns:
- The name of the collection to search in.
-