Yes, I am aware of and using SolrJ and EmbeddedSolrServer.

I want to use multiple Solr indices and I was doing it by creating multiple 
instances of EmbeddedSolrServer.  For each EmbeddedSolrServer, I was creating a 
new SolrCore by creating new IndexSchema and SolrConfig objects.  It was 
working for me and I never bothered to use MultiCore.

Now, it seems that a lot has changed in the last few weeks and this method is 
not going to work well.  I understand that I should use a CoreContainer to 
manage all the cores and then create the EmbeddedSolrServers by using the 
CoreContainer to get the corresponding core.  What I cannot figure out is how 
to create and register the SolrCores.  In an earlier reply to this thread, 
Henri has provided some code which helps a lot in understanding how these 
classes (SolrCore, CoreDescriptor, CoreContainer) are related to each other.  I 
should be able to take it up from there.

Any further suggestions / comments would be most welcome.

Thanks,
Nikhil

PS:  http://people.apache.org/builds/lucene/solr/nightly/ is no longer updated 
daily, any idea what happened ?





----- Original Message ----
From: Shalin Shekhar Mangar <[EMAIL PROTECTED]>
To: solr-user@lucene.apache.org
Sent: Thursday, 28 August, 2008 6:30:16 PM
Subject: Re: CoreDescriptor explanation and possible bug

Hi Nikhil,

Can you please describe your use-case? Are you aware of EmbeddedSolrServer?

http://wiki.apache.org/solr/Solrj

On Thu, Aug 28, 2008 at 6:12 PM, Nikhil Chhaochharia <[EMAIL PROTECTED]>wrote:

> I went through the javadocs for the CoreContainer and CoreDescriptor
> classes (20th-Aug nightly, the latest I could find).  The steps for creating
> a SolrCore now appear to be:  (Note for the benefit of those who might
> stumble upon this through a websearch - this is not a HOWTO but my best
> guess which may not be correct)
>
> 1.  CoreContainer.Initializer.setSolrConfigFilename("path/solrconfig.xml")
> 2.  cc = CoreContainer.Initializer.initialize()
> 3.  cd = new CoreDescriptor(cc, "core01", "path/solrHome/for/core01")
> 4.  SolrCore sc = cc.create(cd)
>
> Is this correct?
>
>
> To specify my problem in another way, I have a solrconfig.xml but no
> schema.xml.  I create a IndexSchema object at runtime.  I want to now get a
> SolrCore object.
>
> Thanks,
> Nikhil
>
>
>
>
>
> ----- Original Message ----
> From: Henrib <[EMAIL PROTECTED]>
> To: solr-user@lucene.apache.org
> Sent: Thursday, 28 August, 2008 5:23:48 PM
> Subject: Re: CoreDescriptor explanation and possible bug
>
>
> Hi,
> It is likely to be related to how you initialize Solr & create your
> SolrCore; there has been a few changes to ensure there is always a
> CoreContainer created which (as its name stands), holds a reference to all
> created SolrCore.
> There is a CoreContainer.Initializer class that allows to easily create
> that
> CoreContainer (even if you don't have a solr.xml).
> Hope this helps,
> Henri
>
>
>
> Nikhil Chhaochharia wrote:
> >
> > Hi,
> >
> > I have been using nightly builds of Solr 1.3 with SolrJ for some time
> now.
> > I upgraded the Solr jars from the 14-Aug nightly and my program would not
> > compile.  I found that SolrCore constructor needed a new parameter
> > CoreDescriptor.  I passed null and it worked fine.
> >
> > I then upgraded to the Solr jars from the 20th-Aug nightly and it started
> > throwing NullPointerExceptions.  My guess is that the addition of the
> > method SolrCore.getStatistics() which has the line "lst.add("aliases",
> > getCoreDescriptor().getCoreContainer().getCoreNames(this));" throws the
> > NPE.
> >
> > I searched the wiki and there is no mention of CoreDescriptor there.
> > Could somebody please explain what CoreDescriptor is all about and how it
> > is supposed to be used?
> >
> > Thanks,
> > Nikhil
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/CoreDescriptor-explanation-and-possible-bug-tp19197004p19198965.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Regards,
Shalin Shekhar Mangar.

Reply via email to