lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Berry <elbe...@gmail.com>
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
process:
[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,
solrHome)
SolrCore solrCore = new SolrCore(coreName, solrDataDir.path, solrConfig,
null, descriptor)
coreContainer.register(solrCore, false)
server = new EmbeddedSolrServer(coreContainer, coreName)
[/code]

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

Thanks,
Eric

-- 
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans

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