-
Notifications
You must be signed in to change notification settings - Fork 215
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
Add children attribute feature + Groovy test case (RiverMongoChildrenTes... #106
Conversation
Richard Louapre » elasticsearch-river-mongodb #46 UNSTABLE |
Richard Louapre » elasticsearch-river-mongodb #47 SUCCESS |
Richard Louapre » elasticsearch-river-mongodb #48 FAILURE |
Richard Louapre » elasticsearch-river-mongodb #49 UNSTABLE |
@pablomolnar I believe this type of data transformation should probably not be available in the river but provided by script filter [1](there is actually a Groovy script filter available). But unfortunately the data object model provided to the script filter does not allow yet to return multiple documents.
So in your specific scenario:
After the script is executed context would be transformed in:
This changes would work for your scenario and other similar scenario where data transformation is required. What do you think? [1] - https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki#script-filters |
@pablomolnar I have just created w new branch [1] which contains the new implementation. It passes you Groovy unit test [2]. I feel it is more generic. It requires 2 new settings
Let me know what you think. [1] - https://github.com/richardwilly98/elasticsearch-river-mongodb/tree/advanced-transformation |
@richardwilly98 Cool, I'm gonna take a look and let you know. |
@pablomolnar did you have a chance to look at it? |
Hi Richard. Could you please provide an example how to river parent/child relationships. Spent whole day and have not succeeded. Thanks in advance. |
Issues #64 and #85 are related to parent / child. Please have a look. [1] - https://github.com/richardwilly98/elasticsearch-river-mongodb/tree/master/resources/issues/64 Thanks, |
@richardwilly98, |
@richardwilly98 |
@vglafirov thanks for reporting this issue. That should be fixed in the last commit [1] [1] - 2972e6b |
<groupId>org.codehaus.groovy</groupId> | ||
<artifactId>groovy-all</artifactId> | ||
<version>2.1.0</version> | ||
<scope>test</scope> |
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.
looks like the spacing is screwed up on this line (and below)
just changed the directory layout for the tests (93b91fb), so you may want to update this changeset |
Hi Richard, I've implemented a new feature in the river to allow index an array of a mongodb document. Each element of the array will be indexed as a single document in elasticseach.
E.g.: At my work we have a purchase order composed by many items:
Order.json
Due some business requirements we need and index of all order items. This now is possible creating a river with the children attribute.
Have a look to the RiverMongoChildrenTest to see more details and spec. I wrote the test cases using Groovy and GMongo (way cleaner and less code than using Java).