lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Furkan KAMACI <>
Subject Re: SolrJ best pratices
Date Wed, 09 Oct 2013 08:13:41 GMT
I suggest you to look at here:

2013/10/9 Shawn Heisey <>

> On 10/7/2013 3:08 PM, Mark wrote:
>> Some specific questions:
>> - When working with HttpSolrServer should we keep around instances for
>> ever or should we create a singleton that can/should be used over and over?
>> - Is there a way to change the collection after creating the server or do
>> we need to create a new server for each collection?
> If at all possible, you should create your server object and use it for
> the life of your application.  SolrJ is threadsafe.  If there is any part
> of it that's not, the javadocs should say so - the SolrServer
> implementations definitely are.
> By using the word "collection" you are implying that you are using
> SolrCloud ... but earlier you said HttpSolrServer, which implies that you
> are NOT using SolrCloud.
> With HttpSolrServer, your base URL includes the core or collection name -
> "http://server:port/solr/**corename" for example.  Generally you will
> need one object for each core/collection, and another object for
> server-level things like CoreAdmin.
> With SolrCloud, you should be using CloudSolrServer instead, another
> implementation of SolrServer that is constantly aware of the SolrCloud
> clusterstate.  With that object, you can use setDefaultCollection, and you
> can also add a "collection" parameter to each SolrQuery or other request
> object.
> Thanks,
> Shawn

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message