Skip to content

Instantly share code, notes, and snippets.

@plaflamme
Last active December 16, 2015 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plaflamme/3ec53a6ae6a5f6896066 to your computer and use it in GitHub Desktop.
Save plaflamme/3ec53a6ae6a5f6896066 to your computer and use it in GitHub Desktop.
{
"query": {
"bool" : {
"must" : [
{"term" : { "a_parent_field" : "a_value" } },
{
"has_child": {
"query": {
"custom_sore": {
"query" : { "match_all":{} },
"script" : "doc['a_child_field'].value"
}
}
}
},
"script": "_score[0] / _score[1] * some_constant"
]
}
}
}
@plaflamme
Copy link
Author

The script on the must clause in the bool query is what I'm not sure how to achieve. I know that's not legal syntax, but it should convey what I'd like to do. How do we go about doing something like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment