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 sh...@apache.org on 2009/11/25 21:47:54 UTC

svn commit: r884263 - in /lucene/solr/trunk: CHANGES.txt src/java/org/apache/solr/schema/IndexSchema.java

Author: shalin
Date: Wed Nov 25 20:47:54 2009
New Revision: 884263

URL: http://svn.apache.org/viewvc?rev=884263&view=rev
Log:
SOLR-1570 -- Log warnings if uniqueKey is multi-valued or not stored

Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/src/java/org/apache/solr/schema/IndexSchema.java

Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=884263&r1=884262&r2=884263&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Wed Nov 25 20:47:54 2009
@@ -106,6 +106,8 @@
 
 * SOLR-1561: Added Lucene 2.9.1 spatial contrib jar to lib. (gsingers)
 
+* SOLR-1570: Log warnings if uniqueKey is multi-valued or not stored (hossman, shalin) 
+
 Build
 ----------------------
 

Modified: lucene/solr/trunk/src/java/org/apache/solr/schema/IndexSchema.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/schema/IndexSchema.java?rev=884263&r1=884262&r2=884263&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/schema/IndexSchema.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/schema/IndexSchema.java Wed Nov 25 20:47:54 2009
@@ -600,6 +600,12 @@
       log.warn("no uniqueKey specified in schema.");
     } else {
       uniqueKeyField=getIndexedField(node.getNodeValue().trim());
+      if (!uniqueKeyField.stored()) {
+        log.error("uniqueKey is not stored - distributed search will not work");
+      }
+      if (uniqueKeyField.multiValued()) {
+        log.error("uniqueKey should not be multivalued");
+      }
       uniqueKeyFieldName=uniqueKeyField.getName();
       uniqueKeyFieldType=uniqueKeyField.getType();
       log.info("unique key field: "+uniqueKeyFieldName);