anu
anu

Reputation: 1007

changing solr id from string to uuid

I am very new to solr.

Initially the "id" in my solr schema was of type string.

I have 30,000 documents, but now I want to use uuid instead of a string.

Simply changing the id to uuid and following instructions from http://wiki.apache.org/solr/UniqueKey

It did not work because it tried to string id as uuid and it failed.

My question is how do i change my id to uuid without deleting any data ?

Any info on this will be helpful.

Upvotes: 1

Views: 1396

Answers (1)

buddy86
buddy86

Reputation: 1454

Hope your id field is be mentioned as uniqueKey in the schema.xml. That means every solr document in your Solr instance must contain the id field. When you modify the type of any field in the schema, the previously created index for those fields get messed up. Now you can't query on those field, though they are still present in your Solr instance.

What good is that if you can not query on the data, you indexed to query? So, there is no good keeping the old document in your Solr, on which you can't query. And this time you have modified the uniqueKey field. So, you must re-index. If you would have modified the type of other field except uniqueKey, then Atomic update or partial update would have been a solution.

Upvotes: 1

Related Questions