@@ -289,6 +289,38 @@ public void testSparseShards() throws Exception {
289289 }
290290 }
291291
292+ @ Test
293+ @ SuppressWarnings ("unchecked" )
294+ public void testDistribShowSchema () throws Exception {
295+ ModifiableSolrParams params = new ModifiableSolrParams ();
296+ params .set ("distrib" , "true" );
297+ params .set ("show" , "schema" );
298+
299+ LukeResponse rsp = requestLuke (COLLECTION , params );
300+
301+ NamedList <Object > raw = rsp .getResponse ();
302+ NamedList <Object > schema = (NamedList <Object >) raw .get ("schema" );
303+ assertNotNull ("schema section should be present" , schema );
304+
305+ NamedList <Object > fields = (NamedList <Object >) schema .get ("fields" );
306+ assertNotNull ("schema fields should be present" , fields );
307+ assertNotNull ("'id' should be in schema fields" , fields .get ("id" ));
308+ assertNotNull ("'name' should be in schema fields" , fields .get ("name" ));
309+
310+ assertNotNull ("dynamicFields should be present" , schema .get ("dynamicFields" ));
311+ assertNotNull ("uniqueKeyField should be present" , schema .get ("uniqueKeyField" ));
312+ assertEquals ("uniqueKeyField should be 'id'" , "id" , schema .get ("uniqueKeyField" ));
313+ assertNotNull ("types should be present" , schema .get ("types" ));
314+ assertNotNull ("similarity should be present" , schema .get ("similarity" ));
315+
316+ // show=schema should not produce merged top-level fields (matches local mode behavior)
317+ assertNull ("top-level fields should not be present with show=schema" , raw .get ("fields" ));
318+
319+ // Shards are present for consistency: each shard entry mirrors the per-shard index info,
320+ // just as the top-level index section is present in local mode with show=schema
321+ assertNotNull ("shards should still be present with show=schema" , raw .get ("shards" ));
322+ }
323+
292324 @ Test
293325 public void testDistribTrueOnSingleShardFallsBackToLocal () throws Exception {
294326 String singleShardCollection = "lukeSingleShard" ;
0 commit comments