You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by gopes <sa...@gmail.com> on 2012/07/27 00:16:20 UTC
UUID generation not working
Hi
1. I am using UUID to generate unique id in my collection but when I tried
to index the collection it could not find any doucmnets. can you please
tell me how to use UUID in schema.xm
Thanks,
Sarala
--
View this message in context: http://lucene.472066.n3.nabble.com/UUID-generation-not-working-tp3997571.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: UUID generation not working
Posted by Chris Hostetter <ho...@fucit.org>.
:
: 1. I am using UUID to generate unique id in my collection but when I tried
: to index the collection it could not find any doucmnets. can you please
: tell me how to use UUID in schema.xm
in general, if you are having a problem achieving a goal, please post what
you've tried and what kinds of errors/behavior yo uare getting instead --
ie: in this case telling us *how* you have already tried "using UUID to
generate unique id" would be helpful.
In Solr 3.x, you can use the UUIDField like so...
<fieldType name="uuid" class="solr.UUIDField" indexed="true" />
...
<field name="id" type="uuid" indexed="true" stored="true" default="NEW"/>
...
<uniqueKey>id</uniqueKey>
...to generate a new UUID for every doc added. But for Solr 4.x some
things have changed, as noted in the "Upgrading" section for Solr
4.0.0-ALPHA...
* Due to low level changes to support SolrCloud, the uniqueKey field can no
longer be populated via <copyField/> or <field default=...> in the
schema.xml. Users wishing to have Solr automatically generate a uniqueKey
value when adding documents should instead use an instance of
solr.UUIDUpdateProcessorFactory in their update processor chain. See
SOLR-2796 for more details.
...
https://issues.apache.org/jira/browse/SOLR-2796
https://issues.apache.org/jira/browse/SOLR-3495
-Hoss