lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <iori...@yahoo.com>
Subject UUIDField uniqueKey with default="NEW"
Date Fri, 31 Aug 2012 23:07:30 GMT
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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message