Last active
December 15, 2015 06:19
-
-
Save clintongormley/5215318 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET 'http://127.0.0.1:9200/events/event/_search?pretty=1' -d ' | |
{ | |
"facets" : { | |
"speaker" : { | |
"terms_stats" : { | |
"order" : "total", | |
"key_field" : "value", | |
"value_field" : "weight" | |
}, | |
"facet_filter" : { | |
"term" : { | |
"tags.type" : "speaker" | |
} | |
}, | |
"nested" : "tags" | |
}, | |
"place" : { | |
"terms_stats" : { | |
"order" : "total", | |
"key_field" : "value", | |
"value_field" : "weight" | |
}, | |
"facet_filter" : { | |
"term" : { | |
"tags.type" : "place" | |
} | |
}, | |
"nested" : "tags" | |
}, | |
"company" : { | |
"terms_stats" : { | |
"order" : "total", | |
"key_field" : "value", | |
"value_field" : "weight" | |
}, | |
"facet_filter" : { | |
"term" : { | |
"tags.type" : "company" | |
} | |
}, | |
"nested" : "tags" | |
} | |
} | |
} | |
' | |
# [Thu Mar 21 19:16:02 2013] Response: | |
# { | |
# "hits" : { | |
# "hits" : [ | |
# { | |
# "_source" : { | |
# "title" : "Barcelona is the bollocks", | |
# "tags" : [ | |
# { | |
# "value" : "Barcelona", | |
# "weight" : 30, | |
# "type" : "place" | |
# }, | |
# { | |
# "value" : "Mark Zuckerberg", | |
# "weight" : 30, | |
# "type" : "speaker" | |
# }, | |
# { | |
# "value" : "Facebook", | |
# "weight" : 40, | |
# "type" : "company" | |
# } | |
# ] | |
# }, | |
# "_score" : 1, | |
# "_index" : "events", | |
# "_id" : "ODpprcvGQ-SEFL0KBp3h9Q", | |
# "_type" : "event" | |
# }, | |
# { | |
# "_source" : { | |
# "title" : "Paris in the springtime", | |
# "tags" : [ | |
# { | |
# "value" : "Paris", | |
# "weight" : 10, | |
# "type" : "place" | |
# }, | |
# { | |
# "value" : "Eric Schmidt", | |
# "weight" : 100, | |
# "type" : "speaker" | |
# }, | |
# { | |
# "value" : "Google", | |
# "weight" : 50, | |
# "type" : "company" | |
# } | |
# ] | |
# }, | |
# "_score" : 1, | |
# "_index" : "events", | |
# "_id" : "q8iOOADTTNSkapd5_zuUuA", | |
# "_type" : "event" | |
# } | |
# ], | |
# "max_score" : 1, | |
# "total" : 2 | |
# }, | |
# "timed_out" : false, | |
# "_shards" : { | |
# "failed" : 0, | |
# "successful" : 5, | |
# "total" : 5 | |
# }, | |
# "facets" : { | |
# "speaker" : { | |
# "terms" : [ | |
# { | |
# "count" : 1, | |
# "min" : 100, | |
# "max" : 100, | |
# "mean" : 100, | |
# "total" : 100, | |
# "total_count" : 1, | |
# "term" : "Eric Schmidt" | |
# }, | |
# { | |
# "count" : 1, | |
# "min" : 30, | |
# "max" : 30, | |
# "mean" : 30, | |
# "total" : 30, | |
# "total_count" : 1, | |
# "term" : "Mark Zuckerberg" | |
# } | |
# ], | |
# "missing" : 0, | |
# "_type" : "terms_stats" | |
# }, | |
# "place" : { | |
# "terms" : [ | |
# { | |
# "count" : 1, | |
# "min" : 30, | |
# "max" : 30, | |
# "mean" : 30, | |
# "total" : 30, | |
# "total_count" : 1, | |
# "term" : "Barcelona" | |
# }, | |
# { | |
# "count" : 1, | |
# "min" : 10, | |
# "max" : 10, | |
# "mean" : 10, | |
# "total" : 10, | |
# "total_count" : 1, | |
# "term" : "Paris" | |
# } | |
# ], | |
# "missing" : 0, | |
# "_type" : "terms_stats" | |
# }, | |
# "company" : { | |
# "terms" : [ | |
# { | |
# "count" : 1, | |
# "min" : 50, | |
# "max" : 50, | |
# "mean" : 50, | |
# "total" : 50, | |
# "total_count" : 1, | |
# "term" : "Google" | |
# }, | |
# { | |
# "count" : 1, | |
# "min" : 40, | |
# "max" : 40, | |
# "mean" : 40, | |
# "total" : 40, | |
# "total_count" : 1, | |
# "term" : "Facebook" | |
# } | |
# ], | |
# "missing" : 0, | |
# "_type" : "terms_stats" | |
# } | |
# }, | |
# "took" : 5 | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment