Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-15112

SolrJ DocumentObjectBinder.toSolrInputDocument null handling

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 8.7
    • None
    • SolrJ
    • None

    Description

      Currently the:
      org.apache.solr.client.solrj.beans.DocumentObjectBinder#toSolrInputDocument
      method doesn't handle nulls in java objects very well.

      Even if the field is null in the Java Object, the binder adds the field(with the null value) to the SolrInputDocument.

      This may cause issues down the line, for example using UpdateRequestProcessors such as the UUIDUpdateProcessorFactory (which doesn't check the value of the field, but it just checks if a field is present)

      The proposal here is to make the binder NOT add null fields to the SolrInputDocument.

      Any objection is welcome (took this list of committers from some of the latest contributors to the class):
      noble noble.paul erickerickericksonjpountz

      Attachments

        1. Screenshot 2021-01-27 at 16.07.13.png
          38 kB
          Alessandro Benedetti

        Activity

          People

            Unassigned Unassigned
            abenedetti Alessandro Benedetti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: