Skip to content

Instantly share code, notes, and snippets.

@meconlin
Created October 25, 2013 17:10
Show Gist options
  • Save meconlin/7158212 to your computer and use it in GitHub Desktop.
Save meconlin/7158212 to your computer and use it in GitHub Desktop.
example - new aggregations - from es branch for 1.0
QUERY
{
"aggregations" : {
"terms" : {
"terms" : {
"field" : "value"
}
}
}
}
RESULTS
{
"took" : 77,
"timed_out" : false,
"_shards" : {
"total" : 3,
"successful" : 3,
"failed" : 0
},
"hits" : {
"total" : 5,
"max_score" : 1.0,
"hits" : [ {
"_index" : "idx",
"_type" : "type",
"_id" : "DolERIlcSoaLILtiWZOpDA",
"_score" : 1.0, "_source" : {"value":"val3","values":["val3","val4"]}
}, {
"_index" : "idx",
"_type" : "type",
"_id" : "_ePj-ubUT1OWV2VTu7yYfg",
"_score" : 1.0, "_source" : {"value":"val0","values":["val0","val1"]}
}, {
"_index" : "idx",
"_type" : "type",
"_id" : "d4DylwZuRPCsA-h0_jjigg",
"_score" : 1.0, "_source" : {"value":"val1","values":["val1","val2"]}
}, {
"_index" : "idx",
"_type" : "type",
"_id" : "8ySQgXfLRhOtvY3BO7lM9w",
"_score" : 1.0, "_source" : {"value":"val4","values":["val4","val5"]}
}, {
"_index" : "idx",
"_type" : "type",
"_id" : "YZg-XPsmS7a3efRpcsXZWA",
"_score" : 1.0, "_source" : {"value":"val2","values":["val2","val3"]}
} ]
},
"aggregations" : {
"terms" : {
"terms" : [ {
"term" : "val4",
"doc_count" : 1
}, {
"term" : "val3",
"doc_count" : 1
}, {
"term" : "val2",
"doc_count" : 1
}, {
"term" : "val1",
"doc_count" : 1
}, {
"term" : "val0",
"doc_count" : 1
} ]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment