Created
January 10, 2012 03:32
-
-
Save gibrown/1586723 to your computer and use it in GitHub Desktop.
Profiling queries for building word clouds
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
#word histogram query - docs for separate ids in separate types | |
curl -XGET "${SERVER}/pd-0/${ID}/_search?pretty" \ | |
-d '{ | |
"size" : 0, | |
"query" : { "match_all" : { } }, | |
"facets" : { | |
"q1" : { | |
"terms" : { | |
"field" : "q1", | |
"size" : 100 | |
} | |
} | |
} | |
}' | |
#word histogram query - all docs in same index - faceted_filter | |
curl -XGET "${SERVER}/pd-test-0/word_cloud/_search?pretty" \ | |
-d "{ | |
\"size\" : 0, | |
\"facets\" : { | |
\"q1\" : { | |
\"terms\" : { | |
\"field\" : \"q1\", | |
\"size\" : 100 | |
}, | |
\"facet_filter\" : { | |
\"term\" : { \"pd_id\" : \"$ID\" } | |
} | |
} | |
} | |
}" | |
#word histogram query - all docs in same index - query 'filter' of docs | |
curl -XGET "${SERVER}/pd-test-0/word_cloud/_search?pretty" \ | |
-d "{ | |
\"size\" : 0, | |
\"query\" : { | |
\"term\" : { \"pd_id\" : \"$ID\" } | |
}, | |
\"facets\" : { | |
\"q1\" : { | |
\"terms\" : { | |
\"field\" : \"q1\", | |
\"size\" : 100 | |
} | |
} | |
} | |
}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment