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

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


 
  private String searchUID;

  public SolrSearchBean(Configuration conf, String solrServer)
  throws IOException {
    solr = new CommonsHttpSolrServer(solrServer);
    filters = new QueryFilters(conf);
    SolrMappingReader mapping = SolrMappingReader.getInstance(conf);
    searchUID = mapping.getUniqueKey();
  }
View Full Code Here


    try {
      run(ToolUtil.toArgMap(
          Nutch.ARG_SOLR, solrUrl,
          Nutch.ARG_BATCH, batchId));
      // do the commits once and for all the reducers in one go
      SolrServer solr = new CommonsHttpSolrServer(solrUrl);
      solr.commit();
    } finally {
      FileSystem.get(getConf()).delete(
          FileOutputFormat.getOutputPath(currentJob), true);
    }
    LOG.info("SolrIndexerJob: done.");
View Full Code Here

  @Override
  public void open(TaskAttemptContext job, String name)
  throws IOException {
    Configuration conf = job.getConfiguration();
    solr = new CommonsHttpSolrServer(conf.get(SolrConstants.SERVER_URL));
    commitSize = conf.getInt(SolrConstants.COMMIT_SIZE, 1000);
    solrMapping = SolrMappingReader.getInstance(conf);
  }
View Full Code Here

        // Start a Solr instance.
        solrRunner = new JettySolrRunner("/solr", SolrComponentTestSupport.PORT);
        solrRunner.start();

        solrServer = new CommonsHttpSolrServer("http://localhost:" + SolrComponentTestSupport.PORT + "/solr");
    }
View Full Code Here

      client.setParams(params);
    }

    String serverURL = job.get(SolrConstants.SERVER_URL);
   
    return new CommonsHttpSolrServer(serverURL, client);
  }
View Full Code Here

import org.junit.Test;

public abstract class CacheHeaderTestBase extends SolrJettyTestBase {

  protected HttpMethodBase getSelectMethod(String method) {
    CommonsHttpSolrServer httpserver = (CommonsHttpSolrServer)getSolrServer();
    HttpMethodBase m = null;
    if ("GET".equals(method)) {
      m = new GetMethod(httpserver.getBaseURL() + "/select");
    } else if ("HEAD".equals(method)) {
      m = new HeadMethod(httpserver.getBaseURL() + "/select");
    } else if ("POST".equals(method)) {
      m = new PostMethod(httpserver.getBaseURL() + "/select");
    }
    m.setQueryString(new NameValuePair[] { new NameValuePair("q", "solr"),
          new NameValuePair("qt", "standard") });
    return m;
  }
View Full Code Here

          new NameValuePair("qt", "standard") });
    return m;
  }

  protected HttpMethodBase getUpdateMethod(String method) {
    CommonsHttpSolrServer httpserver = (CommonsHttpSolrServer)getSolrServer();
    HttpMethodBase m = null;
   
    if ("GET".equals(method)) {
      m=new GetMethod(httpserver.getBaseURL()+"/update/csv");
    } else if ("POST".equals(method)) {
      m=new PostMethod(httpserver.getBaseURL()+"/update/csv");
    } else if ("HEAD".equals(method)) {
      m=new HeadMethod(httpserver.getBaseURL()+"/update/csv");
    }
   
    return m;
  }
View Full Code Here

   
    return m;
  }
 
  protected HttpClient getClient() {
    CommonsHttpSolrServer httpserver = (CommonsHttpSolrServer)getSolrServer();
    return httpserver.getHttpClient();
  }
View Full Code Here

    jetty = new JettySolrRunner(context, 0);
    jetty.start();
    port = jetty.getLocalPort();

    String url = "http://localhost:" + jetty.getLocalPort() + context;
    server = new CommonsHttpSolrServer(url);
  }
View Full Code Here

            logger.info("added schema");

            for (String vcore : subIndexes)
            {

                CommonsHttpSolrServer solrClient = getSolrClient(core + "." + vcore);

                testOneDocument(solrClient);
                logger.info("testOneDocument");

                testAddData(solrClient);
View Full Code Here

TOP

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

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.