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?Is there any fix or workaround for this
issue? I am using solr 7.3.1 and mongoDB 3.6.5.   =======Here is the source
code===========https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/update/TransactionLog.java//
write a BytesRef as a byte array  static final JavaBinCodec.ObjectResolver
resolver = new JavaBinCodec.ObjectResolver() {    @Override    public Object
resolve(Object o, JavaBinCodec codec) throws IOException {      if (o
instanceof BytesRef) {        BytesRef br = (BytesRef)o;       
codec.writeByteArray(br.bytes, br.offset, br.length);        return null;     
}      // Fallback: we have no idea how to serialize this.  Be noisy to
prevent insidious bugs      throw new
SolrException(SolrException.ErrorCode.SERVER_ERROR,          "TransactionLog
doesn't know how to serialize " + o.getClass() + "; try implementing
ObjectResolver?");    }  };



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Reply via email to