9

I am trying to upgrade a Solr 6.2.1 single node instance to a SolrCloud setup using the Solr version 6.6. The issue I am facing is that while performing data import from mongodb using the solr-mongo-importer-1.1.0.jar and mongo-java-driver-2.14.3.jar, the _id field is being imported as "_id":"org.bson.types.ObjectId:585a53d109ed44343743ebd1" instead of "_id":"585a53d109ed44343743ebd1" as in the Solr 6.2.1 instance. (The jars are the same version in both the cases)

The schema contains the following (same in both versions):

<fieldType name="string" class="solr.StrField"sortMissingLast="true"/>
<field name="_id" type="string" indexed="true" stored="true"/>

Is there any change in the fieldType in the new version or am I missing something?

Rajesh
  • 15,724
  • 7
  • 46
  • 95

1 Answers1

0

Solr fields should be declared in schema.xml. It is possible that id is already defined!

Alternatively, Please try setting column attribute with name -

<field column="_id"  name="id"/>               
<field column="OtherNumber" name="OtherNumber" mongoField="OthNumber"/> 

OR

Try using this directive for specifying _id field

<uniqueKey> 

Hope it helps!

nitinr708
  • 1,393
  • 2
  • 19
  • 29