public class EmbeddedSolrServer extends SolrClient
Modifier and Type | Field and Description |
---|---|
protected CoreContainer |
coreContainer |
protected String |
coreName |
Constructor and Description |
---|
EmbeddedSolrServer(CoreContainer coreContainer,
String coreName)
Create an EmbeddedSolrServer wrapping a CoreContainer.
|
EmbeddedSolrServer(NodeConfig nodeConfig,
String defaultCoreName)
Create an EmbeddedSolrServer using a NodeConfig
|
EmbeddedSolrServer(Path solrHome,
String defaultCoreName)
Create an EmbeddedSolrServer using a given solr home directory
|
EmbeddedSolrServer(SolrCore core)
Create an EmbeddedSolrServer wrapping a particular SolrCore
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Shutdown all cores within the EmbeddedSolrServer instance
|
CoreContainer |
getCoreContainer()
Getter method for the CoreContainer
|
NamedList<Object> |
request(SolrRequest request,
String coreName) |
add, add, add, add, add, add, add, add, add, add, addBean, addBean, addBean, addBean, addBeans, addBeans, addBeans, addBeans, addBeans, addBeans, commit, commit, commit, commit, commit, commit, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteByQuery, deleteByQuery, deleteByQuery, deleteByQuery, getBinder, getById, getById, getById, getById, getById, getById, getById, getById, optimize, optimize, optimize, optimize, optimize, optimize, ping, query, query, query, query, queryAndStreamResponse, queryAndStreamResponse, request, rollback, rollback
protected final CoreContainer coreContainer
protected final String coreName
public EmbeddedSolrServer(Path solrHome, String defaultCoreName)
solrHome
- the solr home directorydefaultCoreName
- the core to route requests to by defaultpublic EmbeddedSolrServer(NodeConfig nodeConfig, String defaultCoreName)
nodeConfig
- the configurationdefaultCoreName
- the core to route requests to by defaultpublic EmbeddedSolrServer(SolrCore core)
public EmbeddedSolrServer(CoreContainer coreContainer, String coreName)
Note that EmbeddedSolrServer will shutdown the wrapped CoreContainer when
close()
is called.
coreContainer
- the core containercoreName
- the core to route requests to by defaultpublic NamedList<Object> request(SolrRequest request, String coreName) throws SolrServerException, IOException
request
in class SolrClient
SolrServerException
IOException
public void close() throws IOException
IOException
public CoreContainer getCoreContainer()
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.