protected abstract SolrServer getSolrCore(String name);
public void testMultiCore() throws Exception
{
UpdateRequest up = new UpdateRequest();
up.setAction( ACTION.COMMIT, true, true );
up.deleteByQuery( "*:*" );
up.process( getSolrCore0() );
up.process( getSolrCore1() );
up.clear();
// Add something to each core
SolrInputDocument doc = new SolrInputDocument();
doc.setField( "id", "AAA" );
doc.setField( "core0", "yup" );
// Add to core0
up.add( doc );
up.process( getSolrCore0() );
// You can't add it to core1
try {
ignoreException("unknown field");
up.process( getSolrCore1() );
fail( "Can't add core0 field to core1!" );
}
catch( Exception ex ) {}
resetExceptionIgnores();
// Add to core1
doc.setField( "id", "BBB" );
doc.setField( "core1", "yup" );
doc.removeField( "core0" );
up.add( doc );
up.process( getSolrCore1() );
// You can't add it to core1
try {
ignoreException("unknown field");
up.process( getSolrCore0() );
fail( "Can't add core1 field to core0!" );
}
catch( Exception ex ) {}
resetExceptionIgnores();