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.SolrServer |
adminServer |
static String |
PRIMARY |
protected static org.apache.solr.client.solrj.SolrServer |
primaryServer |
static String |
REINDEX |
protected static org.apache.solr.client.solrj.SolrServer |
reindexServer |
| Constructor and Description |
|---|
SolrContext() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.solr.client.solrj.SolrServer |
getAdminServer()
The adminServer is just a reference to a SolrServer component for connecting to Solr.
|
static org.apache.solr.client.solrj.SolrServer |
getReindexServer() |
static org.apache.solr.client.solrj.SolrServer |
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.SolrServer server)
Sets the admin SolrServer instance to communicate with Solr for administrative reasons, like swapping cores.
|
static void |
setPrimaryServer(org.apache.solr.client.solrj.SolrServer server)
Sets the primary SolrServer instance to communicate with Solr.
|
static void |
setReindexServer(org.apache.solr.client.solrj.SolrServer server)
Sets the SolrServer 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.SolrServer adminServer
protected static org.apache.solr.client.solrj.SolrServer primaryServer
protected static org.apache.solr.client.solrj.SolrServer reindexServer
public static void setPrimaryServer(org.apache.solr.client.solrj.SolrServer 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.CloudSolrServerserver - public static void setReindexServer(org.apache.solr.client.solrj.SolrServer 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.CloudSolrServerserver - public static void setAdminServer(org.apache.solr.client.solrj.SolrServer 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.CloudSolrServer
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
CloudSolrServer.server - public static org.apache.solr.client.solrj.SolrServer getAdminServer()
public static org.apache.solr.client.solrj.SolrServer getServer()
public static org.apache.solr.client.solrj.SolrServer getReindexServer()
isSingleCoreMode(), else the reindex serverpublic static boolean isSingleCoreMode()
public static boolean isSolrCloudMode()
Copyright © 2017. All rights reserved.