2

I am using JSON based Solr schema to create custom indexes in Sitecore V10.2 docker. After rebuilding my custom index, I am getting following error :

Missing uniqueKey id field

Although, when I checked the fields in the custom index collection, id field is already present. If I try to override/create it again, I am getting duplicate field error message.

Can anyone help me out please !!

2 Answers 2

1

You can update the schema from Solr URL. Select the Solr collection and you'll get a option called schema. From there you can update the fields.

enter image description here

You can get more detail from below URL-

https://solr.apache.org/guide/7_0/schema-api.html

0

Please check the managed-schema file within your custom SOLR core.

This can be located for example here on SOLR VM:

E:\solr-8.4.0\server\solr\CUSTOM_CORE_NAME\conf

This file should begin like this:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Solr managed schema - automatically generated - DO NOT EDIT -->
<schema name="default-config" version="1.6">
  <uniqueKey>_uniqueid</uniqueKey>

If it does not start as above, then i suspect that you have not populated mananaged schema. This can be done by navigating to the control panel and clicking the link Populate Managed Schema.

NEXT SUGGESTION: Check your custom core config file. Is index all fields set to true?

< indexAllFields >true</ indexAllFields >

If not then you need to manually add the field.

2
  • My managed-schema file looks like this : ``` <?xml version="1.0" encoding="UTF-8"?> <!-- Solr managed schema - automatically generated - DO NOT EDIT --> <schema name="default-config" version="1.6"> <uniqueKey>id</uniqueKey> ``` I am using Solr in cloud mode & running inside solr-container in docker. So I don't have access to managed-schema file. I don't even have conf folder under my custom core folder. All I have is data folder under which there are 3 folders (index, snapshot_metadata & tlog) & core.properties file which has metadata about the core.
    – Anvay
    Jan 31, 2022 at 13:52
  • Ok. Please see can you share your custom core sitecore config file? See new suggestion in answer below. Jan 31, 2022 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.