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

Nick Shanin commented on SOLR-9230:
-----------------------------------

>From code reading against apache/main b73f03976fa, `BigDecimal` falls back to 
>the reflect writer, which outputs the class name and value 
>(solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java:280; 
>solr/solrj/src/java/org/apache/solr/common/util/Utils.java:795). A candidate 
>is to write `BigDecimal` and `BigInteger` as their text, as before 6.0. Is 
>that still wanted?

🤖 AI-generated 🤖

> Change of default to BinaryRequestWriter breaks some use cases
> --------------------------------------------------------------
>
>                 Key: SOLR-9230
>                 URL: https://issues.apache.org/jira/browse/SOLR-9230
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 6.0
>            Reporter: Eirik Lygre
>            Priority: Major
>
> From Solr 6.0 onwards, SOLR-8595 changes the default writer in HttpSolrClient 
> (et al) from RequestWriter to BinaryRequestWriter.
> The RequestWriter writes java.math.BigDecimal values using a simple 
> toString() on the value. This means that a BigDecimal-value is passed to the 
> server using its text representation, which is then mapped into whatever the 
> server wants. (The RequestWriter probably uses toString() on anything it sees)
> The BinaryRequestWriter instead handles unknown value types by writing a 
> string containing the class name, a colon, and then the toString() value. 
> This means that a BigDecimal-value is passed to the server as a text 
> representation "java.math.BigDecimal:12345", which the server cannot convert 
> to a number, and which then stops indexing.
> I'm not entirely sure that this behaviour is a bug, but I'm fairly sure that 
> the quiet change of behaviour qualifies. The "Trivial Patch" (quote from 
> SOLR-8595) isn't, when straight forward indexing scenarios quietly stop 
> working.
> There are several possible paths forward:
> * Have the BinaryRequestWriter (really the JavaBinCodec) encode 
> java.lang.Numbers as Strings, the way the RequestWriter does
> * Add something in release notes to inform users about the change
> SOLR-4021 describes the problem, but the change of default writer increases 
> problem visibility. SOLR-6165 somehow seems relevant. 



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to