diff --git a/CHANGES.txt b/CHANGES.txt index d2015f48a06..ed17345139e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -68,5 +68,6 @@ Other Changes http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?view=markup&pathrev=416224 2. Modified admin styles to improve display in Internet Explorer (Greg Ludington via billa, SOLR-6) 3. Upgrade to Lucene 2.0 nightly build 2006-07-15, lucene SVN revision 422302, + 4. Included unique key field name/value (if available) in log message of add (billa, SOLR-18) 2006/01/17 Solr open sourced, moves to Apache Incubator diff --git a/src/java/org/apache/solr/core/SolrCore.java b/src/java/org/apache/solr/core/SolrCore.java index ba49d2fa1b1..30720ab874c 100644 --- a/src/java/org/apache/solr/core/SolrCore.java +++ b/src/java/org/apache/solr/core/SolrCore.java @@ -28,6 +28,7 @@ import org.apache.solr.request.SolrQueryRequest; import org.apache.solr.request.SolrQueryResponse; import org.apache.solr.request.XMLResponseWriter; import org.apache.solr.schema.IndexSchema; +import org.apache.solr.schema.SchemaField; import org.apache.solr.search.SolrIndexSearcher; import org.apache.solr.update.*; import org.apache.solr.util.DOMUtil; @@ -693,7 +694,14 @@ public final class SolrCore { cmd.doc = builder.getDoc(); log.finest("adding doc..."); updateHandler.addDoc(cmd); - log.info("add "+status+" "+(System.currentTimeMillis()-startTime)); + SchemaField uniqueKeyField = schema.getUniqueKeyField(); + StringBuilder addMsg = new StringBuilder("add "); + if (uniqueKeyField!=null) addMsg.append("(") + .append(uniqueKeyField.getName()) + .append("=") + .append(schema.printableUniqueKey(cmd.doc)) + .append(") "); + log.info(addMsg.toString()+status+" "+(System.currentTimeMillis()-startTime)); writer.write(""); } catch (SolrException e) { log(e);