/** * * @see #useMultiPartPost */ public CommonsHttpSolrServer(URL baseURL, HttpClient client, boolean useMultiPartPost) { this(baseURL, client, new BinaryResponseParser(), useMultiPartPost); }
/** * @param baseURL The URL of the Solr server. For example, * "<code>http://localhost:8983/solr/</code>" if you are using the * standard distribution Solr webapp on your local machine. */ public CommonsHttpSolrServer(URL baseURL) { this(baseURL, null, new BinaryResponseParser(), false); }
/** The provided httpClient should use a multi-threaded connection manager */ public LBHttpSolrClient(HttpClient httpClient, String... solrServerUrl) { this(httpClient, new BinaryResponseParser(), solrServerUrl); }
public Builder() { this.responseParser = new BinaryResponseParser(); }
public LBHttpSolrServer(HttpClient httpClient, String... solrServerUrl) throws MalformedURLException { this(httpClient, new BinaryResponseParser(), solrServerUrl); }
/** * @param baseURL * The URL of the Solr server. For example, " * <code>http://localhost:8983/solr/</code>" if you are using the * standard distribution Solr webapp on your local machine. */ public HttpSolrClient(String baseURL) { this(baseURL, null, new BinaryResponseParser()); }
public CommonsHttpSolrServer(URL baseURL, HttpClient client) { this(baseURL, client, new BinaryResponseParser(), false); }
public HttpSolrClient(String baseURL, HttpClient client) { this(baseURL, client, new BinaryResponseParser()); }
public Builder() { this.baseSolrUrls = new ArrayList<>(); this.responseParser = new BinaryResponseParser(); }
/** * Create a Builder object, based on the provided Solr URL. * * Two different paths can be specified as a part of this URL: * * 1) A path pointing directly at a particular core * <pre> * SolrClient client = new HttpSolrClient.Builder("http://my-solr-server:8983/solr/core1").build(); * QueryResponse resp = client.query(new SolrQuery("*:*")); * </pre> * 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") * <pre> * SolrClient client = new HttpSolrClient.Builder("http://my-solr-server:8983/solr").build(); * QueryResponse resp = client.query("core1", new SolrQuery("*:*")); * </pre> * 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. * * By default, compression is not enabled on created HttpSolrClient objects. */ public Builder(String baseSolrUrl) { this.baseSolrUrl = baseSolrUrl; this.responseParser = new BinaryResponseParser(); }
/** * Talk to the Solr server via the given HttpClient. The connection manager * for the client should be a MultiThreadedHttpConnectionManager if this * client is being reused across SolrServer instances, or of multiple threads * will use this SolrServer. */ public CommonsHttpSolrServer(String solrServerUrl, HttpClient httpClient) throws MalformedURLException { this(new URL(solrServerUrl), httpClient, new BinaryResponseParser(), false); }
public CommonsHttpSolrServer(String solrServerUrl, HttpClient httpClient, boolean useMultiPartPost) throws MalformedURLException { this(new URL(solrServerUrl), httpClient, new BinaryResponseParser(), useMultiPartPost); }
CommonsHttpSolrServer server =... server.setParser(new BinaryResponseParser());
this.lbClient = new LBHttpSolrClient(myClient); this.lbClient.setRequestWriter(new BinaryRequestWriter()); this.lbClient.setParser(new BinaryResponseParser()); this.updatesToLeaders = true; shutdownLBHttpSolrServer = true;
public SolrServer getSolrServer() { HttpSolrServer server = new HttpSolrServer(solrUrl); server.setRequestWriter(new BinaryRequestWriter()); server.setParser(new BinaryResponseParser()); return server; }
CloudSolrServer server = new CloudSolrServer("192.112.21.21:9983"); server.setZkConnectTimeout(15*60*1000); server.setZkClientTimeout(15*60*1000); server.setParser(new BinaryResponseParser()); server.setRequestWriter(new BinaryRequestWriter()); CollectionAdminRequest adminRequest = new CollectionAdminRequest(); adminRequest.setAction(CollectionAction.CLUSTERSTATUS); CollectionAdminResponse adminResponse = adminRequest.process(server); System.out.println(adminResponse.toString());
/** * @param zkHost * A zookeeper client endpoint. * @param updatesToLeaders * If true, sends updates only to shard leaders. * @param httpClient * the {@link HttpClient} instance to be used for all requests. The provided httpClient should use a * multi-threaded connection manager. * @see #CloudSolrClient(String) for full description and details on zkHost */ public CloudSolrClient(String zkHost, boolean updatesToLeaders, HttpClient httpClient) { this.zkHost = zkHost; this.clientIsInternal = httpClient == null; this.myClient = httpClient == null ? HttpClientUtil.createClient(null) : httpClient; this.lbClient = new LBHttpSolrClient(myClient); this.lbClient.setRequestWriter(new BinaryRequestWriter()); this.lbClient.setParser(new BinaryResponseParser()); this.updatesToLeaders = updatesToLeaders; shutdownLBHttpSolrServer = true; lbClient.addQueryParams(STATE_VERSION); }
private static LBHttpSolrClient createLBHttpSolrClient(Builder cloudSolrClientBuilder, HttpClient httpClient) { final LBHttpSolrClient.Builder lbBuilder = new LBHttpSolrClient.Builder(); lbBuilder.withHttpClient(httpClient); if (cloudSolrClientBuilder.connectionTimeoutMillis != null) { lbBuilder.withConnectionTimeout(cloudSolrClientBuilder.connectionTimeoutMillis); } if (cloudSolrClientBuilder.socketTimeoutMillis != null) { lbBuilder.withSocketTimeout(cloudSolrClientBuilder.socketTimeoutMillis); } final LBHttpSolrClient lbClient = lbBuilder.build(); lbClient.setRequestWriter(new BinaryRequestWriter()); lbClient.setParser(new BinaryResponseParser()); return lbClient; }
this.lbClient = new LBHttpSolrClient(myClient); this.lbClient.setRequestWriter(new BinaryRequestWriter()); this.lbClient.setParser(new BinaryResponseParser()); this.updatesToLeaders = true; shutdownLBHttpSolrServer = true;
this.lbClient = new LBHttpSolrClient(myClient); this.lbClient.setRequestWriter(new BinaryRequestWriter()); this.lbClient.setParser(new BinaryResponseParser()); this.updatesToLeaders = true; shutdownLBHttpSolrServer = true;