You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by ry...@apache.org on 2008/07/24 23:17:44 UTC

svn commit: r679548 - in /lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj: SolrServer.java request/UpdateRequest.java

Author: ryan
Date: Thu Jul 24 14:17:43 2008
New Revision: 679548

URL: http://svn.apache.org/viewvc?rev=679548&view=rev
Log:
SOLR-653 -- remove the 'overwrite' options from solrj.  Since we plan to remove these in the future, we should keep them out of the API before its first official release.

Modified:
    lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/SolrServer.java
    lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/request/UpdateRequest.java

Modified: lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/SolrServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/SolrServer.java?rev=679548&r1=679547&r2=679548&view=diff
==============================================================================
--- lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/SolrServer.java (original)
+++ lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/SolrServer.java Thu Jul 24 14:17:43 2008
@@ -42,47 +42,29 @@
 {
   private DocumentObjectBinder binder;
 
-  public UpdateResponse add(Collection<SolrInputDocument> docs, boolean overwrite ) throws SolrServerException, IOException {
+  public UpdateResponse add(Collection<SolrInputDocument> docs ) throws SolrServerException, IOException {
     UpdateRequest req = new UpdateRequest();
     req.add(docs);
-    req.setOverwrite(overwrite);
     return req.process(this);
   }
 
-  public UpdateResponse addBeans(Collection<?> beans, boolean overwrite ) throws SolrServerException, IOException {
+  public UpdateResponse addBeans(Collection<?> beans ) throws SolrServerException, IOException {
     DocumentObjectBinder binder = this.getBinder();
     ArrayList<SolrInputDocument> docs =  new ArrayList<SolrInputDocument>(beans.size());
     for (Object bean : beans) {
       docs.add(binder.toSolrInputDocument(bean));
     }
-    return add(docs,overwrite);
+    return add(docs);
   }
 
-  public UpdateResponse add(SolrInputDocument doc, boolean overwrite ) throws SolrServerException, IOException {
+  public UpdateResponse add(SolrInputDocument doc ) throws SolrServerException, IOException {
     UpdateRequest req = new UpdateRequest();
     req.add(doc);
-    req.setOverwrite(overwrite);
     return req.process(this);
   }
 
-  public UpdateResponse addBean(Object obj, boolean overwrite) throws IOException, SolrServerException {
-    return add(getBinder().toSolrInputDocument(obj), overwrite);
-  }
-
-  public UpdateResponse add(SolrInputDocument doc) throws SolrServerException, IOException {
-    return add(doc, true);
-  }
-
   public UpdateResponse addBean(Object obj) throws IOException, SolrServerException {
-    return add(getBinder().toSolrInputDocument(obj), true);
-  }
-
-  public UpdateResponse add(Collection<SolrInputDocument> docs) throws SolrServerException, IOException {
-    return add(docs, true);
-  }
-
-  public UpdateResponse addBeans(Collection<?> beans ) throws SolrServerException, IOException {
-    return addBeans(beans,true);
+    return add(getBinder().toSolrInputDocument(obj));
   }
 
   /** waitFlush=true and waitSearcher=true to be inline with the defaults for plain HTTP access

Modified: lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/request/UpdateRequest.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/request/UpdateRequest.java?rev=679548&r1=679547&r2=679548&view=diff
==============================================================================
--- lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/request/UpdateRequest.java (original)
+++ lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/request/UpdateRequest.java Thu Jul 24 14:17:43 2008
@@ -30,7 +30,6 @@
 import org.apache.solr.client.solrj.util.ClientUtils;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.params.ModifiableSolrParams;
-import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.params.UpdateParams;
 import org.apache.solr.common.util.ContentStream;
 import org.apache.solr.common.util.XML;
@@ -47,11 +46,6 @@
     OPTIMIZE
   };
   
-
-  private boolean allowDups = false;
-  private boolean overwriteCommitted = true;
-  private boolean overwritePending = true;
-  
   private List<SolrInputDocument> documents = null;
   private List<String> deleteById = null;
   private List<String> deleteQuery = null;
@@ -169,11 +163,7 @@
   public String getXML() throws IOException {
     StringWriter writer = new StringWriter();
     if( documents != null && documents.size() > 0 ) {
-      writer.write("<add ");
-      writer.write("allowDups=\"" + allowDups + "\" ");
-      // TODO: remove these when deprecations are removed
-      writer.write("overwriteCommitted=\"" + overwriteCommitted + "\" ");
-      writer.write("overwritePending=\"" + overwritePending + "\">");
+      writer.write("<add>");
       for (SolrInputDocument doc : documents ) {
         if( doc != null ) {
           ClientUtils.writeXML( doc, writer );
@@ -227,17 +217,6 @@
     res.setElapsedTime( System.currentTimeMillis()-startTime );
     return res;
   }
-
-  //--------------------------------------------------------------------------
-  // 
-  //--------------------------------------------------------------------------
-
-  public void setOverwrite( boolean v )
-  {
-    allowDups = !v;
-    overwriteCommitted = v;
-    overwritePending = v;
-  }
   
   //--------------------------------------------------------------------------
   // 
@@ -258,44 +237,6 @@
     return null;
   }
 
-  public boolean isAllowDups() {
-    return allowDups;
-  }
-
-  /**
-   * Use setOverwrite()
-   */
-  @Deprecated
-  public void setAllowDups(boolean allowDups) {
-    this.allowDups = allowDups;
-  }
-
-  @Deprecated
-  public boolean isOverwriteCommitted() {
-    return overwriteCommitted;
-  }
-
-  /**
-   * Use setOverwrite()
-   */
-  @Deprecated
-  public void setOverwriteCommitted(boolean overwriteCommitted) {
-    this.overwriteCommitted = overwriteCommitted;
-  }
-
-  @Deprecated
-  public boolean isOverwritePending() {
-    return overwritePending;
-  }
-
-  /**
-   * Use setOverwrite()
-   */
-  @Deprecated
-  public void setOverwritePending(boolean overwritePending) {
-    this.overwritePending = overwritePending;
-  }
-
   public void setWaitFlush(boolean waitFlush) {
     setParam( UpdateParams.WAIT_FLUSH, waitFlush+"" );
   }