On Fri, Jan 13, 2012 at 4:04 PM, Ken Krugler
<kkrugler_li...@transpac.com> wrote:
> I finally got around to looking at why short field values are returned as 
> "java.lang.Short:<value>".
>
> Both XMLWriter.writeVal() and TextResponseWriter.writeVal() are missing the 
> check for (val instanceof Short), and thus this bit of code is used:
>
>      // default... for debugging only
>      writeStr(name, val.getClass().getName() + ':' + val.toString(), true);
>
> The same thing happens when you have a binary field, since val in that case 
> is byte[], so you get "[B:[B@<address of byte array>"
>
> Has anybody else run into this? Seems odd that it's not a known issue, so I'm 
> wondering if there's something odd about my schema.
>
> This is especially true since BinaryField has write methods for both XML and 
> JSON (via TextResponseWriter) that handle Base64-encoding the data. So I'm 
> wondering how normally the BinaryField.write() methods would get used, and 
> whether the actual problem lies elsewhere.

Hmmm, Ryan recently restructured some of the writer code to support
the pseudo-field feature.  A quick look at the code seems like
FieldType.write() methods are not used anymore (the Document is
transformed into a SolrDocument and writeVal is used for each value).

Guess this highlights deficiencies in our tests as well surrounding
short, byte and binary.

Could you open an issue for this?

-Yonik
http://www.lucidimagination.com

Reply via email to