lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <apa...@elyograg.org>
Subject Re: CloudSolrClient - setDefaultCollection
Date Thu, 21 Jun 2018 15:07:27 GMT
On 6/21/2018 5:04 AM, Greenhorn Techie wrote:
> While indexing, is there going to be any performance benefit to set the
> collection name first using setDefaultCollection
> <https://lucene.apache.org/solr/6_5_0/solr-solrj/org/apache/solr/client/solrj/impl/CloudSolrClient.html#setDefaultCollection-java.lang.String->
> (String
> <https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true>
> collection)
> method and then index the document
> using cloudClient.add(solrInputDoc), instead of suing the method
> cloudClient.add(collectionName, solrInputDoc)?
>
> Is this performance benefit to consider or is this mere of a convenience /
> better looking code?

There should be no detectable performance difference between the two 
unless you've got an accurate way to measure microseconds or 
nanoseconds.  Even then, the difference should be extremely small.

If the code was written smartly, and usually Solr code is written very 
well, both will end up being executed by the same final code, it will 
just be the source of the collection string that will be different.

Thanks,
Shawn


Mime
View raw message