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

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1372346 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sami Siren 2012-08-13 09:56:33 +00:00
parent d72080551a
commit 1d27c0364b
3 changed files with 7 additions and 9 deletions

View File

@ -51,6 +51,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 ===================

View File

@ -122,8 +122,8 @@ public class JavabinLoader extends ContentStreamLoader {
for (String s : update.getDeleteById()) {
delcmd.id = s;
processor.processDelete(delcmd);
delcmd.clear();
}
delcmd.id = null;
}
if(update.getDeleteQuery() != null) {

View File

@ -711,16 +711,11 @@ abstract public class SolrExampleTests extends SolrJettyTestBase
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
}