lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Berry <>
Subject Re: Help with Embedded Server - SOLVED
Date Thu, 13 May 2010 20:51:11 GMT
Thanks for all the help Lance.

I was finally able to get it working by using a more complex initialization
[code lang="groovy"]
def solrHome = ConfigurationHolder.config.universitySearchService?.solrHome
?: ""
def coreName = ConfigurationHolder.config.universitySearchService?.solrCore
?: "universities"
if (!solrHome) {
   throw new IllegalArgumentException("UniversitySearchService configured as
embedded, but no solrHome property is set.")
CoreContainer coreContainer = new CoreContainer(solrHome)
File solrHomeDir = new File(solrHome)
File solrDataDir = new File(solrHomeDir, "data")
SolrConfig solrConfig = new SolrConfig(solrHome, "solrconfig.xml", null) //
null input stream so the xml file is used instead.
CoreDescriptor descriptor = new CoreDescriptor(coreContainer, coreName,
SolrCore solrCore = new SolrCore(coreName, solrDataDir.path, solrConfig,
null, descriptor)
coreContainer.register(solrCore, false)
server = new EmbeddedSolrServer(coreContainer, coreName)

I basically needed to create a SolrConfig, SolrConfig, and CoreDescriptor
manually and register it with the CoreContainer.


Learn from the past. Live in the present. Plan for the future.
jEdit <> - Programmer's Text Editor
Bazaar <> - Version Control for Humans

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message