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

Lance Norskog commented on SOLR-842:
------------------------------------

Wow!

I just found another case for loop control: receiving no documents in a loop.

My test case is that to fetch subsequent pages of results (first 40, next 40, 
etc.) from a search API I could not use any value returned in the last request. 
I had to make an XML file giving the "start 0, start 40, start 80" sequence. I 
drove an RSS feed input with this as an outer loop.

Now, suppose I have 100 requests in the file but this particular search only 
has 20 results. The second time I do the search I get no documents: now I want 
to break out of my driving XML file loop. With the current DIH i will send 
another 98 search requests that will all fail.

So, two features here:
1) to skip when there are no documents.
2) to end the next outer loop.

"break to entity X" would be the most flexible - you could break out three 
loops if you want. This is the same as "break to label" in Java or C.

Thanks for your time,

Lance (the instigator)

> Better error handling for DIH
> -----------------------------
>
>                 Key: SOLR-842
>                 URL: https://issues.apache.org/jira/browse/SOLR-842
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>            Reporter: Noble Paul
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.4
>
>         Attachments: SOLR-842.patch, SOLR-842.patch, SOLR-842.patch, 
> SOLR-842.patch
>
>
> Currently DIH fails completely on any error. We must have better control on 
> error behavior
> mail thread: http://markmail.org/message/xvfbfaskfmlj2pnm
> an entity can have an attribute {{onError}} the values can be {{abort, 
> continue,skip}}
> abort is the default . It aborts the import. continue or skip does not fail 
> the import it continues from there. skip skips all rows in an xml (only if 
> stream != true)if there is an error in xml but continues with the next xml. 

-- 
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