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

Examples of org.apache.solr.client.solrj.request.UpdateRequest.process()


        } else if (body instanceof SolrInputDocument) {

            UpdateRequest updateRequest = new UpdateRequest(getRequestHandler());
            updateRequest.add((SolrInputDocument) body);

            updateRequest.process(solrServer);

        } else {

            boolean hasSolrHeaders = false;
            for (Map.Entry<String, Object> entry : exchange.getIn().getHeaders().entrySet()) {
View Full Code Here


                        String fieldName = entry.getKey().substring(SolrConstants.FIELD.length());
                        doc.setField(fieldName, entry.getValue());
                    }
                }
                updateRequest.add(doc);
                updateRequest.process(solrServer);

            } else if (body instanceof String) {

                String bodyAsString = (String) body;
View Full Code Here

   */
  public UpdateResponse add(Collection<SolrInputDocument> docs, int commitWithinMs) throws SolrServerException, IOException {
    UpdateRequest req = new UpdateRequest();
    req.add(docs);
    req.setCommitWithin(commitWithinMs);
    return req.process(this);
  }

  /**
   * Adds a collection of beans
   * @param beans  the collection of beans
View Full Code Here

   */
  public UpdateResponse add(SolrInputDocument doc, int commitWithinMs) throws SolrServerException, IOException {
    UpdateRequest req = new UpdateRequest();
    req.add(doc);
    req.setCommitWithin(commitWithinMs);
    return req.process(this);
  }

  /**
   * Adds a single bean
   * @param obj  the input bean
View Full Code Here

        server.setAllowCompression(false);
        server.setMaxRetries(4);
        server.setRequestWriter(new BinaryRequestWriter());
        UpdateRequest req = new UpdateRequest();
        req.add(docs);
        UpdateResponse rsp = req.process(server);
        rtn.put(s, rsp.toString());
        }catch(Throwable e)
        {
          LOG.error("insert error "+url,e);
          throw new Exception(e);
View Full Code Here

          server.setAllowCompression(false);
          server.setMaxRetries(4);
          server.setRequestWriter(new BinaryRequestWriter());
          UpdateRequest req = new UpdateRequest();
          req.add(docs);
          UpdateResponse rsp = req.process(server);
          rtn.put(s, rsp.toString());
          }catch(Throwable e)
          {
            LOG.error("insert error "+url,e);
            throw new Exception(e);          }
View Full Code Here

  public UpdateResponse add(Iterator<SolrInputDocument> docIterator, int commitWithinMs)
          throws SolrServerException, IOException {
    UpdateRequest req = new UpdateRequest();
    req.setDocIterator(docIterator);
    req.setCommitWithin(commitWithinMs);
    return req.process(this);
  }

  /**
   * Adds the beans supplied by the given iterator
   * @param beanIterator  the iterator which returns Beans
View Full Code Here

      public void remove() {
        beanIterator.remove();
      }
    });
    req.setCommitWithin(commitWithinMs);
    return req.process(this);
  }
}
View Full Code Here

   */
  public void add(final SolrInputDocument doc)
  throws SolrServerException, IOException {
    final UpdateRequest request = new UpdateRequest();
    request.add(doc);
    request.process(this.getServer());
  }

  /**
   * Return the number of documents currently indexed.
   */
 
View Full Code Here

      {
        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

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.