diff --git a/CHANGES.txt b/CHANGES.txt index 76127725617..68b1e35ae09 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -189,7 +189,8 @@ New Features 37. SOLR-418: Adding a query elevation component. This is an optional component to elevate some documents to the top positions (or exclude them) for a given query. (ryan) - + +38. SOLR-478: Added ability to get back unique key information from the LukeRequestHandler. (gsingers) Changes in runtime behavior diff --git a/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java b/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java index 51052bd1e98..a73d2fa115b 100644 --- a/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java +++ b/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java @@ -341,6 +341,7 @@ public class LukeRequestHandler extends RequestHandlerBase { Map> typeusemap = new HashMap>(); SimpleOrderedMap fields = new SimpleOrderedMap(); + SchemaField uniqueField = schema.getUniqueKeyField(); for( SchemaField f : schema.getFields().values() ) { FieldType ft = f.getType(); SimpleOrderedMap field = new SimpleOrderedMap(); @@ -352,6 +353,9 @@ public class LukeRequestHandler extends RequestHandlerBase if( f.getDefaultValue() != null ) { field.add( "default", f.getDefaultValue() ); } + if (f == uniqueField){ + field.add("uniqueKey", true); + } fields.add( f.getName(), field ); List v = typeusemap.get( ft.getTypeName() ); @@ -374,6 +378,7 @@ public class LukeRequestHandler extends RequestHandlerBase SimpleOrderedMap finfo = new SimpleOrderedMap(); finfo.add("fields", fields); + finfo.add("uniqueKeyField", uniqueField.getName()); finfo.add("types", types); return finfo; }