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
Date Tue, 11 May 2010 17:06:39 GMT
Hi Lance,

On Mon, May 10, 2010 at 5:43 PM, Lance Norskog <> wrote:

> It thinks you are talking to a core named 'Universities'. If this does
> not help, you could post the code that opens the SolrServer and
> creates the query object.
 It's looking for a core named "Universities - Embedded Solr Server"
actually. I've tried to set this to just "" as described in the wiki page
but that didn't work either. I looked through the wiki page on the
solrconfig.xml and I don't see a way to define the core name?

The code I'm using to create the embedded server is:
[code lang="groovy"]
String solrHome =
ConfigurationHolder.config.universitySearchService?.solrHome ?: ""
// set to:
if (!solrHome) {
   throw new IllegalArgumentException("UniversitySearchService configured as
embedded, but no solrHome property is set.")
// copied from:
System.setProperty("solr.solr.home", solrHome)
CoreContainer.Initializer initializer = new CoreContainer.Initializer()
CoreContainer coreContainer = initializer.initialize()
server = new EmbeddedSolrServer(coreContainer, "Universities - Embedded Solr

The code where I create a query is:
[code lang="groovy"]
def search(Map options = [:], String query) {
   Map solrOptions = [query: query] + options
   SolrQuery solrQuery = new SolrQuery(solrOptions)
   QueryResponse response = server?.query(solrQuery)
   def universities = []
   response?.results?.each { document ->
      universities << new University(
            state: document.state
   return universities

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