public void setParser(ResponseParser responseParser) { client.setParser(responseParser); }
public void setParser(ResponseParser responseParser) { client.setParser(responseParser); }
private SolrClient getStandaloneIndexSolrClient() { if (StringUtils.isEmpty(solrMaster)) { try { throw new AEMSolrSearchException( "Initialization failed. The property 'solr-master' is missing for Standalone mode."); } catch (AEMSolrSearchException e) { LOG.error("Solr client initialization failed.", e); } } LOG.debug("Creating HttpSolrClient using solrMaster '{}'", solrMaster); HttpSolrClient client = new HttpSolrClient(solrMaster); client.setParser(new XMLResponseParser()); return client; }
@Bean public HttpSolrClient solrClient(@Value("${solr.url}") String solrUrl, @Value("${solr.pool.maxTotalConnections}") Integer maxTotalConnections) throws MalformedURLException { HttpSolrClient solrClient = new HttpSolrClient(solrUrl); solrClient.setParser(new TextXMLResponseParser()); solrClient.setMaxTotalConnections(maxTotalConnections); solrClient.setDefaultMaxConnectionsPerHost(maxTotalConnections); return solrClient; }
@Before public void setUp() throws Exception { super.setUp(); collector = new Collector(); if (EXTERNAL_SOLR_SERVER_URL != null) { //solrServer = new ConcurrentUpdateSolrServer(EXTERNAL_SOLR_SERVER_URL, 2, 2); //solrServer = new SafeConcurrentUpdateSolrServer(EXTERNAL_SOLR_SERVER_URL, 2, 2); solrClient = getHttpSolrClient(EXTERNAL_SOLR_SERVER_URL); ((HttpSolrClient) solrClient).setParser(new XMLResponseParser()); } else { if (TEST_WITH_EMBEDDED_SOLR_SERVER) { solrClient = new TestEmbeddedSolrServer(h.getCoreContainer(), DEFAULT_TEST_CORENAME); } else { throw new RuntimeException("Not yet implemented"); //solrServer = new TestSolrServer(getSolrClient()); } } int batchSize = SEQ_NUM2.incrementAndGet() % 2 == 0 ? 100 : 1; //SolrInspector.DEFAULT_SOLR_SERVER_BATCH_SIZE : 1; testServer = new SolrServerDocumentLoader(solrClient, batchSize); deleteAllDocuments(); tempDir = createTempDir().toFile().getAbsolutePath(); }