You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jb...@apache.org on 2021/01/12 17:27:15 UTC

[lucene-solr] 03/03: SOLR-14608: Fix bug when writing null string fields

This is an automated email from the ASF dual-hosted git repository.

jbernste pushed a commit to branch jira/SOLR-14608-export-merge
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit a4c80699bd12d33feb43418e3e47e622848474e0
Author: Joel Bernstein <jb...@apache.org>
AuthorDate: Tue Jan 12 12:24:18 2021 -0500

    SOLR-14608: Fix bug when writing null string fields
---
 .../src/java/org/apache/solr/handler/export/StringFieldWriter.java   | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/solr/core/src/java/org/apache/solr/handler/export/StringFieldWriter.java b/solr/core/src/java/org/apache/solr/handler/export/StringFieldWriter.java
index 5d43803..5ca80af 100644
--- a/solr/core/src/java/org/apache/solr/handler/export/StringFieldWriter.java
+++ b/solr/core/src/java/org/apache/solr/handler/export/StringFieldWriter.java
@@ -65,6 +65,11 @@ class StringFieldWriter extends FieldWriter {
         When we have long runs of repeated values do to the sort order of the docs this is a huge win.
        */
 
+      if(stringValue.currentOrd == -1) {
+        //Null sort value
+        return false;
+      }
+
       if (this.lastOrd == stringValue.currentOrd) {
         ref = lastRef;
       }