Re: EmbeddedSolrServer API usage

2009-07-15 Thread Erik Hatcher
You most definitely do NOT want to bring up a new SolrCore for every query - there are lots of caches and warming that you want to take advantage of. I think the actual EmbeddedSolrServer is safe to instantiate fresh as it's lightweight, but you do want to keep some things persistent acros

Re: EmbeddedSolrServer API usage

2009-07-15 Thread Ravish007
Hi Erik & Ryan, The Java code snippet of yours was very helpful. I just wanted to ask you one question about keeping JVM running. Is it a good idea to keep it running for the duration the application that has it embedded runs and terminate it with the application only? Won't it be very wasteful

Re: EmbeddedSolrServer API usage

2008-10-08 Thread Grant Ingersoll
So, the answer to my own ? is: I was getting: java.lang.NullPointerException at org.apache.solr.core.CoreContainer.create(CoreContainer.java:315) at com.grantingersoll.noodles.EmbeddedTest.testEmbedded(EmbeddedTest.java: 23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Nat

Re: EmbeddedSolrServer API usage

2008-10-08 Thread Grant Ingersoll
I get an NPE in create when trying this. Seems the loader member is not instantiated for the container.create() call, since load is not called. On Oct 2, 2008, at 10:37 AM, Ryan McKinley wrote: You could also use the CoreContainer to create a Core from the descriptor: CoreContainer

Re: EmbeddedSolrServer API usage

2008-10-02 Thread Ryan McKinley
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 = cont

Re: EmbeddedSolrServer API usage

2008-10-02 Thread Erik Hatcher
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("c

Re: EmbeddedSolrServer API usage

2008-10-02 Thread Ryan McKinley
You could also use the CoreContainer to create a Core from the descriptor: CoreContainer container = new CoreContainer(); CoreDescriptor descriptor = new CoreDescriptor(container, "core1", "/Users/erik/apache-solr-1.3.0/example/solr"); SolrCore core = container.create( descr