lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1458361 - in /lucene/dev/branches/lucene_solr_4_2: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java solr/solrj/ solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
Date Tue, 19 Mar 2013 15:57:40 GMT
Author: markrmiller
Date: Tue Mar 19 15:57:39 2013
New Revision: 1458361

URL: http://svn.apache.org/r1458361
Log:
SOLR-4297: Atomic update request containing null=true sets all subsequent fields to null

Modified:
    lucene/dev/branches/lucene_solr_4_2/   (props changed)
    lucene/dev/branches/lucene_solr_4_2/solr/   (props changed)
    lucene/dev/branches/lucene_solr_4_2/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/lucene_solr_4_2/solr/core/   (props changed)
    lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java
    lucene/dev/branches/lucene_solr_4_2/solr/solrj/   (props changed)
    lucene/dev/branches/lucene_solr_4_2/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java

Modified: lucene/dev/branches/lucene_solr_4_2/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/CHANGES.txt?rev=1458361&r1=1458360&r2=1458361&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/CHANGES.txt Tue Mar 19 15:57:39 2013
@@ -108,6 +108,9 @@ Bug Fixes
 * SOLR-4609: The Collections API should only send the reload command to ACTIVE 
   cores. (Mark Miller)
 
+* SOLR-4297: Atomic update request containing null=true sets all subsequent
+  fields to null (Ben Pennell, Rob, shalin)
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java?rev=1458361&r1=1458360&r2=1458361&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java
Tue Mar 19 15:57:39 2013
@@ -438,6 +438,7 @@ public class XMLLoader extends ContentSt
           }
           boost = 1.0f;
           update = null;
+          isNull = false;
           String attrVal = "";
           for (int i = 0; i < parser.getAttributeCount(); i++) {
             attrName = parser.getAttributeLocalName(i);

Modified: lucene/dev/branches/lucene_solr_4_2/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_2/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java?rev=1458361&r1=1458360&r2=1458361&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_2/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
(original)
+++ lucene/dev/branches/lucene_solr_4_2/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
Tue Mar 19 15:57:39 2013
@@ -1438,6 +1438,29 @@ abstract public class SolrExampleTests e
     assertNotNull("Entire doc was replaced because null update was not written", response.getResults().get(0).getFieldValue("single_s"));
     assertNull("Null update failed. Value still exists in document", response.getResults().get(0).getFieldValue("multi_ss"));
   }
+
+  public void testSetNullUpdateOrder() throws Exception {
+    SolrServer solrServer = getSolrServer();
+    SolrInputDocument doc = new SolrInputDocument();
+    doc.addField("id", "testSetNullUpdateOrder");
+    doc.addField("single_s", "test-value");
+    doc.addField("multi_ss", Arrays.asList("first", "second"));
+    solrServer.add(doc);
+    solrServer.commit(true, true);
+
+    Map<String, Object> map = Maps.newHashMap();
+    map.put("set", null);
+    doc = new SolrInputDocument();
+    doc.addField("multi_ss", map);
+    doc.addField("id", "testSetNullUpdateOrder");
+    doc.addField("single_s", "test-value2");
+    solrServer.add(doc);
+    solrServer.commit();
+
+    QueryResponse response = solrServer.query(new SolrQuery("id:testSetNullUpdateOrder"));
+    assertEquals("Field included after set null=true not updated via atomic update", "test-value2",
+        response.getResults().get(0).getFieldValue("single_s"));
+  }
   
   @Test
   public void testQueryWithParams() throws SolrServerException {



Mime
View raw message