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

Examples of org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.commit()


      SolrInputDocument doc = new SolrInputDocument();
      doc.addField("name", "Apache Whirr");
      doc.addField("inceptionYear", "2010");

      solrServer.add(doc);
      solrServer.commit();

      LOG.info("Committed document to instance " + instance.getId() + " @ " + publicIp);

      LOG.info("Performing a search on instance " + instance.getId() + " @ " + publicIp);
View Full Code Here


    FileOutputFormat.setOutputPath(job, tmp);
    try {
      JobClient.runJob(job);
      // do the commits once and for all the reducers in one go
      SolrServer solr =  new CommonsHttpSolrServer(solrUrl);
      solr.commit();
    }
    catch (Exception e){
      LOG.error(e);
    } finally {
      FileSystem.get(job).delete(tmp, true);
View Full Code Here

        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);
    if (getConf().getBoolean(SolrConstants.COMMIT_INDEX, true)) {
      solr.commit();
    }
    LOG.info("SolrIndexerJob: done.");
  }

  public int run(String[] args) throws Exception {
View Full Code Here

    FileOutputFormat.setOutputPath(job, tmp);
    try {
      JobClient.runJob(job);
      // do the commits once and for all the reducers in one go
      SolrServer solr =  new CommonsHttpSolrServer(solrUrl);
      solr.commit();
      long end = System.currentTimeMillis();
      LOG.info("SolrIndexer: finished at " + sdf.format(end) + ", elapsed: " + TimingUtil.elapsedTime(start, end));
    }
    catch (Exception e){
      LOG.error(e);
View Full Code Here

    Context context = new Context();
    // Find our solrserver
    CommonsHttpSolrServer solr = new CommonsHttpSolrServer(
        ConfigurationManager.getProperty("solr.log.server"));
    solr.deleteByQuery("*:*");
    solr.commit();

    Map metadataStorageInfo = SolrLogger.getMetadataStorageInfo();

    String prevIp = null;
    String dbfile = ConfigurationManager.getProperty("solr.dbfile");
View Full Code Here

      // Make sure we have a previous ip
      prevIp = ip;
    }
    System.out.println("Nr of countryErrors: " + countryErrors);
    // Commit at the end cause it takes a while
    solr.commit();
  }

  /**
   * Method returns a random integer between the given int
   *
 
View Full Code Here

        QueryResponse r = client.query(q);
        assertEquals(5, r.getResults().getNumFound());
       
        //delete
        client.deleteByQuery("title:foo");
        client.commit(true,true);
       
        //Add
        client.add(docs);       
        client.commit(true,true);
       
View Full Code Here

        client.deleteByQuery("title:foo");
        client.commit(true,true);
       
        //Add
        client.add(docs);       
        client.commit(true,true);
       
       
        //query
        r = client.query(q);
        assertEquals(5, r.getResults().getNumFound());
View Full Code Here

        for (int i = 1; i < 64; i++)
        {
            SolrInputDocument doc = createDoc(i % 4 == 0);
            client.add(doc);
            client.commit(true, true);
           
            SolrQuery q = new SolrQuery().setQuery("text:bar");
           
            client.query(q);
           
View Full Code Here

            docs.add(createDoc(false));
        }
       
        //Add
        client.add(docs);       
        client.commit(true,true);
       
        //query
        SolrQuery q = new SolrQuery().setQuery("*:*");      
        QueryResponse r = client.query(q);
        assertEquals(5, r.getResults().getNumFound());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.