-
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
Using Native Searchscript for River import #114
Comments
@MeiSign the river has not been tested with Nativescript yet. |
Here are my riversettings. Native script support in future would be awesome. :)
|
The key passed to map context is document and not doc. It looks like the native script assumes the document is available in doc map context... Renaming document into doc is a breaking change unfortunately but that's probably the best way to fix this issue. I am currently working on another feature to apply complex transformation to the document before to be stored in ES. It give the option to break down the document in multiple sub-documents. Unfortunately SearchLookup [1] does not seem to be able to support array of documents. So I need to check what the best options before to fix this issue. Suggestions are welcome. |
Sorry, I think my understanding of all this is currently not big enough to give a valid suggestion. :) |
Yes that's my theory :-) |
Ok, thank you, I will try that. Actually it might be a quickfix if you add the data in a second key doc. Than the map contains the data twice which is not nice but it wouldnt break the other script languages... |
Let me know if you can access the document with this change. |
Unfortunately it doesn't. doc() still returns null. Maybe it work because native scripts are normally used during a searchquery and doc() refers to query results... |
@MeiSign I will try to take a look. What is the reason you would like to use |
Thank you very much. What i try now is run groovy from my java script to get and write the document... |
I actually tried that but I dont know how to use an external Jar file. I asked at Stackoverflow for help but the way how you can use normally external jars in groovy doesnt work.
The rootLoader returns always null(leads to NullpointerException). |
If I recall correctly you only need to have the jars in your classpath and call import from your Groovy script. In my example with joda library I copied joda-time-2.2.jar in $ES_HOME/lib |
Oh wow, this makes it so much easier! 👍 |
Sounds like your problem was solved by using Groovy, so I'm going to close this |
I am currently trying to run a Nativescript with the "script" property of the river configuration. The script is starting as expected but the problem is that doc() is always null and I can't access any fields of the document to run my document transformation.
Any idea how to solve this?
The text was updated successfully, but these errors were encountered: