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

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


      else
        localClient.getCredentialsProvider().setCredentials(AuthScope.ANY, credentials);
    }

    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    HttpSolrServer httpSolrServer = new ModifiedHttpSolrServer(httpSolrServerUrl, localClient, new XMLResponseParser());
    // Set the solrj instance we want to use
    solrServer = httpSolrServer;
  }
View Full Code Here


        return solrServer;
    }

    private SolrServer initializeWithExistingHttpServer() throws IOException, SolrServerException {
        // try basic Solr HTTP client
        HttpSolrServer httpSolrServer = new HttpSolrServer(solrHttpUrl);
        if (OakSolrUtils.checkServerAlive(httpSolrServer)) {
            // TODO : check if oak collection exists, otherwise create it
            return httpSolrServer;
        } else {
            throw new IOException("the found HTTP Solr server is not alive");
View Full Code Here

        return solrServer;
    }

    private SolrServer initializeWithExistingHttpServer() throws IOException, SolrServerException {
        // try basic Solr HTTP client
        HttpSolrServer httpSolrServer = new HttpSolrServer(solrHttpUrl);
        if (OakSolrUtils.checkServerAlive(httpSolrServer)) {
            // TODO : check if the oak core exists, otherwise create it
            return httpSolrServer;
        } else {
            throw new IOException("the found HTTP Solr server is not alive");
View Full Code Here

      else
        localClient.getCredentialsProvider().setCredentials(AuthScope.ANY, credentials);
    }

    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    HttpSolrServer httpSolrServer = new HttpSolrServer(httpSolrServerUrl, localClient);
    // For portability with older versions of Solr
    httpSolrServer.setParser(new XMLResponseParser());
    // Set the solrj instance we want to use
    solrServer = httpSolrServer;
  }
View Full Code Here

    LOG.info("Using Solr server at " + solrServerUrl);
    String solrJServerType = ((solrJServerImpl == null || solrJServerImpl.equals(""))?"http":solrJServerImpl);
    // HttpSolrServer - denoted by "http" in properties
    if (solrJServerType.toString().toLowerCase().equals("http")) {
      LOG.info("Using HttpSolrServer Solrj implementation.");
      this.adminServer = new HttpSolrServer(solrServerUrl);
      this.server = new HttpSolrServer( solrServerUrl + "/" + mapping.getCoreName() );
      // CloudSolrServer - denoted by "cloud" in properties
    } else if (solrJServerType.toString().toLowerCase().equals("cloud")) {
      LOG.info("Using CloudSolrServer Solrj implementation.");
      this.adminServer = new CloudSolrServer(solrServerUrl);
      this.server = new CloudSolrServer( solrServerUrl + "/" + mapping.getCoreName() );
View Full Code Here

      else
        localClient.getCredentialsProvider().setCredentials(AuthScope.ANY, credentials);
    }

    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    HttpSolrServer httpSolrServer = new ModifiedHttpSolrServer(httpSolrServerUrl, localClient, new XMLResponseParser());
    // Set the solrj instance we want to use
    solrServer = httpSolrServer;
  }
View Full Code Here

    this.parser = parser;
  }
 
  @Override
  protected HttpSolrServer makeServer(String server) {
    HttpSolrServer s = new ModifiedHttpSolrServer(server, httpClient, parser);
    RequestWriter r = getRequestWriter();
    Set<String> qp = getQueryParams();
    if (r != null) {
      s.setRequestWriter(r);
    }
    if (qp != null) {
      s.setQueryParams(qp);
    }
    return s;
  }
View Full Code Here

        @SuppressWarnings("unchecked")
        SolrYardConfig config = new SolrYardConfig((Dictionary<String,Object>) ctx.getProperties());
        log.info("activate {} (name:{})",getClass().getSimpleName(),config.getId());
        String indexLocation = config.getSolrServerLocation();
        if(indexLocation.startsWith("http") && indexLocation.indexOf("://") > 0){
            solrServer = new HttpSolrServer(indexLocation);
            //directly register configs that use a remote server
            updateSolrYardRegistration(solrServer, config);
        } else { //locally managed Server
            IndexReference solrServerRef = IndexReference.parse(config.getSolrServerLocation());
            //We do not (yet) support creating SolrIndexes on ManagedSolrServers other than the
View Full Code Here

        return solrServer;
    }

    private SolrServer initializeWithExistingHttpServer() throws IOException, SolrServerException {
        // try basic Solr HTTP client
        HttpSolrServer httpSolrServer = new HttpSolrServer(solrHttpUrl);
        if (OakSolrUtils.checkServerAlive(httpSolrServer)) {
            // TODO : check if the oak core exists, otherwise create it
            return httpSolrServer;
        } else {
            throw new IOException("the found HTTP Solr server is not alive");
View Full Code Here

        // do we have servers?
        SolrComponent.SolrServerReference ref = getComponent().getSolrServers(this);
        if (ref == null) {

            // no then create new servers
            HttpSolrServer solrServer = new HttpSolrServer(url);
            ConcurrentUpdateSolrServer solrStreamingServer = new ConcurrentUpdateSolrServer(url, streamingQueueSize, streamingThreadCount);

            // set the properties on the solr server
            if (maxRetries != null) {
                solrServer.setMaxRetries(maxRetries);
            }
            if (soTimeout != null) {
                solrServer.setSoTimeout(soTimeout);
            }
            if (connectionTimeout != null) {
                solrServer.setConnectionTimeout(connectionTimeout);
            }
            if (defaultMaxConnectionsPerHost != null) {
                solrServer.setDefaultMaxConnectionsPerHost(defaultMaxConnectionsPerHost);
            }
            if (maxTotalConnections != null) {
                solrServer.setMaxTotalConnections(maxTotalConnections);
            }
            if (followRedirects != null) {
                solrServer.setFollowRedirects(followRedirects);
            }
            if (allowCompression != null) {
                solrServer.setAllowCompression(allowCompression);
            }

            ref = new SolrComponent.SolrServerReference();
            ref.setSolrServer(solrServer);
            ref.setUpdateSolrServer(solrStreamingServer);
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.