[ 
https://issues.apache.org/jira/browse/SOLR-20?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12499730
 ] 

Ben Incani commented on SOLR-20:
--------------------------------

The SolrClientImpl does not implement the following optional attributes for 
"add" as documented in http://wiki.apache.org/solr/UpdateXmlMessages

  allowDups = "true" | "false" — default is "false" 
  overwritePending = "true" | "false" — default is negation of allowDups 
  overwriteCommitted = "true"|"false" — default is negation of allowDups 

Attached is patch for SolrClientImpl.java which implements allowDups.

*** SolrClientImpl.java.patch ***
48a49,55
>       
>       /**
>        * Optional attributes for "add"
>        */
>       protected boolean allowDups;
>       protected boolean overwritePending;    // TODO: not implemented
>       protected boolean overwriteCommitted;  // TODO: not implemented
86a94,97
>       public SolrClientImpl(URL baseURL) throws Exception {
>          this(baseURL, false);
>     }
> 
91a103
>        * @param allowDups allow duplicates to be added to the index
95c107
<       public SolrClientImpl(URL baseURL) throws Exception 
---
>       public SolrClientImpl(URL baseURL, boolean allowDups) throws Exception 
103c115
<               
---
>         this.allowDups = allowDups;
243c255,260
<                               writer.write("<add>");
---
>                           StringBuffer strAdd = new StringBuffer("<add ");
>                           if (allowDups == true) {
>                                strAdd.append("allowDups=\"true\"");
>                           }
>                           strAdd.append(">");
>                               writer.write(strAdd.toString());
*** SolrClientImpl.java.patch ***


> A simple Java client for updating and searching
> -----------------------------------------------
>
>                 Key: SOLR-20
>                 URL: https://issues.apache.org/jira/browse/SOLR-20
>             Project: Solr
>          Issue Type: New Feature
>          Components: clients - java
>         Environment: all
>            Reporter: Darren Erik Vengroff
>            Priority: Minor
>         Attachments: DocumentManagerClient.java, DocumentManagerClient.java, 
> solr-client-java-2.zip.zip, solr-client-java.zip, solr-client-sources.jar, 
> solr-client.zip, solr-client.zip, solr-client.zip, 
> solrclient_addqueryfacet.zip, SolrClientException.java, 
> SolrServerException.java
>
>
> I wrote a simple little client class that can connect to a Solr server and 
> issue add, delete, commit and optimize commands using Java methods.  I'm 
> posting here for review and comments as suggested by Yonik.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to