-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#139: Fix Failed to Update Child Documents #175
Conversation
@bstst Will this also work for ES 6.x? |
@divyanshu013, I haven't tested it on 6.x. But this fix only appends additional parameters to the update request body when routing is specified as required in the index mapping. If no one else will test this I'll pull a 6.x image some time later and will test it myself. |
@bstst Yes, this would append a It would be awesome if you can check on that - as I feel this is one of things they have made breaking changes to since v5. |
@siddharthlatest, since there is no parent-child mapping in v6 — my changes don't seem to affect the way dejavu works with v6. The way dejavu DOES or DOESN'T work with v6 is another question. That is out of scope of this issue, but there seem to be quite a bit of editing issues in there. I suppose they should be addressed in another issue. |
You are checking for I agree that we should address the parent-child join relationship in ES 6 in a different issue. |
I tried specifying a
I suspect this would fail on ES v5 as well. It would be great if we can add an additional condition to verify if there indeed is a parent-child mapping before applying the
|
@siddharthlatest, could you show me the mapping output of the index? or just a snippet of the data I could test upon? |
@bstst I didn't set a parent-child relationship, neither did I set routing path with the mappings. I only tried to make an index request with a |
@siddharthlatest, exactly — my change will only add parent to the query if it exists in the mapping routing. and since v6 works differently, my change does not affect the way dejavu works with v6. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bstst I am requesting an additional condition to ensure that the parent querystring does get applied only when _parent
object is present within the type's mapping.
live/src/js/table/Cell.js
Outdated
}, 'updateCell', res => this.handleErrorMsg(res)); | ||
}; | ||
|
||
if (this.props._mapping && this.props._mapping._routing && this.props._mapping._routing.required) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bstst Here, we should also add a check for the presence of this.props._mapping._parent
to verify that the document in the type being indexed indeed has a parent mapping.
live/src/js/table/Cell.js
Outdated
}; | ||
|
||
if (_mapping && _mapping._parent && _mapping._routing && _mapping._routing.required) { | ||
data.parent = row[_mapping._routing.path]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bstst I missed this earlier, but it seems ES has completely removed support for adding path
inside _routing
starting v2. See elastic/elasticsearch#6730 (comment).
And also this https://stackoverflow.com/questions/36123647/elasticsearch-routing-on-specific-field.
In which version of ES are you able to set the _routing.path
?
I still want to merge this, so perhaps we can add a check to ensure that _routing.path
is present.
Thank you for contributing @bstst! 🎉 These changes will be out in the next minor release. |
This fix ensures the routing is used properly when updating parent-child related documents.