Package org.apache.solr.client.solrj.impl

Examples of org.apache.solr.client.solrj.impl.HttpSolrServer


  @Override
  public void prepare(Map conf, TopologyContext context, OutputCollector collector) {
   
    this.collector = collector;
    try {
      this.solrServer = new HttpSolrServer(this.solrAddress);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here


        String serverUrl = config.getString(CONFIG_SERVER_URL);
        if (serverUrl == null || serverUrl.isEmpty()) {
            throw new IllegalArgumentException("HttpSolrServer requires a " + CONFIG_SERVER_URL + " field");
        }

        HttpSolrServer server = new HttpSolrServer(serverUrl);
        return server;
    }
View Full Code Here

     */
    Server() {
        initSettings();

        this.solrUrl = "http://localhost:" + currentSolrServerPort + "/solr"; //NON-NLS
        this.solrServer = new HttpSolrServer(solrUrl);
        serverAction = new ServerAction();
        solrFolder = InstalledFileLocator.getDefault().locate("solr", Server.class.getPackage().getName(), false); //NON-NLS
        instanceDir = solrFolder.getAbsolutePath() + File.separator + "solr"; //NON-NLS
        javaPath = PlatformUtil.getJavaPath();

View Full Code Here

        private HttpSolrServer solrCore;

        private Core(String name) {
            this.name = name;

            this.solrCore = new HttpSolrServer(solrUrl + "/" + name);

            //TODO test these settings
            //solrCore.setSoTimeout(1000 * 60);  // socket read timeout, make large enough so can index larger files
            //solrCore.setConnectionTimeout(1000);
            solrCore.setDefaultMaxConnectionsPerHost(2);
View Full Code Here

        LOG.info("solr.max.connections.per.host: "+maxConnectionsPerHost);
        LOG.info("solr.max.total.connections: "+maxTotalConnections);
       
        String url = "http://"+host+":"+port+"/solr/"+core+"/";
        LOG.info("初始化Solr服务器连接:"+url);
        HttpSolrServer httpSolrServer = new HttpSolrServer(url);
        httpSolrServer.setMaxRetries(maxRetries);
        httpSolrServer.setConnectionTimeout(connectionTimeout);
        httpSolrServer.setAllowCompression(allowCompression);
        httpSolrServer.setSoTimeout(socketReadTimeout);
        httpSolrServer.setDefaultMaxConnectionsPerHost(maxConnectionsPerHost);
        httpSolrServer.setMaxTotalConnections(maxTotalConnections);
       
        solrServer = httpSolrServer;
    }
View Full Code Here

TOP

Related Classes of org.apache.solr.client.solrj.impl.HttpSolrServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.