You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shawn Heisey (JIRA)" <ji...@apache.org> on 2016/03/03 19:52:18 UTC
[jira] [Commented] (SOLR-8770) BinaryRequestWriter interprets null
object in field as literal "NULL" string
[ https://issues.apache.org/jira/browse/SOLR-8770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15178363#comment-15178363 ]
Shawn Heisey commented on SOLR-8770:
------------------------------------
Is there any acceptable reason to allow a null field value in a SolrInputDocument? Specifically I'm wondering if we could throw IllegalArgumentException if a null object is used on methods like addField and setField.
> BinaryRequestWriter interprets null object in field as literal "NULL" string
> ----------------------------------------------------------------------------
>
> Key: SOLR-8770
> URL: https://issues.apache.org/jira/browse/SOLR-8770
> Project: Solr
> Issue Type: Bug
> Components: clients - java
> Affects Versions: 5.5
> Reporter: Shawn Heisey
>
> From what I've been able to determine, if a null object is added with SolrInputDocument#addField, the xml writer does not include that field in the request, but the binary writer sends the literal string "NULL".
> This became apparent when upgrading SolrJ to 5.5, which uses the binary writer by default. Switching back to 5.4.1 fixed it, until I forced the 5.4.1 client to use the binary writer. My source data is MySQL. JDBC is where the null objects are coming from.
> Adding a null check to my doc.addField call has fixed my program with the 5.5 client, but this is likely to catch other upgrading users off guard.
> At the very least, the 5.5.1 CHANGES.txt file needs a note, but I believe the behavior of the binary writer should match the behavior of the xml writer.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org