Thanks Shawn, it worked.

However, I am getting the message - *The solrconfig.xml file for this index
does not have an operational DataImportHandler defined!*

The following lines are inserted in the solrconfig.xml

  <lib dir="${solr.install.dir:../../../..}/dist/"
regex="solr-dataimporthandler-.*\.jar" />
  <lib dir="${solr.install.dir:../../../..}/dist/"
regex="solr-dataimporthandler-extras-\d.*\.jar" />
  <lib
dir="${solr.install.dir:../../../..}/contrib/dataimporthandler-extras/lib"
regex=".*\.jar" />
  <lib dir="${solr.install.dir:../../../..}/server/lib/"
regex="mysql-connector-java-8.0.20.jar" />


  <requestHandler name="/dataimport" class="solr.DataImportHandler">
    <lst name="defaults">
      <str name="config">db-data-config.xml</str>
    </lst>
  </requestHandler>

On Fri, 18 Sep 2020 at 15:20, Shawn Heisey <apa...@elyograg.org> wrote:

> On 9/18/2020 1:27 AM, Anuj Bhargava wrote:
> > In managed schema, I have <field name="id" type="string" indexed="true"
> > stored="true" required="false" multiValued="false" />
> >
> > Still getting the following error-
> >
> > org.apache.solr.common.SolrException: Document is missing mandatory
> > uniqueKey field: id
>
> The problem is that the document that has been fetched with DIH does NOT
> have a field named id.  Because your schema has named the id field as
> uniqueKey, that field is required -- it *must* exist in any document
> that is indexed.
>
> Your DIH config suggests that the database has a field named posting_id
> ... perhaps your Solr schema should use that field as the uniqueKey
> instead?
>
> Thanks,
> Shawn
>

Reply via email to