Skip to content

Commit

Permalink
SOLR-3649: fix bug in JavabinLoader that caused deleteById(List<Strin…
Browse files Browse the repository at this point in the history
…g> ids) to not work in SolrJ. merge from trunk (r1372346)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/branch_4x@1372351 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
siren committed Aug 13, 2012
1 parent 9421e4c commit df04d4e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 3 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ Bug Fixes
* SOLR-3725: Fixed package-local-src-tgz target to not bring in unnecessary jars
and binary contents. (Michael Dodsworth via rmuir)

* SOLR-3649: Fixed bug in JavabinLoader that caused deleteById(List<String> ids)
to not work in SolrJ (siren)

================== 4.0.0-BETA ===================


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ private void delete(SolrQueryRequest req, UpdateRequest update, UpdateRequestPro
for (String s : update.getDeleteById()) {
delcmd.id = s;
processor.processDelete(delcmd);
delcmd.clear();
}
delcmd.id = null;
}

if(update.getDeleteQuery() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,16 +711,11 @@ public void testAddDelete() throws Exception
assertNumFound( "*:*", 3 ); // make sure it got in

// should be able to handle multiple delete commands in a single go
StringWriter xml = new StringWriter();
xml.append( "<delete>" );
List<String> ids = new ArrayList<String>();
for( SolrInputDocument d : doc ) {
xml.append( "<id>" );
XML.escapeCharData( (String)d.getField( "id" ).getFirstValue(), xml );
xml.append( "</id>" );
ids.add(d.getFieldValue("id").toString());
}
xml.append( "</delete>" );
DirectXmlRequest up = new DirectXmlRequest( "/update", xml.toString() );
server.request( up );
server.deleteById(ids);
server.commit();
assertNumFound( "*:*", 0 ); // make sure it got out
}
Expand Down

0 comments on commit df04d4e

Please sign in to comment.