Skip to content

Index fails if field used for _parent in the script is ObjectId #85

@mzafer

Description

@mzafer

Getting the below error if the _parent field used in river script is an objectid.

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object 517749830364f0329c6c386f of class org.bson.types.ObjectId where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.
[2013-06-05 23:03:49,885][WARN ][org.elasticsearch.river.mongodb.MongoDBRiver$Indexer] failed to execute bulk
org.elasticsearch.action.RoutingMissingException: routing is required for [authors]/[book]/[51774a210364f0329c6c387a]

In the extractParent (https://github.com/richardwilly98/elasticsearch-river-mongodb/blob/master/src/main/java/org/elasticsearch/river/mongodb/MongoDBRiver.java#L830 ) we'll have to check if the field is objectId, if so then it needs to be converted to string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions