Skip to content

Instantly share code, notes, and snippets.

@matthiasg
matthiasg / gist:2b8748cfdf919ce77c3fd0438613cee6
Created April 12, 2016 21:11 — forked from robinloxley1/gist:7ea7c4f37a3413b1ca16
sample elasticsearch query to sort parent based on child field
{
"query":{
"has_child":{
"query":{
"function_score":{
"functions":[
{
"field_value_factor":{
"factor":1,
"field":"count"