Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr 5.1.0: How to set the unique key via Schema API

In Solr 5.1.0, is it possible to set the unique key via the REST schema api?
I created a collection with the data driven schema.
Solr would guess what the field type and create the field based on the data I upload.
I can still define fields beforehand by sending a POST request like
curl -X POST -H 'Content-type:application/json' --data-binary
'{ "add-field":{"name":"ID","type":"strings","stored":true }}' host:port/solr/test/schema

But I wonder if there is a way to define it as the unique key.
Tried to add "uniqueKey":true but it failed

like image 559
Chen Sheng-Lun Avatar asked Jun 15 '15 17:06

Chen Sheng-Lun


1 Answers

No its not possible as of now. Its an open feature request. https://issues.apache.org/jira/browse/SOLR-7242

like image 113
jay Avatar answered Sep 29 '22 18:09

jay