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

Noble Paul commented on SOLR-840:
---------------------------------

Thanks Ian
So the problem is with the int field storing an empty string and it tries to 
convert that into an int. All other response writers write it down as String 
and never attempts to convert it to an int.

I am wondering whether the fix must go into BinaryResponseWriter or  IntField. 
For the time being the fix you have is good

it can be bettered 
{code}
try { val = useFieldObjects ? ft.toObject(f) : ft.toExternal(f); } catch 
(Exception e) {continue; }
{code}

Let us wait for the masters of Lucene to say what is the ideal fix? 

> BinaryResponseWriter does not handle nulls with shards as it does locally
> -------------------------------------------------------------------------
>
>                 Key: SOLR-840
>                 URL: https://issues.apache.org/jira/browse/SOLR-840
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 1.3
>         Environment: All
>            Reporter: ian connor
>             Fix For: 1.3.1
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> When you query a number field
> locally, it can return null. However, when you go through a shard if
> you have an empty number it throws an error. 
> I found wrapping the BinaryResponseWrite with a try/catch solved the
> problem and allows null values to be returned.
> BinaryResponseWriter.java:141
>         try {
>           val = useFieldObjects ? ft.toObject(f) : ft.toExternal(f);
>         } catch (NumberFormatException e) {
>         val = null;
>         }
> It seems only the BinaryResponseWriter is actually that fussy about
> null items. Once it comes back to the client for display, it is
> handled without error. 
> Hoss suggested this should be fixed for 1.3 but now that it has shipped I 
> have marked it as 1.3.1 (
> See: 
> http://www.nabble.com/best-way-to-debug-shard-format-errors-td19087854.html)

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