Hi,
Wonder if anyone could help. I've managed to get a query script up and
running, using JavaScript. The script resides in
/etc/elasticsearch/scripts.
I'm using a function_score query as follows:
"function_score": {
"query": {
"match_all": {}
},
"script_score": {
"script": "poot",
"params": {
"topics_dict_param": {
"4": 102
}
}
}
I'm passing into the JS script a dictionary of values.
Questions:
1. What determines the "return value" of the JS script? At the moment I
just have "retscore;" as a standalone line in the script, this seems to
work, but feels bit random. Would like something more explicit.
2. How can I debug the JS script? Can I output some values somewhere? E.g.
print, or log? If so, where does the output go?
3. The mapping of the ES index involves an array of nested objects e.g.
"things": {
"type": "nested",
"properties": {
"thing_id": {
"type": "long"
},
"count": {
"type": "long"
},
"sentiment": {
"type": "double"
}
}
},
Can I access this via _source.things? And if I can, can I do something like
_source.things[0].thing_id ?
Any help v welcome.
Thanks,
R
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/a0dd710c-0c45-49d1-9224-d46336997f51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.