List of usage examples for org.apache.solr.client.solrj.impl CloudSolrClient setParser
public void setParser(ResponseParser processor)
From source file:org.wso2.extension.siddhi.store.solr.impl.SolrClientServiceImpl.java
License:Open Source License
private void initSolrClientForTable(CollectionConfiguration config) throws SolrClientServiceException { synchronized (this) { String serverURL = config.getSolrServerUrl(); if (serverURL == null || serverURL.isEmpty()) { throw new SolrClientServiceException("Solr server URL for collection: " + config.getCollectionName() + " cannot be empty or null"); }//from ww w . ja v a 2 s . c om tableToConfigMapping.put(config.getCollectionName(), config); CloudSolrClient solrClient = new CloudSolrClient.Builder().withZkHost(config.getSolrServerUrl()) .build(); solrClient.setParser(new XMLResponseParser()); urlToSolrClientMapping.put(config.getSolrServerUrl(), new SiddhiSolrClient(config.getDomainName(), solrClient)); Integer count = urlToTableCountMapping.get(config.getSolrServerUrl()); if (count == null) { urlToTableCountMapping.put(config.getSolrServerUrl(), Integer.valueOf(1)); } else { urlToTableCountMapping.put(config.getSolrServerUrl(), count + 1); } } }