[ 
https://issues.apache.org/jira/browse/SOLR-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986581#action_12986581
 ] 

Grant Ingersoll commented on SOLR-445:
--------------------------------------

This patch looks pretty reasonable from the details of the implementation, but 
I don't think it's quite ready for commit yet.

First, we should be able to extend this to all that implement 
ContentStreamLoader (JSONLoader, CSVLoader) if they want it (it doesn't make 
sense for the SolrCell stuff).  

As I see it, we can do this by putting some base functionality into 
ContentStreamLoader which does what is done in this patch.
I think we need two methods, one that handles the immediate error (takes in a 
StringBuilder and the info about the doc that failed) and decides whether to 
abort or buffer the error for later reporting depending on the configuration 
setting.  

I don't think the configuration of the item belongs in the UpdateHandler.  Erik 
H. meant that it goes in the configuration of the /update RequestHandler in the 
config, not the DirectUpdateHandler2, as in 
{code}<requestHandler name="/update" class="solr.XmlUpdateRequestHandler" 
/>{code}

This config could be a request param just like any other (such that one could 
even say they want to override it via a request via the defaults, appends, 
invariants).

Also, I know it is tempting to do so, but please don't reformat the code in the 
patch.  It slows down review significantly.  In general, I try to reformat 
right before committing as do most committers.

> XmlUpdateRequestHandler bad documents mid batch aborts rest of batch
> --------------------------------------------------------------------
>
>                 Key: SOLR-445
>                 URL: https://issues.apache.org/jira/browse/SOLR-445
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.3
>            Reporter: Will Johnson
>            Assignee: Grant Ingersoll
>             Fix For: Next
>
>         Attachments: SOLR-445-3_x.patch, SOLR-445.patch, SOLR-445.patch, 
> SOLR-445.patch, solr-445.xml, SOLR-445_3x.patch
>
>
> Has anyone run into the problem of handling bad documents / failures mid 
> batch.  Ie:
> <add>
>   <doc>
>     <field name="id">1</field>
>   </doc>
>   <doc>
>     <field name="id">2</field>
>     <field name="myDateField">I_AM_A_BAD_DATE</field>
>   </doc>
>   <doc>
>     <field name="id">3</field>
>   </doc>
> </add>
> Right now solr adds the first doc and then aborts.  It would seem like it 
> should either fail the entire batch or log a message/return a code and then 
> continue on to add doc 3.  Option 1 would seem to be much harder to 
> accomplish and possibly require more memory while Option 2 would require more 
> information to come back from the API.  I'm about to dig into this but I 
> thought I'd ask to see if anyone had any suggestions, thoughts or comments.   
>  

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to