Examples of UpdateRequest


Examples of org.apache.muse.ws.resource.properties.set.impl.UpdateRequest

        {
            Object[] filler = { qname };
            throw new UnableToModifyResourcePropertyFault(_MESSAGES.get("PropertyNotFound", filler));
        }
       
        UpdateRequest request = new UpdateRequest(qname, values);
        Element[] valuesXML = request.getValues();
       
        //
        // make sure the update is valid according to the SCHEMA - this
        // test assumes we will remove all current values and insert
        // new ones
View Full Code Here

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

            updateRequest.process(solrServer);

        } 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()) {
                if (entry.getKey().startsWith(SolrConstants.FIELD)) {
                    hasSolrHeaders = true;
                    break;
                }
            }

            if (hasSolrHeaders) {

                UpdateRequest updateRequest = new UpdateRequest(getRequestHandler());

                SolrInputDocument doc = new SolrInputDocument();
                for (Map.Entry<String, Object> entry : exchange.getIn().getHeaders().entrySet()) {
                    if (entry.getKey().startsWith(SolrConstants.FIELD)) {
                        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

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

    };
  }

  private void parseAndLoadDocs(SolrQueryRequest req, SolrQueryResponse rsp, InputStream stream,
                                final UpdateRequestProcessor processor) throws IOException {
    UpdateRequest update = null;
    update = new JavaBinUpdateRequestCodec().unmarshal(stream,
            new JavaBinUpdateRequestCodec.StreamingDocumentHandler() {
              private AddUpdateCommand addCmd = null;

              public void document(SolrInputDocument document, UpdateRequest updateRequest) {
                if (addCmd == null) {
                  addCmd = getAddCommand(updateRequest.getParams());
                }
                addCmd.solrDoc = document;
                try {
                  processor.processAdd(addCmd);
                  addCmd.clear();
                } catch (IOException e) {
                  throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "ERROR adding document " + document);
                }
              }
            });
    if (update.getDeleteById() != null) {
      delete(update.getDeleteById(), processor, true);
    }
    if (update.getDeleteQuery() != null) {
      delete(update.getDeleteQuery(), processor, false);
    }

  }
View Full Code Here

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

   * @throws SolrServerException
   * @throws IOException
   * @since solr 3.5
   */
  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);
  }
View Full Code Here

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

   * @throws SolrServerException
   * @throws IOException
   * @since solr 3.5
   */
  public UpdateResponse add(SolrInputDocument doc, int commitWithinMs) throws SolrServerException, IOException {
    UpdateRequest req = new UpdateRequest();
    req.add(doc);
    req.setCommitWithin(commitWithinMs);
    return req.process(this);
  }
View Full Code Here

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

   * @param waitSearcher  block until a new searcher is opened and registered as the main query searcher, making the changes visible
   * @throws SolrServerException
   * @throws IOException
   */
  public UpdateResponse commit( boolean waitFlush, boolean waitSearcher ) throws SolrServerException, IOException {
    return new UpdateRequest().setAction( UpdateRequest.ACTION.COMMIT, waitFlush, waitSearcher ).process( this );
  }
View Full Code Here

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

   * @param maxSegments  optimizes down to at most this number of segments
   * @throws SolrServerException
   * @throws IOException
   */
  public UpdateResponse optimize(boolean waitFlush, boolean waitSearcher, int maxSegments ) throws SolrServerException, IOException {
    return new UpdateRequest().setAction( UpdateRequest.ACTION.OPTIMIZE, waitFlush, waitSearcher, maxSegments ).process( this );
  }
View Full Code Here

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

   * a commit etc.
   * @throws SolrServerException
   * @throws IOException
   */
  public UpdateResponse rollback() throws SolrServerException, IOException {
    return new UpdateRequest().rollback().process( this );
  }
View Full Code Here

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

   * @param id  the ID of the document to delete
   * @throws SolrServerException
   * @throws IOException
   */
  public UpdateResponse deleteById(String id) throws SolrServerException, IOException {
    return new UpdateRequest().deleteById( id ).process( this );
  }
View Full Code Here

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

   * @param ids  the list of document IDs to delete
   * @throws SolrServerException
   * @throws IOException
   */
  public UpdateResponse deleteById(List<String> ids) throws SolrServerException, IOException {
    return new UpdateRequest().deleteById( ids ).process( this );
  }
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.