You're trying to use a feature that was removed from trunk/4x by SOLR-2796:
"AddUpdateCommand.getIndexedId doesn't work with schema configured
defaults/copyField - UUIDField/copyField can not be used as uniqueKey
field."
See:
https://issues.apache.org/jira/browse/SOLR-2796
This revision:
http://svn.apache.org/viewvc?view=revision&revision=1345378
Evidently the wiki was not corrected to note that the "feature" was removed.
-- Jack Krupansky
-----Original Message-----
From: Ahmet Arslan
Sent: Friday, August 31, 2012 7:07 PM
To: dev@lucene.apache.org
Subject: UUIDField uniqueKey with default="NEW"
Hi all,
I was following http://wiki.apache.org/solr/UniqueKey#UUID_techniques to
setup uuid as my uniqueKey. (recent solr-trunk)
<fieldType name="uuid" class="solr.UUIDField" indexed="true" />
<field name="uniqueKey" type="uuid" indexed="true" stored="true"
default="NEW" required="true" />
<uniqueKey>uniqueKey</uniqueKey>
I get the following exception.
SEVERE: null:org.apache.solr.common.SolrException: uniqueKey field (null)
can not be configured with a default value (NEW)
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:496)
at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:113)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:851)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:539)
I made this working by adding some if checks to IndexSchema.java and
UpdateCommand.java.
getType().getClass().getName().equals(UUIDField.class.getName()
But I am not sure if this is preferred way. How can I use uuid as my
uniqueKey without source code modification?
Thanks,
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org