You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jiang mingyuan <ma...@gmail.com> on 2011/07/20 05:40:25 UTC

how to get solr core information using solrj

hi all,

Our solr server contains two cores:core0,core1,and they both works well.

Now I'am trying to find a way to get information about core0 and core1.

Can solrj or other api do this?


thanks very much.

Re: how to get solr core information using solrj

Posted by Jiang mingyuan <ma...@gmail.com>.
HI Erick:

At the page you have show me, I found some useful methods.
But it seems like not contains method about how to obtain core names,core
paths.

so,I followed the solr index page's method,wrote a jsp page ,like:

CoreContainer
cores=(CoreContainer)request.getAttribute("org.apache.solr.CoreContainer");
then cores.getCores() get core informations.

later I translate infos to json format.

at client side.I use httpClient to request this page,then parse json to Java
Object.

finally i got what i want.

thanks again.

On Mon, Jul 25, 2011 at 9:40 PM, Erick Erickson <er...@gmail.com>wrote:

>
> http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/request/CoreAdminRequest.html
>
> That should get you started.....
>
>
> Best
> Erick
>
> On Tue, Jul 19, 2011 at 11:40 PM, Jiang mingyuan
> <ma...@gmail.com> wrote:
> > hi all,
> >
> > Our solr server contains two cores:core0,core1,and they both works well.
> >
> > Now I'am trying to find a way to get information about core0 and core1.
> >
> > Can solrj or other api do this?
> >
> >
> > thanks very much.
> >
>

Re: how to get solr core information using solrj

Posted by Erick Erickson <er...@gmail.com>.
http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/request/CoreAdminRequest.html

That should get you started.....


Best
Erick

On Tue, Jul 19, 2011 at 11:40 PM, Jiang mingyuan
<ma...@gmail.com> wrote:
> hi all,
>
> Our solr server contains two cores:core0,core1,and they both works well.
>
> Now I'am trying to find a way to get information about core0 and core1.
>
> Can solrj or other api do this?
>
>
> thanks very much.
>

Re: how to get solr core information using solrj

Posted by Jiang mingyuan <ma...@gmail.com>.
hi Stefan,


thanks for your advice,i wrote a jsp file to obtain those information.
witch looks like :

CoreContainer
cores=(CoreContainer)request.getAttribute("org.apache.solr.CoreContainer");
then cores.getCores() get core informations.

later I translate infos to json format.

at client side.I use httpClient to request this page,then parse json to Java
Object.

finally i got what i want.


i am not familiar with solr,so i'm not sure their are other good interfaces.

On  http://wiki.apache.org/solr/**CoreAdmin#STATUS<http://wiki.apache.org/solr/CoreAdmin#STATUS>
,
I have not found direct method to get information about core names ,paths
etc.

many thanks for your advice.



On Wed, Jul 20, 2011 at 3:01 PM, Stefan Matheis <
matheis.stefan@googlemail.com> wrote:

> Jiang,
>
> what about http://wiki.apache.org/solr/**CoreAdmin#STATUS<http://wiki.apache.org/solr/CoreAdmin#STATUS>?
>
> Regards
> Stefan
>
> Am 20.07.2011 05:40, schrieb Jiang mingyuan:
>
>  hi all,
>>
>> Our solr server contains two cores:core0,core1,and they both works well.
>>
>> Now I'am trying to find a way to get information about core0 and core1.
>>
>> Can solrj or other api do this?
>>
>>
>> thanks very much.
>>
>>

Re: how to get solr core information using solrj

Posted by Stefan Matheis <ma...@googlemail.com>.
Jiang,

what about http://wiki.apache.org/solr/CoreAdmin#STATUS ?

Regards
Stefan

Am 20.07.2011 05:40, schrieb Jiang mingyuan:
> hi all,
>
> Our solr server contains two cores:core0,core1,and they both works well.
>
> Now I'am trying to find a way to get information about core0 and core1.
>
> Can solrj or other api do this?
>
>
> thanks very much.
>