You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by bi...@apache.org on 2006/07/18 14:53:59 UTC

svn commit: r423076 - in /incubator/solr/trunk: CHANGES.txt src/java/org/apache/solr/core/SolrCore.java

Author: billa
Date: Tue Jul 18 05:53:58 2006
New Revision: 423076

URL: http://svn.apache.org/viewvc?rev=423076&view=rev
Log:
Included unique key field name/value (if available) in log message of add: SOLR-18)

Modified:
    incubator/solr/trunk/CHANGES.txt
    incubator/solr/trunk/src/java/org/apache/solr/core/SolrCore.java

Modified: incubator/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/CHANGES.txt?rev=423076&r1=423075&r2=423076&view=diff
==============================================================================
--- incubator/solr/trunk/CHANGES.txt (original)
+++ incubator/solr/trunk/CHANGES.txt Tue Jul 18 05:53:58 2006
@@ -68,5 +68,6 @@
     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

Modified: incubator/solr/trunk/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/java/org/apache/solr/core/SolrCore.java?rev=423076&r1=423075&r2=423076&view=diff
==============================================================================
--- incubator/solr/trunk/src/java/org/apache/solr/core/SolrCore.java (original)
+++ incubator/solr/trunk/src/java/org/apache/solr/core/SolrCore.java Tue Jul 18 05:53:58 2006
@@ -28,6 +28,7 @@
 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 @@
             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("<result status=\"" + status + "\"></result>");
           } catch (SolrException e) {
             log(e);