public class EmbeddedSolrFactory extends Object implements SolrClientFactory
EmbeddedSolrServer
clients. Modifier and Type | Field and Description |
---|---|
static String |
IMMEMORY_SOLRCONFIG_XML |
Constructor and Description |
---|
EmbeddedSolrFactory() |
Modifier and Type | Method and Description |
---|---|
static File |
getConfigFile(String configFileName,
ConfigurationFileProxy configProxy,
String core) |
static org.apache.solr.client.solrj.SolrClient |
getEmbeddedSolrServer()
Creates a new
EmbeddedSolrServer using the default Solr core name (), configuration file () and schema. |
static org.apache.solr.client.solrj.embedded.EmbeddedSolrServer |
getEmbeddedSolrServer(String solrConfigXml)
Creates a new
EmbeddedSolrServer using the Solr configuration file provided. |
static org.apache.solr.client.solrj.embedded.EmbeddedSolrServer |
getEmbeddedSolrServer(String coreName,
String solrConfigXml,
String schemaXml,
ConfigurationFileProxy givenConfigFileProxy)
Creates a new
EmbeddedSolrServer using the Solr core and configuration file names,
schema and configuration file proxy provided. |
Future<org.apache.solr.client.solrj.SolrClient> |
newClient(String core)
Requests the creation of a new
SolrClient for a specific Solr core name. |
public static final String IMMEMORY_SOLRCONFIG_XML
public Future<org.apache.solr.client.solrj.SolrClient> newClient(String core)
SolrClientFactory
SolrClient
for a specific Solr core name. Future.get()
will return null
if a SolrClient
could not be
created either immediately or after a retry period determined by the implementing class.
Clients of this class should consider implementing retry logic if needed based on that return
value.newClient
in interface SolrClientFactory
core
- name of the Solr core to createFuture
used to retrieve the new SolrClient
createdpublic static org.apache.solr.client.solrj.SolrClient getEmbeddedSolrServer()
EmbeddedSolrServer
using the default Solr core name (), configuration file () and schema.EmbeddedSolrServer
instancepublic static org.apache.solr.client.solrj.embedded.EmbeddedSolrServer getEmbeddedSolrServer(@Nullable String solrConfigXml)
EmbeddedSolrServer
using the Solr configuration file provided. Uses the
default core name () and schema.solrConfigXml
- name of the Solr configuration file. Defaults to if null
.EmbeddedSolrServer
instancepublic static org.apache.solr.client.solrj.embedded.EmbeddedSolrServer getEmbeddedSolrServer(String coreName, @Nullable String solrConfigXml, @Nullable String schemaXml, @Nullable ConfigurationFileProxy givenConfigFileProxy)
EmbeddedSolrServer
using the Solr core and configuration file names,
schema and configuration file proxy provided.coreName
- name of the Solr coresolrConfigXml
- name of the Solr configuration file. Defaults to if null
.schemaXml
- file name of the Solr core schema. Defaults to if null
.givenConfigFileProxy
- ConfigurationFileProxy
instance to use. If null
, a
new ConfigurationFileProxy
will be used.EmbeddedSolrServer
instancepublic static File getConfigFile(String configFileName, ConfigurationFileProxy configProxy, String core)
This work is licensed under a Creative Commons Attribution 4.0 International License.