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 "Zhao, Zane" <Za...@fil.com> on 2011/05/20 04:20:03 UTC

How can I query mutlitcore with solrJ

Dear team.

I installed to cores on my tomcat ,

http://localhost:8983/solr/fund_dih/admin/
http://localhost:8983/solr/fund_tika/admin/

How can I send one query request via Solrj to these URL?

Thanks and Regards

Zane


Re: How can I query mutlitcore with solrJ

Posted by Tommaso Teofili <to...@gmail.com>.
Or, if you want results from both together, you can use the distributed
search [1].
Just decide which one of the cores will be the "collector" and add the
shards=localhost:8983/solr/fund_dih,localhost:8983/solr/fund_tika parameter
like :

SolrServer server = new CommonsHttpSolrServer("
http://localhost:8983/solr/fund_dih");
SolrQuery solrQuery = new SolrQuery();
solrQuery.setQuery("*:*");
solrQuery.setStart(0);
solrQuery.setRows(10);
solrQuery.setParam("shards","localhost:8983/solr/fund_dih,localhost:8983/solr/fund_tika");
QueryResponse response = server.query(solrQuery);


Hope this helps,
Tommaso

[1] : http://wiki.apache.org/solr/DistributedSearch

2011/5/20 Rohit <ro...@in-rev.com>

> Each core need to be queried separately,
>
> http://localhost:8983/solr/fund_dih/select?q=
> http://localhost:8983/solr/fund_tika/select?q=
>
> Regards,
> Rohit
>
>
> -----Original Message-----
> From: Zhao, Zane [mailto:Zane.Zhao@fil.com]
> Sent: 20 May 2011 07:50
> To: solr-user@lucene.apache.org
> Subject: How can I query mutlitcore with solrJ
>
> Dear team.
>
> I installed to cores on my tomcat ,
>
> http://localhost:8983/solr/fund_dih/admin/
> http://localhost:8983/solr/fund_tika/admin/
>
> How can I send one query request via Solrj to these URL?
>
> Thanks and Regards
>
> Zane
>
>
>

RE: How can I query mutlitcore with solrJ

Posted by Rohit <ro...@in-rev.com>.
Each core need to be queried separately,

http://localhost:8983/solr/fund_dih/select?q=
http://localhost:8983/solr/fund_tika/select?q=

Regards,
Rohit


-----Original Message-----
From: Zhao, Zane [mailto:Zane.Zhao@fil.com] 
Sent: 20 May 2011 07:50
To: solr-user@lucene.apache.org
Subject: How can I query mutlitcore with solrJ

Dear team.

I installed to cores on my tomcat ,

http://localhost:8983/solr/fund_dih/admin/
http://localhost:8983/solr/fund_tika/admin/

How can I send one query request via Solrj to these URL?

Thanks and Regards

Zane