lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r1636905 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/CHANGES.txt solr/solrj/ solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java solr/solrj/src/test/org/apache/solr/common/util/TestJsonRecordReader.java
Date Wed, 05 Nov 2014 15:48:35 GMT
Author: noble
Date: Wed Nov  5 15:48:34 2014
New Revision: 1636905

URL: http://svn.apache.org/r1636905
Log:
SOLR-6706

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/CHANGES.txt
    lucene/dev/branches/branch_5x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java
    lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/common/util/TestJsonRecordReader.java

Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1636905&r1=1636904&r2=1636905&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Wed Nov  5 15:48:34 2014
@@ -236,6 +236,9 @@ Bug Fixes
 
 * SOLR-6685: ConcurrentModificationException in Overseer Status API. (shalin)
 
+* SOLR-6706: /update/json/docs throws RuntimeException if a nested structure
+  contains a non-leaf float field (Noble Paul, shalin)
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java?rev=1636905&r1=1636904&r2=1636905&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java
(original)
+++ lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java
Wed Nov  5 15:48:34 2014
@@ -394,6 +394,7 @@ public class JsonRecordReader {
             event = parser.nextEvent();
             if (event == STRING ||
                 event == LONG ||
+                event == NUMBER ||
                 event == BIGNUMBER ||
                 event == BOOLEAN ||
                 event == NULL) {

Modified: lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/common/util/TestJsonRecordReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/common/util/TestJsonRecordReader.java?rev=1636905&r1=1636904&r2=1636905&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/common/util/TestJsonRecordReader.java
(original)
+++ lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/common/util/TestJsonRecordReader.java
Wed Nov  5 15:48:34 2014
@@ -180,7 +180,7 @@ public class TestJsonRecordReader  exten
     records = streamer.getAllRecords(new StringReader(json));
     assertEquals(2, records.size());
     for (Map<String, Object> record : records) {
-      assertEquals(6,record.size());
+      assertEquals(6, record.size());
       assertTrue(record.containsKey("subject"));
       assertTrue(record.containsKey("test"));
       assertTrue(record.containsKey("marks"));
@@ -203,4 +203,24 @@ public class TestJsonRecordReader  exten
 
   }
 
+  public void testNestedJsonWithFloats() throws Exception {
+
+    String json = "{\n" +
+        "        \"a_string\" : \"abc\",\n" +
+        "        \"a_num\" : 2.0,\n" +
+        "        \"a\" : {\n" +
+        "                        \"b\" : [\n" +
+        "                                {\"id\":\"1\", \"title\" : \"test1\"},\n" +
+        "                                {\"id\":\"2\", \"title\" : \"test2\"}\n" +
+        "                        ]\n" +
+        "                }\n" +
+        "}\n";
+
+    JsonRecordReader streamer;
+    List<Map<String, Object>> records;
+
+    streamer = JsonRecordReader.getInst("/a/b", Collections.singletonList("title_s:/a/b/title"));
+    records = streamer.getAllRecords(new StringReader(json));
+    assertEquals(2, records.size());
+  }
 }



Mime
View raw message