On 8/13/2018 8:56 AM, Wendy2 wrote:
Hi Solr users:I encountered the following error when indexing MongoDB data by
using Solr DataImportHandler:org.apache.solr.common.SolrException:
TransactionLog doesn't know how to serialize class org.bson.types.ObjectId;
try implementing ObjectResolver?

The basic problem is that the JDBC driver for MongoDB is returning this java object type for one of your fields:

org.bson.types.ObjectId

Solr has absolutely no idea what to do with that object, so it's complaining about it instead of silent;u failing to handle the field.  Your DIH config probably includes SQL statements.  You might be able to modify the SELECT to return a type that Solr *does* know how to handle.  You would need to discuss that with somebody who knows MongoDB's JDBC driver inside and out.

Your follow-up message indicates that you may have modified some source code to handle that object type, which would be the other solution I can think of.  You didn't indicate what code you were changing.  If you're satisfied with your solution, awesome.

Thanks,
Shawn

Reply via email to