public class SolrContext extends Object
Provides a class that will statically hold the Solr server.
This is initialized in SolrSearchServiceImpl and used in SolrIndexServiceImpl
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.solr.client.solrj.SolrClient |
adminServer |
static String |
PRIMARY |
protected static org.apache.solr.client.solrj.SolrClient |
primaryServer |
static String |
REINDEX |
protected static org.apache.solr.client.solrj.SolrClient |
reindexServer |
| Constructor and Description |
|---|
SolrContext() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.solr.client.solrj.SolrClient |
getAdminServer()
The adminServer is just a reference to a SolrClient component for connecting to Solr.
|
static org.apache.solr.client.solrj.SolrClient |
getReindexServer() |
static org.apache.solr.client.solrj.SolrClient |
getServer() |
static boolean |
isSingleCoreMode() |
static boolean |
isSolrCloudMode()
Indicates if we are communicating with SolrCloud, rather than embedded, or Stand-alone
Solr server(s).
|
static void |
setAdminServer(org.apache.solr.client.solrj.SolrClient server)
Sets the admin SolrClient instance to communicate with Solr for administrative reasons, like swapping cores.
|
static void |
setPrimaryServer(org.apache.solr.client.solrj.SolrClient server)
Sets the primary SolrClient instance to communicate with Solr.
|
static void |
setReindexServer(org.apache.solr.client.solrj.SolrClient server)
Sets the SolrClient instance that points to the reindex core for the purpose of doing a full reindex, while the
primary core is still serving serving requests.
|
public static final String PRIMARY
public static final String REINDEX
protected static org.apache.solr.client.solrj.SolrClient adminServer
protected static org.apache.solr.client.solrj.SolrClient primaryServer
protected static org.apache.solr.client.solrj.SolrClient reindexServer
public static void setPrimaryServer(org.apache.solr.client.solrj.SolrClient server)
org.apache.solr.client.solrj.embedded.EmbeddedSolrClient,
org.apache.solr.client.solrj.impl.HttpSolrClient,
org.apache.solr.client.solrj.impl.LBHttpSolrClient,
or org.apache.solr.client.solrj.impl.CloudSolrClientserver - public static void setReindexServer(org.apache.solr.client.solrj.SolrClient server)
org.apache.solr.client.solrj.embedded.EmbeddedSolrServer,
org.apache.solr.client.solrj.impl.HttpSolrServer,
org.apache.solr.client.solrj.impl.LBHttpSolrServer,
or org.apache.solr.client.solrj.impl.CloudSolrClientserver - public static void setAdminServer(org.apache.solr.client.solrj.SolrClient server)
org.apache.solr.client.solrj.embedded.EmbeddedSolrServer,
org.apache.solr.client.solrj.impl.HttpSolrServer,
org.apache.solr.client.solrj.impl.LBHttpSolrServer,
or org.apache.solr.client.solrj.impl.CloudSolrClient
This should not typically need to be set unless using a stand-alone configuration, where the path to the
/admin URI is different than the core URI. This should not typically be set for EmbeddedSolrServer or
CloudSolrClient.server - public static org.apache.solr.client.solrj.SolrClient getAdminServer()
public static org.apache.solr.client.solrj.SolrClient getServer()
public static org.apache.solr.client.solrj.SolrClient getReindexServer()
isSingleCoreMode(), else the reindex serverpublic static boolean isSingleCoreMode()
public static boolean isSolrCloudMode()
Copyright © 2016. All rights reserved.