How to set multiple fields as uniqueKey in solr? -
i have these fields in solr schema :
<fields> <field name="id" type="string" indexed="true" stored="true" multivalued="false" required="true" /> <field name="idcategory" type="string" indexed="true" stored="true" multivalued="false" required="true" /> <field name="rank" type="long" indexed="true" stored="true" multivalued="false" required="true" /> <field name="typerank" type="string" indexed="true" stored="true" multivalued="false" required="false" default="category" /> <field name="_version_" type="long" indexed="true" stored="true"/> </fields>
can use 2 or 3 fields uniquekeys instead of one? when try :
<uniquekey>(id,idcategory,rank,typerank)</uniquekey>
i following error :
org.apache.solr.common.solrexception:org.apache.solr.common.solrexception: schema parsing failed: unknown field '(id,idcategory,rank,typerank)'. schema file /var/solr/rank/schema.xml
you cannot use 2 or 3 (or 4) fields in unique key in way trying it. should point single string field. should able use generate concatenated field of values want single unique string before indexing.
Comments
Post a Comment