public class SolrConfiguration extends Object implements org.springframework.beans.factory.InitializingBean
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 org.apache.solr.client.solrj.SolrClient |
adminServer |
protected String |
namespace |
protected String |
primaryName |
protected org.apache.solr.client.solrj.SolrClient |
primaryServer |
protected String |
reindexName |
protected org.apache.solr.client.solrj.SolrClient |
reindexServer |
protected String |
siteAliasBase |
protected String |
siteCollectionBase |
protected boolean |
siteCollections |
protected String |
solrCloudConfigName |
protected Integer |
solrCloudNumReplicas |
protected Integer |
solrCloudNumShards |
protected String |
solrHomePath |
| Constructor and Description |
|---|
SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
org.apache.solr.client.solrj.SolrClient adminServer)
Sets up Solr using multiple clients, one primary, one for reindexing, and one admin to reduce down time during
indexing.
|
SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
org.apache.solr.client.solrj.SolrClient adminServer,
String namespace)
Sets up Solr using multiple clients, one primary, one for reindexing, and one admin to reduce down time during
indexing.
|
SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
org.apache.solr.client.solrj.SolrClient adminServer,
String primaryCoreName,
String reindexCoreName)
Sets up Solr using multiple clients, one primary, one for reindexing, and one admin to reduce down time during
indexing.
|
SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
org.apache.solr.client.solrj.SolrClient adminServer,
String primaryCoreName,
String reindexCoreName,
String namespace)
Sets up Solr using multiple clients, one primary, one for reindexing, and one admin to reduce down time during
indexing.
|
SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
String solrCloudConfigName,
int solrCloudNumShards)
This constructor should be used to set up Solr Cloud using solr cloud config name, number of cloud shards, and
multiple clients, one primary, and one for reindexing to reduce down time during indexing.
|
SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
String solrCloudConfigName,
int solrCloudNumShards,
String namespace)
This constructor should be used to set up Solr Cloud using solr cloud config name, number of cloud shards, and
multiple clients, one primary, and one for reindexing to reduce down time during indexing.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected void |
createAliasIfNotExist(org.apache.solr.client.solrj.impl.CloudSolrClient client,
String collectionName,
String aliasName) |
protected void |
createCollectionIfNotExist(org.apache.solr.client.solrj.impl.CloudSolrClient client,
String collectionName) |
void |
destroy() |
protected String |
determineCoreName(org.apache.solr.client.solrj.impl.HttpSolrClient httpSolrClient) |
org.apache.solr.client.solrj.SolrClient |
getAdminServer()
The adminServer is just a reference to a SolrClient component for connecting to Solr.
|
String |
getNamespace() |
String |
getPrimaryName() |
String |
getQueryCollectionName() |
String |
getReindexCollectionName() |
String |
getReindexName() |
org.apache.solr.client.solrj.SolrClient |
getReindexServer() |
org.apache.solr.client.solrj.SolrClient |
getServer() |
protected String |
getSiteAliasBase() |
protected String |
getSiteAliasName(Site site) |
protected String |
getSiteCollectionBase() |
protected String |
getSiteCollectionName(Site site) |
protected String |
getSiteReindexAliasName(Site site) |
protected String |
getSiteReindexCollectionName(Site site) |
org.apache.solr.client.solrj.SolrClient |
getSiteReindexServer() |
org.apache.solr.client.solrj.SolrClient |
getSiteServer() |
String |
getSolrCloudConfigName() |
Integer |
getSolrCloudNumReplicas() |
Integer |
getSolrCloudNumShards() |
String |
getSolrHomePath() |
boolean |
isSingleCoreMode() |
boolean |
isSiteCollections() |
boolean |
isSolrCloudMode() |
void |
setAdminServer(org.apache.solr.client.solrj.SolrClient server)
Sets the admin SolrClient instance to communicate with Solr for administrative reasons, like swapping cores.
|
void |
setNamespace(String namespace) |
void |
setPrimaryName(String primaryName) |
void |
setReindexName(String reindex) |
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.
|
void |
setServer(org.apache.solr.client.solrj.SolrClient server)
Sets the primary SolrClient instance to communicate with Solr.
|
void |
setSiteAliasBase(String siteAliasBase) |
void |
setSiteCollectionBase(String siteCollectionBase) |
void |
setSiteCollections(boolean siteCollections) |
void |
setSolrCloudConfigName(String solrCloudConfigName) |
void |
setSolrCloudNumReplicas(Integer solrCloudNumReplicas) |
void |
setSolrCloudNumShards(int solrCloudNumShards) |
void |
setSolrCloudNumShards(Integer solrCloudNumShards) |
void |
setSolrHomePath(String solrHomePath) |
protected String primaryName
protected String reindexName
protected String namespace
protected org.apache.solr.client.solrj.SolrClient adminServer
protected org.apache.solr.client.solrj.SolrClient primaryServer
protected org.apache.solr.client.solrj.SolrClient reindexServer
protected String solrCloudConfigName
protected Integer solrCloudNumShards
protected Integer solrCloudNumReplicas
protected String solrHomePath
@Value(value="${solr.index.site.collections:false}")
protected boolean siteCollections
@Value(value="${solr.index.site.alias.name:site}")
protected String siteAliasBase
@Value(value="${solr.index.site.collection.name:blcSite}")
protected String siteCollectionBase
public SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
org.apache.solr.client.solrj.SolrClient adminServer)
throws IllegalStateException
solrServer - reindexServer - adminServer - IllegalStateExceptionpublic SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
org.apache.solr.client.solrj.SolrClient adminServer,
String namespace)
throws IllegalStateException
solrServer - reindexServer - adminServer - namespace - IllegalStateExceptionpublic SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
org.apache.solr.client.solrj.SolrClient adminServer,
String primaryCoreName,
String reindexCoreName)
throws IllegalStateException
solrServer - reindexServer - adminServer - primaryCoreName - reindexCoreName - IllegalStateExceptionpublic SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
org.apache.solr.client.solrj.SolrClient adminServer,
String primaryCoreName,
String reindexCoreName,
String namespace)
throws IllegalStateException
solrServer - reindexServer - adminServer - primaryCoreName - reindexCoreName - namespace - IllegalStateExceptionpublic SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
String solrCloudConfigName,
int solrCloudNumShards)
throws IllegalStateException
solrServer - reindexServer - solrCloudConfigName - solrCloudNumShards - IllegalStateExceptionpublic SolrConfiguration(org.apache.solr.client.solrj.SolrClient solrServer,
org.apache.solr.client.solrj.SolrClient reindexServer,
String solrCloudConfigName,
int solrCloudNumShards,
String namespace)
throws IllegalStateException
solrServer - reindexServer - solrCloudConfigName - solrCloudNumShards - namespace - IllegalStateExceptionpublic String getPrimaryName()
public void setPrimaryName(String primaryName)
public String getReindexName()
public void setReindexName(String reindex)
public String getSolrCloudConfigName()
public void setSolrCloudConfigName(String solrCloudConfigName)
public Integer getSolrCloudNumShards()
public void setSolrCloudNumShards(Integer solrCloudNumShards)
public Integer getSolrCloudNumReplicas()
public void setSolrCloudNumReplicas(Integer solrCloudNumReplicas)
public String getSolrHomePath()
public void setSolrHomePath(String solrHomePath)
public String getNamespace()
public void setNamespace(String namespace)
public void setServer(org.apache.solr.client.solrj.SolrClient server)
throws IllegalStateException
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 - IllegalStateExceptionpublic void setReindexServer(org.apache.solr.client.solrj.SolrClient server)
throws IllegalStateException
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 - IllegalStateExceptionpublic 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 org.apache.solr.client.solrj.SolrClient getAdminServer()
public org.apache.solr.client.solrj.SolrClient getServer()
public org.apache.solr.client.solrj.SolrClient getReindexServer()
isSingleCoreMode(), else the reindex serverpublic boolean isSingleCoreMode()
public boolean isSolrCloudMode()
public void afterPropertiesSet()
throws org.apache.solr.client.solrj.SolrServerException,
IOException,
IllegalStateException
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanorg.apache.solr.client.solrj.SolrServerExceptionIOExceptionIllegalStateExceptionpublic org.apache.solr.client.solrj.SolrClient getSiteServer()
public org.apache.solr.client.solrj.SolrClient getSiteReindexServer()
protected void createCollectionIfNotExist(org.apache.solr.client.solrj.impl.CloudSolrClient client,
String collectionName)
protected void createAliasIfNotExist(org.apache.solr.client.solrj.impl.CloudSolrClient client,
String collectionName,
String aliasName)
protected String getSiteAliasName(Site site)
site - the Siteprotected String getSiteCollectionName(Site site)
site - the Siteprotected String getSiteReindexAliasName(Site site)
site - the Siteprotected String getSiteReindexCollectionName(Site site)
site - the Siteprotected String getSiteAliasBase()
protected String getSiteCollectionBase()
public boolean isSiteCollections()
public void setSiteAliasBase(String siteAliasBase)
public void setSiteCollectionBase(String siteCollectionBase)
public void setSiteCollections(boolean siteCollections)
public void setSolrCloudNumShards(int solrCloudNumShards)
public String getQueryCollectionName()
public String getReindexCollectionName()
protected String determineCoreName(org.apache.solr.client.solrj.impl.HttpSolrClient httpSolrClient)
Copyright © 2021. All rights reserved.