SOLR-1570 -- Log warnings if uniqueKey is multi-valued or not stored

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@884263 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2009-11-25 20:47:54 +00:00
parent 4afe02ed8e
commit 4b5e8cc326
2 changed files with 8 additions and 0 deletions

View File

@ -106,6 +106,8 @@ Other Changes
* 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
----------------------

View File

@ -600,6 +600,12 @@ public final class IndexSchema {
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);