lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahammad <>
Subject Re: Using SolrJ with multicore/shards
Date Tue, 02 Jun 2009 16:50:37 GMT

I'm still not sure what you meant. I took a look at that class but I haven't
got any idea on how to proceed.

BTW I tried something like this 

query.setParam("shard", "http://localhost:8080/solr/core0/" ,

But it doesn't seem to work for me. I tried it with different variations
too, like removing the http://, and combining both cores as a single string.

Could you please clarify your suggestion?


Otis Gospodnetic wrote:
> You should be able to set any name=value URL parameter pair and send it to
> Solr using SolrJ.  What's the name of that class... MapSolrParams, I
> believe.
>  Otis
> --
> Sematext -- -- Lucene - Solr - Nutch
> ----- Original Message ----
>> From: ahammad <>
>> To:
>> Sent: Tuesday, June 2, 2009 11:06:55 AM
>> Subject: Using SolrJ with multicore/shards
>> Hello,
>> I have a MultiCore install of solr with 2 cores with different schemas
>> and
>> such. Querying directly using http request and/or the solr interface
>> works
>> very well for my purposes.
>> I want to have a proper search interface though, so I have some code that
>> basically acts as a link between the server and the front-end. Basically,
>> depending on the options, the search string is built, and when the search
>> is
>> submitted, that string gets passed as an http request. The code then
>> would
>> parse through the xml to get the information.
>> This method works with shards because I can add the shards parameter
>> straight into the link that I end up hitting. Although this is currently
>> functional, I was thinking of using SolrJ simply because it is simpler to
>> use and would cut down the amount of code.
>> The question is, how would I be able to define the shards in my query, so
>> that when I do search, I hit both shards and get mixed results back?
>> Using
>> http requests, it's as simple as adding a shard=core0,core1 snippet. What
>> is
>> the equivalent of this in SolrJ?
>> BTW, I do have some SolrJ code that is able to query and return results,
>> but
>> for a single core. I am currently using CommonsHttpSolrServer for that,
>> not
>> the Embedded one.
>> Cheers
>> -- 
>> View this message in context: 
>> Sent from the Solr - User mailing list archive at

View this message in context:
Sent from the Solr - User mailing list archive at

View raw message