lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan McKinley <ryan...@gmail.com>
Subject Re: EmbeddedSolrServer API usage
Date Thu, 02 Oct 2008 20:24:35 GMT

On Oct 2, 2008, at 1:58 PM, Erik Hatcher wrote:

> Thanks Ryan - good tips, and core.close() was the missing piece, duh.
>
> Here's how it looks in JRuby:
>
>  container = CoreContainer.new
>  descriptor = CoreDescriptor.new(container, "core1", "/Users/erik/ 
> apache-solr-1.3.0/example/solr")
>  core = container.create(descriptor)
>  container.register("core1", core, false)
>
>  solr = EmbeddedSolrServer.new(container, "core1")
>  query = SolrQuery.new("*:*")
>  response = solr.query(query)
>  puts response
>  core.close
>
> Perhaps there should be an overloaded CoreContainer#register(core)  
> that uses the name from the core descriptor so "core1" doesn't have  
> to be duplicated?
>

+1


   public SolrCore register(SolrCore core, boolean returnPrev) {
     return register( core.getName(), core, returnPrev );
   }



Mime
View raw message