Package org.apache.solr.client.solrj.request

Examples of org.apache.solr.client.solrj.request.UpdateRequest


    if (inputDocs.size() + numDeletes >= commitSize) {
      try {
        LOG.info("Indexing " + Integer.toString(inputDocs.size()) + " documents");
        LOG.info("Deleting " + Integer.toString(numDeletes) + " documents");
        numDeletes = 0;
        UpdateRequest req = new UpdateRequest();
        req.add(inputDocs);
        req.setParams(params);
        req.process(solr);
      } catch (final SolrServerException e) {
        throw makeIOException(e);
      }
      inputDocs.clear();
    }
View Full Code Here


      if (!inputDocs.isEmpty()) {
        LOG.info("Indexing " + Integer.toString(inputDocs.size()) + " documents");
        if (numDeletes > 0) {
          LOG.info("Deleting " + Integer.toString(numDeletes) + " documents");
        }
        UpdateRequest req = new UpdateRequest();
        req.add(inputDocs);
        req.setParams(params);
        req.process(solr);
        inputDocs.clear();
      }
      // solr.commit();
    } catch (final SolrServerException e) {
      throw makeIOException(e);
View Full Code Here

        // Do the operation!
        long fullStartTime = System.currentTimeMillis();
        // Open a socket to ingest, and to the response stream to get the post result
        try
        {
          UpdateResponse response = new UpdateRequest(postRemoveAction).deleteById(documentURI).process(solrServer);
           
          // Success
          activityStart = new Long(fullStartTime);
          activityCode = "OK";
          activityDetails = null;
View Full Code Here

      try
      {
        try
        {
          // Do the operation!
          UpdateRequest updateRequest = new UpdateRequest(postUpdateAction + "?commit=true");
          UpdateResponse response = updateRequest.process(solrServer);
          //UpdateResponse response = solrServer.commit();
        }
        catch (InterruptedIOException ioe)
        {
          return;
View Full Code Here

        try {
          updateRequest.process(solr);
        } catch (SolrServerException e) {
          throw new IOException(e);
        }
        updateRequest = new UpdateRequest();
        numDeletes = 0;
      }
    }
  }
View Full Code Here

        try {
          updateRequest.process(solr);
        } catch (SolrServerException e) {
          throw new IOException(e);
        }
        updateRequest = new UpdateRequest();
        numDeletes = 0;
      }
    }
  }
View Full Code Here

        long create = System.currentTimeMillis();
        if(closed){
            log.warn("The SolrYard '{}' was already closed!",config.getName());
        }
        try {
            final UpdateRequest update = new UpdateRequest();
            if (!immediateCommit) {
                update.setCommitWithin(commitWithin);
            }
            update.add(inputDocument);
            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                public Object run() throws IOException, SolrServerException {
                    update.process(server);
                    if (immediateCommit) {
                        server.commit();
                    }
                    return null; // nothing to return
                }
View Full Code Here

        }
        long created = System.currentTimeMillis();
        if(closed){
            log.warn("The SolrYard '{}' was already closed!",config.getName());
        }
        final UpdateRequest update = new UpdateRequest();
        if (!immediateCommit) {
            update.setCommitWithin(commitWithin);
        }
        update.add(inputDocs);
        try {
            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                public Object run() throws IOException, SolrServerException {
                update.process(server);
                if (immediateCommit) {
                    server.commit();
                }
                return null;
                }
View Full Code Here

            }
        }
        long created = System.currentTimeMillis();
        if (!inputDocs.isEmpty()) {
            try {
                final UpdateRequest update = new UpdateRequest();
                if (!immediateCommit) {
                    update.setCommitWithin(commitWithin);
                }
                update.add(inputDocs);
                AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                    public UpdateResponse run() throws IOException, SolrServerException {
                        update.process(server);
                        if (immediateCommit) {
                            server.commit();
                        }
                        return null;
                    }
View Full Code Here

            ZkStateReader zkStateReader = cloudSolrServer.getZkStateReader();
            SolrZkClient zkClient = zkStateReader.getZkClient();
            if (zkClient.isConnected() && !zkClient.exists("/configs/" + solrCollection, false)) {
                File dir = new File(solrConfDir != null ? solrConfDir : getClass().getResource("/solr-oak-conf").getFile());
                ZkController.uploadConfigDir(zkClient, dir, solrCollection);
                UpdateRequest req = new UpdateRequest("/admin/collections");
                req.setParam("action", "CREATE");
                req.setParam("numShards", String.valueOf(solrShardsNo));
                req.setParam("replicationFactor", String.valueOf(solrReplicationFactor));
                req.setParam("collection.configName", solrCollection);
                req.setParam("name", solrCollection);
                cloudSolrServer.request(req);
            }
        } catch (Exception e) {
            log.warn("could not create collection {}", solrCollection);
            throw new SolrServerException(e);
View Full Code Here

TOP

Related Classes of org.apache.solr.client.solrj.request.UpdateRequest

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.