Revision 53806
Added by Claudio Atzori over 5 years ago
SolrIndexClient.java | ||
---|---|---|
20 | 20 |
import eu.dnetlib.functionality.index.solr.cql.SolrTypeBasedCqlValueTransformerMapFactory; |
21 | 21 |
import eu.dnetlib.functionality.index.solr.feed.StreamingInputDocumentFactory; |
22 | 22 |
import eu.dnetlib.functionality.index.utils.MetadataReference; |
23 |
import eu.dnetlib.functionality.index.utils.ZkServers; |
|
23 | 24 |
import eu.dnetlib.miscutils.datetime.HumanTime; |
24 | 25 |
import eu.dnetlib.miscutils.functional.UnaryFunction; |
25 | 26 |
import org.apache.commons.lang3.StringUtils; |
... | ... | |
222 | 223 |
if (this.client == null) { |
223 | 224 |
String url = getUrl(); |
224 | 225 |
log.debug("create new Client " + url); |
225 |
client = new CloudSolrClient.Builder().withZkHost(url).build(); |
|
226 |
|
|
227 |
final ZkServers zk = ZkServers.newInstance(url); |
|
228 |
final CloudSolrClient client = new CloudSolrClient.Builder(zk.getHosts(), zk.getChroot()).build(); |
|
229 |
|
|
230 |
client.connect(); |
|
226 | 231 |
client.setDefaultCollection(String.format("%s-%s-%s", getFormat(), getLayout(), getInterpretation())); |
227 | 232 |
try { |
228 | 233 |
client.ping(); |
Also available in: Unified diff
branch for solr 7.5.0