public static class ConcurrentUpdateSolrClient.Builder extends SolrClientBuilder<ConcurrentUpdateSolrClient.Builder>
ConcurrentUpdateSolrClient
instances from provided configuration.Modifier and Type | Field and Description |
---|---|
protected String |
baseSolrUrl |
protected ExecutorService |
executorService |
protected int |
queueSize |
protected boolean |
streamDeletes |
protected int |
threadCount |
connectionTimeoutMillis, httpClient, responseParser, socketTimeoutMillis
Constructor and Description |
---|
Builder(String baseSolrUrl)
Create a Builder object, based on the provided Solr URL.
|
Modifier and Type | Method and Description |
---|---|
ConcurrentUpdateSolrClient.Builder |
alwaysStreamDeletes()
Configures created clients to always stream delete requests.
|
ConcurrentUpdateSolrClient |
build()
Create a
ConcurrentUpdateSolrClient based on the provided configuration options. |
ConcurrentUpdateSolrClient.Builder |
getThis()
The solution for the unchecked cast warning.
|
ConcurrentUpdateSolrClient.Builder |
neverStreamDeletes()
Configures created clients to not stream delete requests.
|
ConcurrentUpdateSolrClient.Builder |
withExecutorService(ExecutorService executorService)
Provides the
ExecutorService for clients to use when servicing requests. |
ConcurrentUpdateSolrClient.Builder |
withQueueSize(int queueSize)
The number of documents to batch together before sending to Solr.
|
ConcurrentUpdateSolrClient.Builder |
withThreadCount(int threadCount)
The number of threads used to empty
ConcurrentUpdateSolrClient s queue. |
withConnectionTimeout, withHttpClient, withResponseParser, withSocketTimeout
protected String baseSolrUrl
protected int queueSize
protected int threadCount
protected ExecutorService executorService
protected boolean streamDeletes
public Builder(String baseSolrUrl)
SolrClient client = new ConcurrentUpdateSolrClient.Builder("http://my-solr-server:8983/solr/core1").build(); QueryResponse resp = client.query(new SolrQuery("*:*"));Note that when a core is provided in the base URL, queries and other requests can be made without mentioning the core explicitly. However, the client can only send requests to that core. 2) The path of the root Solr path ("/solr")
SolrClient client = new ConcurrentUpdateSolrClient.Builder("http://my-solr-server:8983/solr").build(); QueryResponse resp = client.query("core1", new SolrQuery("*:*"));In this case the client is more flexible and can be used to send requests to any cores. This flexibility though requires that the core be specified on all requests.
public ConcurrentUpdateSolrClient.Builder withQueueSize(int queueSize)
public ConcurrentUpdateSolrClient.Builder withThreadCount(int threadCount)
ConcurrentUpdateSolrClient
s queue.public ConcurrentUpdateSolrClient.Builder withExecutorService(ExecutorService executorService)
ExecutorService
for clients to use when servicing requests.public ConcurrentUpdateSolrClient.Builder alwaysStreamDeletes()
public ConcurrentUpdateSolrClient.Builder neverStreamDeletes()
public ConcurrentUpdateSolrClient build()
ConcurrentUpdateSolrClient
based on the provided configuration options.public ConcurrentUpdateSolrClient.Builder getThis()
SolrClientBuilder
getThis
in class SolrClientBuilder<ConcurrentUpdateSolrClient.Builder>
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.